com.ibm.as400.access
Class SignonHandlerAdapter

java.lang.Object
  extended by com.ibm.as400.access.SignonHandlerAdapter
All Implemented Interfaces:
SignonHandler

public abstract class SignonHandlerAdapter
extends 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 creating sign-on handler objects.

Extend this class to create a SignonHandler implementation and override the methods for the events of interest. (If you implement the SignonHandler interface, you have to define all of the methods in it. This abstract class defines default methods for them all, so you only have to define methods for events you care about.)

Create a SignonHandler object using the extended class and then register it with the system object using setSignonHandler(). When a sign-on related event occurs on the system object, the relevant method in the 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 should 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:

See Also:
AS400.setSignonHandler(com.ibm.as400.access.SignonHandler), AS400.getSignonHandler(), AS400.setDefaultSignonHandler(com.ibm.as400.access.SignonHandler), AS400.getDefaultSignonHandler()

Constructor Summary
Constructor and Description
SignonHandlerAdapter()
           
 
Method Summary
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, 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, 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SignonHandlerAdapter

public SignonHandlerAdapter()
Method Detail

connectionInitiated

public boolean connectionInitiated(SignonEvent event,
                                   boolean forceUpdate)
Returns true, indicating that the sign-on should proceed.

Specified by:
connectionInitiated in interface SignonHandler
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 interface SignonHandler
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 interface SignonHandler
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 interface SignonHandler
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 interface SignonHandler
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 interface SignonHandler
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 interface SignonHandler
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 interface SignonHandler
Parameters:
event - The sign-on event.
Returns:
false
See Also:
AS400.setSystemName(java.lang.String)

systemNameUnknown

public boolean systemNameUnknown(SignonEvent event,
                                 UnknownHostException exc)
Returns false, indicating that the sign-on should not proceed.

Specified by:
systemNameUnknown in interface SignonHandler
Parameters:
event - The sign-on event.
exc - The exception.
Returns:
false
See Also:
AS400.setSystemName(java.lang.String)

userIdDefaultAlreadyAssigned

public boolean userIdDefaultAlreadyAssigned(SignonEvent event,
                                            String defaultUser)
Returns true, indicating that the sign-on should proceed.

Specified by:
userIdDefaultAlreadyAssigned in interface SignonHandler
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 interface SignonHandler
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 interface SignonHandler
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 interface SignonHandler
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 interface SignonHandler
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 interface SignonHandler
Parameters:
event - The sign-on event.
Returns:
false
See Also:
AS400.setUserId(java.lang.String)