com.ibm.as400.security.auth
Class DefaultProfileTokenProvider

java.lang.Object
  extended by com.ibm.as400.security.auth.DefaultProfileTokenProvider
All Implemented Interfaces:
ProfileTokenProvider

public class DefaultProfileTokenProvider
extends Object
implements ProfileTokenProvider

A default implementation of the ProfileTokenProvider interface.


Constructor Summary
DefaultProfileTokenProvider()
          Constructs a new DefaultProfileTokenProvider
DefaultProfileTokenProvider(AS400 system)
          Constructs a new DefaultProfileTokenProvider.
 
Method Summary
protected  void checkFieldSet(int field, String description)
          Validate the specified field is set, that is, not null.
protected  void checkFieldSet(Object field, String fieldName)
          Validate the specified field is set, that is, not null.
 ProfileTokenCredential create()
          Creates and returns a new profile token credential.
 Object getExtendedInfo()
          Retrieves any extended information used during the creation of the profile token credential.
 AS400 getSystem()
          Retrieves the system that is used during the creation of the profile token credential.
 int getTimeoutInterval()
          Retrieves the timeout interval that is specified during the creation of the profile token credential.
 int getTokenType()
          Retrieves the token type that is specified during the creation of the profile token credential.
 String getUserId()
          Retrieves the user ID that is specified during the creation of the profile token credential.
protected  void setExtendedInfo(Object extendedInfo)
          Sets the extended information used during the creation of the profile token credential.
 void setPassword(String password)
          Sets the password for the user ID that is used during the creation of the profile token credential.
 void setPasswordSpecialValue(int specialValue)
          Sets the password special value to be used during the creation of the profile token credential.
 void setSystem(AS400 system)
          Sets the system that is used during the creation of the profile token credential.
 void setTimeoutInterval(int timeoutInterval)
          Sets the timeout interval that is specified during the creation of the profile token credential.
 void setTokenType(int tokenType)
          Sets the token type that is specified during the creation of the profile token credential.
 void setUserId(String userId)
          Sets the user ID that is used during the creation of the profile token credential.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultProfileTokenProvider

public DefaultProfileTokenProvider()
Constructs a new DefaultProfileTokenProvider


DefaultProfileTokenProvider

public DefaultProfileTokenProvider(AS400 system)
Constructs a new DefaultProfileTokenProvider. The specified system will be used during the creation of the profile token credential.

Parameters:
system - The system to use during the creation of the profile token credential.
Method Detail

getSystem

public AS400 getSystem()
Retrieves the system that is used during the creation of the profile token credential.

Returns:
The system that is used during the creation of the profile token credential. Returns null if the system has not been set.

setSystem

public void setSystem(AS400 system)
Sets the system that is used during the creation of the profile token credential.

Parameters:
system - The system for the profile token.

getTimeoutInterval

public int getTimeoutInterval()
Retrieves the timeout interval that is specified during the creation of the profile token credential.

Returns:
The timeout interval for the profile token. Returns -1 if the timeout interval has not been set.

setTimeoutInterval

public void setTimeoutInterval(int timeoutInterval)
Sets the timeout interval that is specified during the creation of the profile token credential.

Parameters:
timeoutInterval - The timeout interval for the profile token.

getTokenType

public int getTokenType()
Retrieves the token type that is specified during the creation of the profile token credential.

Returns:
The token type for the profile token. Returns null if the token type has not been set.

setTokenType

public void setTokenType(int tokenType)
Sets the token type that is specified during the creation of the profile token credential.

Parameters:
tokenType - The token type for the profile token. Valid values are:
Throws:
ExtendedIllegalArgumentException - If the input token type is not valid

getUserId

public String getUserId()
Retrieves the user ID that is specified during the creation of the profile token credential.

Returns:
The user ID for the profile token. Returns null if the user ID has not been set.

setUserId

public void setUserId(String userId)
Sets the user ID that is used during the creation of the profile token credential.

Parameters:
userId - The user ID for the profile token.

getExtendedInfo

public Object getExtendedInfo()
Retrieves any extended information used during the creation of the profile token credential. This extended information may be a password for the profile token user ID, a special value that instructs the profile token to be created in a certain manner, etc.

Returns:
Any extended information for the profile token. Returns null if the extended information has not been set.

setPassword

public void setPassword(String password)
Sets the password for the user ID that is used during the creation of the profile token credential.

Parameters:
password - The password for the user ID that is used during the creation of the profile token credential.

setPasswordSpecialValue

public void setPasswordSpecialValue(int specialValue)
Sets the password special value to be used during the creation of the profile token credential.

Parameters:
specialValue - The special value. Valid values for this parameter are:

Throws:
ExtendedIllegalArgumentException - If the input special value is not valid

setExtendedInfo

protected void setExtendedInfo(Object extendedInfo)
Sets the extended information used during the creation of the profile token credential.

Parameters:
extendedInfo - The extended information for the profile token.

create

public ProfileTokenCredential create()
                              throws AS400SecurityException
Creates and returns a new profile token credential. Before calling this method, the following properties must be set: system, timeout interval, user ID, token type, and extended info.

Specified by:
create in interface ProfileTokenProvider
Returns:
A newly created profile token credential
Throws:
AS400SecurityException - If an IBM i system security or authentication error occurs
ExtendedIllegalStateException - If a required property has not been set
See Also:
ProfileTokenProvider.create()

checkFieldSet

protected final void checkFieldSet(Object field,
                                   String fieldName)
Validate the specified field is set, that is, not null.

Parameters:
field - The field
fieldName - The name of the field to check

checkFieldSet

protected final void checkFieldSet(int field,
                                   String description)
Validate the specified field is set, that is, not null.

Parameters:
field - The field
description - The description to use for the exception thrown if the field is not set