|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.as400.access.AS400
Represents the authentication information and a set of connections to a server.
If running under i5/OS or an older version of that operating system, the system name, user ID, and password do not need to be supplied. These values default to the local system. For the system name, the keyword localhost can be used to specify the local system. For the user ID and password, *CURRENT can be used.
If running on another operating system to a server, the system name, user ID, and password need to be supplied. If not supplied, the first open request associated with this object will prompt the workstation user. Subsequent opens associated with the same object will not prompt the workstation user. Keywords localhost and *CURRENT will not work when running from another operating system.
For example:
AS400 system = new AS400(); system.connectService(AS400.DATAQUEUE); // This causes a password prompt. ... system.connectService(AS400.FILE); // This does not cause a prompt.
Field Summary | |
---|---|
static int |
AUTHENTICATION_SCHEME_GSS_TOKEN
Constant indicating the authentication scheme is GSS token. |
static int |
AUTHENTICATION_SCHEME_IDENTITY_TOKEN
Constant indicating the authentication scheme is identity token. |
static int |
AUTHENTICATION_SCHEME_PASSWORD
Constant indicating the authentication scheme is password. |
static int |
AUTHENTICATION_SCHEME_PROFILE_TOKEN
Constant indicating the authentication scheme is profile token. |
static int |
CENTRAL
Constant indicating the Central service. |
static int |
COMMAND
Constant indicating the Command service. |
static int |
DATABASE
Constant indicating the Database service. |
static int |
DATAQUEUE
Constant indicating the Dataqueue service. |
static int |
FILE
Constant indicating the File service. |
static int |
GSS_OPTION_FALLBACK
Constant indicating that the JGSS framework will be attempted when no password or authentication token is set. |
static int |
GSS_OPTION_MANDATORY
Constant indicating that the JGSS framework must be used when no password or authentication token is set. |
static int |
GSS_OPTION_NONE
Constant indicating that the JGSS framework will not be used when no password or authentication token is set. |
static int |
PRINT
Constant indicating the Print service. |
static int |
RECORDACCESS
Constant indicating the Record Access service. |
static int |
SIGNON
Constant indicating the Sign-on service. |
static int |
USE_PORT_MAPPER
Special value indicating the service port should be retrieved from the port mapper server. |
Constructor Summary | |
---|---|
AS400()
Constructs an AS400 object. |
|
AS400(AS400 system)
Constructs an AS400 object. |
|
AS400(String systemName)
Constructs an AS400 object. |
|
AS400(String systemName,
ProfileTokenCredential profileToken)
Constructs an AS400 object. |
|
AS400(String systemName,
String userId)
Constructs an AS400 object. |
|
AS400(String systemName,
String userId,
String password)
Constructs an AS400 object. |
|
AS400(String systemName,
String userId,
String password,
String proxyServer)
Constructs an AS400 object. |
Method Summary | |
---|---|
void |
addConnectionListener(ConnectionListener listener)
Adds a listener to be notified when a connection event occurs. |
static void |
addPasswordCacheEntry(String systemName,
String userId,
String password)
Validates the user ID and password on the server, and if successful, adds the information to the password cache. |
static void |
addPasswordCacheEntry(String systemName,
String userId,
String password,
String proxyServer)
Validates the user ID and password on the server, and if successful, adds the information to the password cache. |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener to be notified when the value of any property is changed. |
void |
addVetoableChangeListener(VetoableChangeListener listener)
Adds a listener to be notified when the value of any constrained property is changed. |
boolean |
arePropertiesFrozen()
Indicates if properties are frozen. |
boolean |
authenticate(String userId,
String password)
Authenticates the user profile name and user profile password on the server. |
void |
changePassword(String oldPassword,
String newPassword)
Changes the user profile password. |
static void |
clearPasswordCache()
Clears the password cache for all servers within this Java virtual machine. |
static void |
clearPasswordCache(String systemName)
Clears all the passwords that are cached for the given system name within this Java virtual machine. |
void |
connectService(int service)
Connects to a service on the server. |
void |
disconnectAllServices()
Disconnects from the server. |
void |
disconnectService(int service)
Disconnects the service from the server. |
ProfileTokenCredential |
generateProfileToken(String userIdentity,
int tokenType,
int timeoutInterval)
Generates a profile token on behalf of the provided user identity. |
static int |
generateVRM(int version,
int release,
int modification)
Generates a VRM from a version, release, and modification. |
int |
getAuthenticationScheme()
Returns the authentication scheme for this object. |
int |
getCcsid()
Returns the CCSID for this object. |
String |
getDDMRDB()
Returns the relational database name (RDB name) used for record-level access (DDM) connections. |
static SignonHandler |
getDefaultSignonHandler()
Returns the default sign-on handler. |
static String |
getDefaultUser(String systemName)
Returns the default user ID for this system name. |
String |
getGSSName()
Returns the GSS name string. |
int |
getGSSOption()
Returns the option for how the JGSS framework will be used. |
String |
getJobCCSIDEncoding()
Returns the encoding that corresponds to the job CCSID of the server. |
Job[] |
getJobs(int service)
Returns an array of Job objects representing the server jobs to which this object is connected. |
Locale |
getLocale()
Returns the Locale associated with this system object. |
int |
getModification()
Returns the modification level of the server. |
String |
getNLV()
Returns the National Language Version (NLV) that will be sent to the server. |
GregorianCalendar |
getPasswordExpirationDate()
Returns the password expiration date for the signed-on user. |
static int |
getPasswordExpirationWarningDays()
Returns the number of days before password expiration to start warning the user. |
GregorianCalendar |
getPreviousSignonDate()
Returns the date of the last successful sign-on. |
ProfileTokenCredential |
getProfileToken()
Deprecated. Use getProfileToken(int, int) instead. |
ProfileTokenCredential |
getProfileToken(int tokenType,
int timeoutInterval)
Authenticates the assigned user profile and password and returns a corresponding ProfileTokenCredential if successful. |
ProfileTokenCredential |
getProfileToken(String userId,
String password)
Authenticates the given user profile and password and returns a corresponding ProfileTokenCredential if successful. |
ProfileTokenCredential |
getProfileToken(String userId,
String password,
int tokenType,
int timeoutInterval)
Authenticates the given user profile and password and returns a corresponding ProfileTokenCredential if successful. |
String |
getProxyServer()
Returns the name of the middle-tier machine where the proxy server is running. |
int |
getRelease()
Returns the release of the server. |
int |
getServicePort(int service)
Returns the service port stored in the service port table for the specified service. |
GregorianCalendar |
getSignonDate()
Returns the date for the current sign-on. |
SignonHandler |
getSignonHandler()
Returns the sign-on handler that is used by this object. |
SocketProperties |
getSocketProperties()
Returns a copy of the socket options object. |
String |
getSystemName()
Returns the name of the system. |
String |
getUserId()
Returns the user ID. |
int |
getVersion()
Returns the version of the server. |
int |
getVRM()
Returns the version, release, and modification level for the server. |
void |
initializeConverter(int ccsid)
Initialize conversion table for the given CCSID. |
boolean |
isConnected()
Indicates if any service is currently connected through this object. |
boolean |
isConnected(int service)
Indicates if a service is currently connected through this object. |
boolean |
isGuiAvailable()
Returns the sign-on prompting mode for this object. |
boolean |
isLocal()
Indicates if this object is representing the system you are currently running on. |
boolean |
isMustUseSockets()
When your Java program runs on the server, some Toolbox classes access data via a call to an API instead of making a socket call to a server. |
boolean |
isShowCheckboxes()
Indicates if checkboxes should be shown on the sign-on dialog. |
boolean |
isThreadUsed()
Indicates whether threads are used in communication with the host servers. |
boolean |
isUseDefaultUser()
Indicates if the default user should be used by this object. |
boolean |
isUsePasswordCache()
Indicates if the password cache is being used by this object. |
void |
removeConnectionListener(ConnectionListener listener)
Removes a listener from the connection event list. |
static void |
removeDefaultUser(String systemName)
Removes the default user for the given system name. |
static void |
removePasswordCacheEntry(String systemName,
String userId)
Removes the password cache entry associated with this system name and user ID. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a property changed listener from the listener list. |
void |
removeVetoableChangeListener(VetoableChangeListener listener)
Removes a listener from the veto list. |
void |
resetAllServices()
Disconnect all services and clear sign-on information. |
void |
setCcsid(int ccsid)
Sets the CCSID to be used for this object. |
void |
setDDMRDB(String ddmRDB)
Sets the relational database name (RDB name) used for record-level access (DDM) connections. |
static void |
setDefaultSignonHandler(SignonHandler handler)
Sets the default sign-on handler, globally across the JVM. |
static boolean |
setDefaultUser(String systemName,
String userId)
Sets the default user for a given system name. |
void |
setGSSCredential(Object gssCredential)
Sets the GSS credential for this object. |
void |
setGSSName(String gssName)
Sets the GSS name for this object. |
void |
setGSSOption(int gssOption)
Sets the option for how the JGSS framework will be used to retrieve a GSS token for authenticating to the server. |
void |
setGuiAvailable(boolean guiAvailable)
Sets the environment in which you are running. |
void |
setIdentityToken(byte[] identityToken)
Sets or resets the identity token for this object. |
void |
setLocale(Locale locale)
Sets the Locale used to set the National Language Version (NLV) on the server. |
void |
setLocale(Locale locale,
String nlv)
Sets the Locale and a specific National Language Version (NLV) to send to the server. |
void |
setMustUseSockets(boolean mustUseSockets)
Sets this object to using sockets. |
void |
setPassword(String password)
Sets the password for this object. |
static void |
setPasswordExpirationWarningDays(int days)
Sets the number of days before password expiration to warn the user. |
void |
setProfileToken(ProfileTokenCredential profileToken)
Sets or resets the profile token for this object. |
void |
setProxyServer(String proxyServer)
Sets the name and port of the middle-tier machine where the proxy server is running. |
void |
setServicePort(int service,
int port)
Sets the service port in the service port table for the specified service for this system name. |
void |
setServicePortsToDefault()
Sets the ports in the service port table for all the services for this system name to their default values. |
void |
setShowCheckboxes(boolean showCheckboxes)
Indicates if checkboxes should be shown on the sign-on dialog. |
void |
setSignonHandler(SignonHandler handler)
Sets the sign-on handler for this AS400 object. |
void |
setSocketProperties(SocketProperties socketProperties)
Sets the socket options the IBM Toolbox for Java will set on its client side sockets. |
void |
setSystemName(String systemName)
Sets the system name for this object. |
void |
setThreadUsed(boolean useThreads)
Sets whether the IBM Toolbox for Java uses threads in communication with the host servers. |
void |
setUseDefaultUser(boolean useDefaultUser)
Sets the indicator for whether the default user is used. |
void |
setUsePasswordCache(boolean usePasswordCache)
Sets the indicator for whether the password cache is used. |
void |
setUserId(String userId)
Sets the user ID for this object. |
String |
toString()
Returns the text representation of this AS400 object. |
boolean |
validateSignon()
Validates the user ID and password on the server but does not add to the signed-on list. |
boolean |
validateSignon(String password)
Validates the user ID and password on the server but does not add to the signed-on list. |
boolean |
validateSignon(String userId,
String password)
Validates the user ID and password on the server but does not add to the signed-on list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int FILE
public static final int PRINT
public static final int COMMAND
public static final int DATAQUEUE
public static final int DATABASE
public static final int RECORDACCESS
public static final int CENTRAL
public static final int SIGNON
public static final int USE_PORT_MAPPER
public static final int AUTHENTICATION_SCHEME_PASSWORD
public static final int AUTHENTICATION_SCHEME_GSS_TOKEN
public static final int AUTHENTICATION_SCHEME_PROFILE_TOKEN
public static final int AUTHENTICATION_SCHEME_IDENTITY_TOKEN
public static final int GSS_OPTION_MANDATORY
public static final int GSS_OPTION_FALLBACK
public static final int GSS_OPTION_NONE
Constructor Detail |
public AS400()
If running on the server, the target is the local system. This has the same effect as using localhost for the system name, *CURRENT for the user ID, and *CURRENT for the password.
If running on another system to a server, a sign-on prompt may be displayed. The user is then able to specify the system name, user ID, and password.
public AS400(String systemName)
If running under the i5/OS to another server or to itself, the user ID and password of the current job are used.
If running on another operating system to a server, the user may be prompted for the user ID and password if a default user has not been established for this server.
systemName
- The name of the server. Use localhost to access data locally.public AS400(String systemName, String userId)
systemName
- The name of the server. Use localhost to access data locally.userId
- The user profile name to use to authenticate to the server. If running on the server, *CURRENT may be used to specify the current user ID.public AS400(String systemName, ProfileTokenCredential profileToken)
systemName
- The name of the server. Use localhost to access data locally.profileToken
- The profile token to use to authenticate to the server.public AS400(String systemName, String userId, String password)
systemName
- The name of the server. Use localhost to access data locally.userId
- The user profile name to use to authenticate to the server. If running on the server, *CURRENT may be used to specify the current user ID.password
- The user profile password to use to authenticate to the server. If running on the server, *CURRENT may be used to specify the current user ID.public AS400(String systemName, String userId, String password, String proxyServer)
systemName
- The name of the server. Use localhost to access data locally.userId
- The user profile name to use to authenticate to the server. If running on the server, *CURRENT may be used to specify the current user ID.password
- The user profile password to use to authenticate to the server. If running on the server, *CURRENT may be used to specify the current user ID.proxyServer
- The name and port of the proxy server in the format serverName[:port]
. If no port is specified, a default will be used.public AS400(AS400 system)
system
- A previously instantiated AS400 object.Method Detail |
public void addConnectionListener(ConnectionListener listener)
listener
- The listener object.public static void addPasswordCacheEntry(String systemName, String userId, String password) throws AS400SecurityException, IOException
systemName
- The name of the server.userId
- The user profile name.password
- The user profile password.
AS400SecurityException
- If a security or authority error occurs.
IOException
- If an error occurs while communicating with the server.public static void addPasswordCacheEntry(String systemName, String userId, String password, String proxyServer) throws AS400SecurityException, IOException
systemName
- The name of the server.userId
- The user profile name.password
- The user profile password.proxyServer
- The name and port of the proxy server in the format serverName[:port]
. If no port is specified, a default will be used.
AS400SecurityException
- If a security or authority error occurs.
IOException
- If an error occurs while communicating with the server.public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- The listener object.public void addVetoableChangeListener(VetoableChangeListener listener)
listener
- The listener object.public boolean arePropertiesFrozen()
public boolean authenticate(String userId, String password) throws AS400SecurityException, IOException
This method is functionally equivalent to the validateSignon() method. It does not alter the user profile assigned to this object, impact the status of existing connections, or otherwise impact the user and authorities under which the application is running.
The system name needs to be set prior to calling this method.
Note: Providing an incorrect password increments the number of failed sign-on attempts for the user profile, and can result in the profile being disabled.
Note: This will return true if the information is successfully validated. An unsuccessful validation will cause an exception to be thrown, false is never returned.
userId
- The user profile name.password
- The user profile password.
AS400SecurityException
- If a security or authority error occurs.
IOException
- If an error occurs while communicating with the server.public void changePassword(String oldPassword, String newPassword) throws AS400SecurityException, IOException
oldPassword
- The old user profile password.newPassword
- The new user profile password.
AS400SecurityException
- If a security or authority error occurs.
IOException
- If an error occurs while communicating with the server.public static void clearPasswordCache()
public static void clearPasswordCache(String systemName)
systemName
- The name of the server.public void connectService(int service) throws AS400SecurityException, IOException
Services typically connect implicitly; therefore, this method does not have to be called to use a service. This method can be used to control when the connection is established.
service
- The name of the service. Valid services are:
AS400SecurityException
- If a security or authority error occurs.
IOException
- If an error occurs while communicating with the server.public void disconnectAllServices()
public void disconnectService(int service)
service
- The name of the service. Valid services are:
public ProfileTokenCredential generateProfileToken(String userIdentity, int tokenType, int timeoutInterval) throws AS400SecurityException, IOException
Invoking this method does not change the user ID and password assigned to the system or otherwise modify the user or authorities under which the application is running. The profile associated with this system object must have enough authority to generate an authentication token for another user.
This function is only supported if the server is at operating system release V5R3M0 or greater.
userIdentity
- The LDAP distinguished name.tokenType
- The type of profile token to create. Possible types are defined as fields on the ProfileTokenCredential class:
timeoutInterval
- The number of seconds to expiration when the token is created (1-3600).
AS400SecurityException
- If a security or authority error occurs.
IOException
- If an error occurs while communicating with the server.public static int generateVRM(int version, int release, int modification)
version
- The version.release
- The release.modification
- The modification level.
public int getAuthenticationScheme()
public int getCcsid()
public static SignonHandler getDefaultSignonHandler()
setDefaultSignonHandler(com.ibm.as400.access.SignonHandler)
public String getDDMRDB()
setDDMRDB(java.lang.String)
public static String getDefaultUser(String systemName)
systemName
- The name of the server.
public String getGSSName()
public int getGSSOption()
public String getJobCCSIDEncoding() throws AS400SecurityException, IOException, InterruptedException
AS400SecurityException
- If a security or authority error occurs.
IOException
- If an error occurs while communicating with the server.
InterruptedException
- If this thread is interrupted.public Job[] getJobs(int service)
service
- The name of the service. Valid services are:
public Locale getLocale()
public int getModification() throws AS400SecurityException, IOException
A connection is required to the server to retrieve this information. If a connection has not been established, one is created to retrieve the server information.
AS400SecurityException
- If a security or authority error occurs.
IOException
- If an error occurs while communicating with the server.public String getNLV()
public GregorianCalendar getPasswordExpirationDate() throws AS400SecurityException, IOException
A connection is required to the server to retrieve this information. If a connection has not been established, one is created to retrieve the server information.
AS400SecurityException
- If a security or authority error occurs.
IOException
- If an error occurs while communicating with the server.public static int getPasswordExpirationWarningDays()
public GregorianCalendar getPreviousSignonDate() throws AS400SecurityException, IOException
A connection is required to the server to retrieve this information. If a connection has not been established, one is created to retrieve the server information.
AS400SecurityException
- If a security or authority error occurs.
IOException
- If an error occurs while communicating with the server.public ProfileTokenCredential getProfileToken() throws AS400SecurityException, IOException, InterruptedException
The returned token will be created single-use with a one hour time to expiration. Subsequent method calls will return the same token, regardless of the token status.
This function is not supported if the assigned password is *CURRENT.
This function is only supported if the server is at operating system release V4R5M0 or greater.
AS400SecurityException
- If a security or authority error occurs.
IOException
- If an error occurs while communicating with the server.
InterruptedException
- If this thread is interrupted.public ProfileTokenCredential getProfileToken(int tokenType, int timeoutInterval) throws AS400SecurityException, IOException, InterruptedException
This function is not supported if the assigned password is *CURRENT and cannot be used to generate a renewable token. This function is only supported if the server is at operating system release V4R5M0 or greater.
tokenType
- The type of profile token to create. Possible types are defined as fields on the ProfileTokenCredential class:
timeoutInterval
- The number of seconds to expiration when the token is created (1-3600).
AS400SecurityException
- If a security or authority error occurs.
IOException
- If an error occurs while communicating with the server.
InterruptedException
- If this thread is interrupted.public ProfileTokenCredential getProfileToken(String userId, String password) throws AS400SecurityException, IOException, InterruptedException
Invoking this method does not change the user ID and password assigned to the system or otherwise modify the user or authorities under which the application is running.
This method generates a single use token with a timeout of one hour.
This function is only supported if the server is at operating system release V4R5M0 or greater.
Note: Providing an incorrect password increments the number of failed sign-on attempts for the user profile, and can result in the profile being disabled. Refer to documentation on the ProfileTokenCredential class for additional restrictions.
userId
- The user profile name.password
- The user profile password.
AS400SecurityException
- If a security or authority error occurs.
IOException
- If an error occurs while communicating with the server.
InterruptedException
- If this thread is interrupted.public ProfileTokenCredential getProfileToken(String userId, String password, int tokenType, int timeoutInterval) throws AS400SecurityException, IOException, InterruptedException
Invoking this method does not change the user ID and password assigned to the system or otherwise modify the user or authorities under which the application is running.
This function is only supported if the server is at release V4R5M0 or greater.
Note: Providing an incorrect password increments the number of failed sign-on attempts for the user profile, and can result in the profile being disabled. Refer to documentation on the ProfileTokenCredential class for additional restrictions.
userId
- The user profile name.password
- The user profile password.tokenType
- The type of profile token to create. Possible types are defined as fields on the ProfileTokenCredential class:
timeoutInterval
- The number of seconds to expiration when the token is created (1-3600).
AS400SecurityException
- If a security or authority error occurs.
IOException
- If an error occurs while communicating with the server.
InterruptedException
- If this thread is interrupted.public String getProxyServer()
public int getRelease() throws AS400SecurityException, IOException
A connection is required to the server in order to retrieve this information. If a connection has not been established, one is created to retrieve the server information.
AS400SecurityException
- If a security or authority error occurs.
IOException
- If an error occurs while communicating with the server.public int getServicePort(int service)
service
- The name of the service. Valid services are:
public GregorianCalendar getSignonDate() throws AS400SecurityException, IOException
A connection is required to the server to retrieve this information. If a connection has not been established, one is created to retrieve the server information.
AS400SecurityException
- If a security or authority error occurs.
IOException
- If an error occurs while communicating with the server.public SignonHandler getSignonHandler()
setSignonHandler(com.ibm.as400.access.SignonHandler)
,
setDefaultSignonHandler(com.ibm.as400.access.SignonHandler)
public SocketProperties getSocketProperties()
public String getSystemName()
public String getUserId()
public int getVersion() throws AS400SecurityException, IOException
A connection is required to the server to retrieve this information. If a connection has not been established, one is created to retrieve the server information.
AS400SecurityException
- If a security or authority error occurs.
IOException
- If an error occurs while communicating with the server.public int getVRM() throws AS400SecurityException, IOException
A connection is required to the server to retrieve this information. If a connection has not been established, one is created to retrieve the server information.
AS400SecurityException
- If a security or authority error occurs.
IOException
- If an error occurs while communicating with the server.public void initializeConverter(int ccsid) throws UnsupportedEncodingException
ccsid
- the CCSID for the conversion table to initialize.
UnsupportedEncodingException
public boolean isConnected()
A service is connected if connectService() has been called, or an implicit connect has been done by the service, and disconnectService() or disconnectAllServices() has not been called. If the most recent attempt to contact the service failed with an exception, the service is considered disconnected.
public boolean isConnected(int service)
A service is connected if connectService() has been called, or an implicit connect has been done by the service, and disconnectService() or disconnectAllServices() has not been called. If the most recent attempt to contact the service failed with an exception, the service is considered disconnected.
service
- The name of the service. Valid services are:
public boolean isGuiAvailable()
public boolean isLocal()
public boolean isMustUseSockets()
public boolean isShowCheckboxes()
public boolean isThreadUsed()
public boolean isUseDefaultUser()
public boolean isUsePasswordCache()
public void removeConnectionListener(ConnectionListener listener)
listener
- The listener object.public static void removeDefaultUser(String systemName)
systemName
- The name of the server.public static void removePasswordCacheEntry(String systemName, String userId)
systemName
- The name of the server.userId
- The user profile name.public void removePropertyChangeListener(PropertyChangeListener listener)
listener
- The listener object.public void removeVetoableChangeListener(VetoableChangeListener listener)
listener
- The listener object.public void resetAllServices()
public void setIdentityToken(byte[] identityToken)
Note: Authentication via IdentityToken is not currently supported. Support will become available in a future PTF for operating system releases V5R2M0 and V5R1M0.
identityToken
- The identity token.public void setCcsid(int ccsid) throws PropertyVetoException
ccsid
- The CCSID to use for this object.
PropertyVetoException
- If any of the registered listeners vetos the property change.public void setDDMRDB(String ddmRDB)
RECORDACCESS
service; you must call AS400.disconnectService(AS400.RECORDACCESS)
first.
ddmRDB
- The name of the IASP or RDB to use, or null to indicate the default system ASP should be used.isConnected(int)
,
getDDMRDB()
public static void setDefaultSignonHandler(SignonHandler handler)
setSignonHandler()
.
handler
- The sign-on handler. Specifying null will reset the default sign-on handler to the internal AWT-based handler.getDefaultSignonHandler()
public static boolean setDefaultUser(String systemName, String userId)
systemName
- The name of the server.userId
- The user profile name.
public void setGSSCredential(Object gssCredential)
gssCredential
- The GSS credential object. The object's type must be org.ietf.jgss.GSSCredential, the object is set to type Object only to avoid a JDK release dependency.public void setGSSOption(int gssOption)
gssOption
- A constant indicating how GSS will be used. Valid values are:
public void setGSSName(String gssName)
gssName
- The GSS name string.public void setGuiAvailable(boolean guiAvailable) throws PropertyVetoException
guiAvailable
- true to prompt; false otherwise.
PropertyVetoException
- If any of the registered listeners vetos the property change.public void setLocale(Locale locale)
locale
- The Locale object.public void setLocale(Locale locale, String nlv)
locale
- The Locale object.nlv
- The NLV.public void setMustUseSockets(boolean mustUseSockets)
mustUseSockets
- true to use sockets; false otherwise.public void setPassword(String password)
password
- The user profile password.public static void setPasswordExpirationWarningDays(int days)
days
- The number of days before expiration to start the warning. Set to -1 to turn off warning.public void setProfileToken(ProfileTokenCredential profileToken)
profileToken
- The profile token.public void setProxyServer(String proxyServer) throws PropertyVetoException
The name of the middle-tier machine is ignored in a two-tier environment. If no middle-tier machine is specified, then it is assumed that no middle-tier will be accessed. The name of the middle-tier machine cannot be changed once a connection to this machine has been established.
proxyServer
- The name and port of the proxy server in the format serverName[:port]
. If no port is specified, a default will be used.
PropertyVetoException
- If any of the registered listeners vetos the property change.public void setServicePort(int service, int port)
service
- The name of the service. Valid services are:
port
- The port to use for this service. The value USE_PORT_MAPPER can be used to specify that the next connection to this service should ask the port mapper server for the port number.public void setServicePortsToDefault()
public void setShowCheckboxes(boolean showCheckboxes)
showCheckboxes
- true to show checkboxes; false otherwise.public void setSignonHandler(SignonHandler handler)
handler
- The sign-on handler. Specifying null will reset the default sign-on handler to the internal AWT-based handler.getSignonHandler()
,
setDefaultSignonHandler(com.ibm.as400.access.SignonHandler)
public void setSocketProperties(SocketProperties socketProperties)
socketProperties
- The set of socket options to set. The options are copied from this object, not shared.public void setSystemName(String systemName) throws PropertyVetoException
systemName
- The name of the server. Use localhost to access data locally.
PropertyVetoException
- If any of the registered listeners vetos the property change.public void setThreadUsed(boolean useThreads) throws PropertyVetoException
useThreads
- true to use threads; false otherwise.
PropertyVetoException
- If any of the registered listeners vetos the property change.public void setUseDefaultUser(boolean useDefaultUser) throws PropertyVetoException
useDefaultUser
- The value indicating if the default user should be used. Set to true if default user should be used; false otherwise.
PropertyVetoException
- If any of the registered listeners vetos the property change.public void setUsePasswordCache(boolean usePasswordCache) throws PropertyVetoException
usePasswordCache
- The value indicating whether the password cache should be used. Set to true to use the password cache; false otherwise.
PropertyVetoException
- If any of the registered listeners vetos the property change.public void setUserId(String userId) throws PropertyVetoException
userId
- The user profile name.
PropertyVetoException
- If any of the registered listeners vetos the property change.public String toString()
public boolean validateSignon() throws AS400SecurityException, IOException
Note: This will return true if the information is successfully validated. An unsuccessful validation will cause an exception to be thrown, false is never returned.
AS400SecurityException
- If a security or authority error occurs.
IOException
- If an error occurs while communicating with the server.public boolean validateSignon(String password) throws AS400SecurityException, IOException
Note: This will return true if the information is successfully validated. An unsuccessful validation will cause an exception to be thrown, false is never returned.
password
- The user profile password to validate.
AS400SecurityException
- If a security or authority error occurs.
IOException
- If an error occurs while communicating with the server.public boolean validateSignon(String userId, String password) throws AS400SecurityException, IOException
Note: This will return true if the information is successfully validated. An unsuccessful validation will cause an exception to be thrown, false is never returned.
userId
- The user profile name to validate.password
- The user profile password to validate.
AS400SecurityException
- If a security or authority error occurs.
IOException
- If an error occurs while communicating with the server.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |