Class SignonHandlerAdapter
- java.lang.Object
-
- com.ibm.as400.access.SignonHandlerAdapter
-
- All Implemented Interfaces:
- SignonHandler
public abstract class SignonHandlerAdapter extends java.lang.Object implements SignonHandler
An abstract adapter class for receiving Toolbox sign-on events. The methods in this class perform bare-minimum default processing. This class exists as a convenience for application writers when creating customized sign-on handler objects.Extend this class to create a SignonHandler implementation and override the methods for the events of interest. (If you directly implement the SignonHandler interface, you must provide implementations for all of the SignonHandler methods. The SignonHandlerAdapter class provides default implementations for all SignonHandler methods, so you only have to implement methods for events you care about.)
Create a SignonHandler object using your extended class, and then register it with the system object using
setSignonHandler()
. When a sign-on related event occurs on the AS400 system object, the relevant method in your handler object is invoked.For all methods that return a boolean, returning true indicates that the sign-on should proceed; false indicates that the sign-on should be terminated.
In order to avoid hang conditions, the SignonHandler object must not attempt to display a GUI if
isGuiAvailable()
indicates false.In order to avoid infinite loops, a SignonHandler must not call the following AS400 methods:
- addPasswordCacheEntry()
- authenticate()
- connectService()
- validateSignon()
-
-
Constructor Summary
Constructors Constructor and Description SignonHandlerAdapter()
-
Method Summary
Methods Modifier and Type Method and Description boolean
connectionInitiated(SignonEvent event, boolean forceUpdate)
Returns true, indicating that the sign-on should proceed.void
exceptionOccurred(SignonEvent event)
Rethrows the exception.boolean
passwordAboutToExpire(SignonEvent event, int daysUntilExpiration)
Returns true, indicating that the sign-on should proceed.boolean
passwordExpired(SignonEvent event)
Returns false, indicating that the sign-on should not proceed.boolean
passwordIncorrect(SignonEvent event)
Returns false, indicating that the sign-on should not proceed.boolean
passwordLengthIncorrect(SignonEvent event)
Returns false, indicating that the sign-on should not proceed.boolean
passwordMissing(SignonEvent event)
Returns false, indicating that the sign-on should not proceed.boolean
systemNameMissing(SignonEvent event)
Returns false, indicating that the sign-on should not proceed.boolean
systemNameUnknown(SignonEvent event, java.net.UnknownHostException exc)
Returns false, indicating that the sign-on should not proceed.boolean
userIdAboutToBeDisabled(SignonEvent event)
Returns false, indicating that the sign-on should not proceed.boolean
userIdDefaultAlreadyAssigned(SignonEvent event, java.lang.String defaultUser)
Returns true, indicating that the sign-on should proceed.boolean
userIdDisabled(SignonEvent event)
Returns false, indicating that the sign-on should not proceed.boolean
userIdLengthIncorrect(SignonEvent event)
Returns false, indicating that the sign-on should not proceed.boolean
userIdMissing(SignonEvent event)
Returns false, indicating that the sign-on should not proceed.boolean
userIdUnknown(SignonEvent event)
Returns false, indicating that the sign-on should not proceed.
-
-
-
Method Detail
-
connectionInitiated
public boolean connectionInitiated(SignonEvent event, boolean forceUpdate)
Returns true, indicating that the sign-on should proceed.- Specified by:
connectionInitiated
in interfaceSignonHandler
- Parameters:
event
- The sign-on event.forceUpdate
- true indicates that the sign-on information is known to be incomplete or incorrect. false indicates that the information may be correct.- Returns:
- true
- See Also:
EventObject.getSource()
-
exceptionOccurred
public void exceptionOccurred(SignonEvent event) throws AS400SecurityException
Rethrows the exception.- Specified by:
exceptionOccurred
in interfaceSignonHandler
- Parameters:
event
- The sign-on event.- Throws:
AS400SecurityException
- If the handler cannot handle the exception.- See Also:
AS400SecurityException.getReturnCode()
-
passwordAboutToExpire
public boolean passwordAboutToExpire(SignonEvent event, int daysUntilExpiration)
Returns true, indicating that the sign-on should proceed.- Specified by:
passwordAboutToExpire
in interfaceSignonHandler
- Parameters:
event
- The sign-on event.daysUntilExpiration
- The number of days until the password expires.- Returns:
- true
- See Also:
AS400.changePassword(java.lang.String, java.lang.String)
-
passwordExpired
public boolean passwordExpired(SignonEvent event)
Returns false, indicating that the sign-on should not proceed.- Specified by:
passwordExpired
in interfaceSignonHandler
- Parameters:
event
- The sign-on event.- Returns:
- false
- See Also:
AS400.changePassword(java.lang.String, java.lang.String)
-
passwordIncorrect
public boolean passwordIncorrect(SignonEvent event)
Returns false, indicating that the sign-on should not proceed.- Specified by:
passwordIncorrect
in interfaceSignonHandler
- Parameters:
event
- The sign-on event.- Returns:
- false
- See Also:
AS400.setPassword(java.lang.String)
-
passwordLengthIncorrect
public boolean passwordLengthIncorrect(SignonEvent event)
Returns false, indicating that the sign-on should not proceed.- Specified by:
passwordLengthIncorrect
in interfaceSignonHandler
- Parameters:
event
- The sign-on event.- Returns:
- false
- See Also:
AS400.setPassword(java.lang.String)
-
passwordMissing
public boolean passwordMissing(SignonEvent event)
Returns false, indicating that the sign-on should not proceed.- Specified by:
passwordMissing
in interfaceSignonHandler
- Parameters:
event
- The sign-on event.- Returns:
- false
- See Also:
AS400.setPassword(java.lang.String)
-
systemNameMissing
public boolean systemNameMissing(SignonEvent event)
Returns false, indicating that the sign-on should not proceed.- Specified by:
systemNameMissing
in interfaceSignonHandler
- Parameters:
event
- The sign-on event.- Returns:
- false
- See Also:
AS400.setSystemName(java.lang.String)
-
systemNameUnknown
public boolean systemNameUnknown(SignonEvent event, java.net.UnknownHostException exc)
Returns false, indicating that the sign-on should not proceed.- Specified by:
systemNameUnknown
in interfaceSignonHandler
- Parameters:
event
- The sign-on event.exc
- The exception.- Returns:
- false
- See Also:
AS400.setSystemName(java.lang.String)
-
userIdDefaultAlreadyAssigned
public boolean userIdDefaultAlreadyAssigned(SignonEvent event, java.lang.String defaultUser)
Returns true, indicating that the sign-on should proceed.- Specified by:
userIdDefaultAlreadyAssigned
in interfaceSignonHandler
- Parameters:
event
- The sign-on event.defaultUser
- The current default user.- Returns:
- true
- See Also:
AS400.isUseDefaultUser()
,AS400.setUseDefaultUser(boolean)
,AS400.setDefaultUser(java.lang.String, java.lang.String)
-
userIdAboutToBeDisabled
public boolean userIdAboutToBeDisabled(SignonEvent event)
Returns false, indicating that the sign-on should not proceed.- Specified by:
userIdAboutToBeDisabled
in interfaceSignonHandler
- Parameters:
event
- The sign-on event.- Returns:
- false
- See Also:
AS400.setUserId(java.lang.String)
,AS400.setPassword(java.lang.String)
-
userIdDisabled
public boolean userIdDisabled(SignonEvent event)
Returns false, indicating that the sign-on should not proceed.- Specified by:
userIdDisabled
in interfaceSignonHandler
- Parameters:
event
- The sign-on event.- Returns:
- false
- See Also:
AS400.setUserId(java.lang.String)
-
userIdLengthIncorrect
public boolean userIdLengthIncorrect(SignonEvent event)
Returns false, indicating that the sign-on should not proceed.- Specified by:
userIdLengthIncorrect
in interfaceSignonHandler
- Parameters:
event
- The sign-on event.- Returns:
- false
- See Also:
AS400.setUserId(java.lang.String)
-
userIdMissing
public boolean userIdMissing(SignonEvent event)
Returns false, indicating that the sign-on should not proceed.- Specified by:
userIdMissing
in interfaceSignonHandler
- Parameters:
event
- The sign-on event.- Returns:
- false
- See Also:
AS400.setUserId(java.lang.String)
-
userIdUnknown
public boolean userIdUnknown(SignonEvent event)
Returns false, indicating that the sign-on should not proceed.- Specified by:
userIdUnknown
in interfaceSignonHandler
- Parameters:
event
- The sign-on event.- Returns:
- false
- See Also:
AS400.setUserId(java.lang.String)
-
-