com.tivoli.pd.jutil
Class PDContext

java.lang.Object
  |
  +--com.tivoli.pd.jutil.PDContext

public class PDContext
extends java.lang.Object

This class encapsulates the communication session between the client application and the Access Manager policy server. It includes the client authentication, the client locale used to translate any returned messages and the policy server location.


Field Summary
static int PDAUTHTYPE_CERT
          Indicates a PDContext authenticated with a certficate.
static int PDAUTHTYPE_ID
          Indicates a PDContext authenticated with a user id and password.
 
Constructor Summary
PDContext(java.util.Locale locale, java.lang.String userid, char[] password, java.net.URL configURL)
          Contructs a PDContext based on a userid-password authentication and configuration information contained in the input configuration URL.
PDContext(java.util.Locale locale, java.net.URL configURL)
          Contructs a PDContext based on a certificate authentication and configuration information contained in the input configuration URL.
PDContext(java.lang.String userid, char[] password, java.net.URL configURL)
          Contructs a PDContext based on a userid-password authentication and configuration information contained in the input configuration URL.
PDContext(java.net.URL configURL)
          Contructs a PDContext based on a certificate authentication and configuration information contained in the input configuration URL.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Determines whether this PDContext is equivalent to the input object.
 int getAuthType()
          Returns the authentication type used in this context.
 java.util.Locale getLocale()
          Returns the locale that any return messages or error text will be translated into.
 java.lang.String getUserid()
          Returns the user whose authentication was used to establish this context.
 java.lang.String toString()
          Returns a String representation of this object.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PDAUTHTYPE_ID

public static final int PDAUTHTYPE_ID
Indicates a PDContext authenticated with a user id and password.

PDAUTHTYPE_CERT

public static final int PDAUTHTYPE_CERT
Indicates a PDContext authenticated with a certficate.
Constructor Detail

PDContext

public PDContext(java.util.Locale locale,
                 java.lang.String userid,
                 char[] password,
                 java.net.URL configURL)
          throws PDException
Contructs a PDContext based on a userid-password authentication and configuration information contained in the input configuration URL. Message data returned from operations using this context will be translated into the input locale.

This method requires the javax.security.auth.AuthPermission("PDAdmin") permission and permission to read the configuration URL.

Parameters:
locale - locale for any data that is returned.
userid - id of the user to be authenticated as.
password - password of the user to be authenticated as.
configURL - a URL reference to configuration data. The caller must have permission to access and read this URL. This URL is the same as the one specified to the SvrSslCfg configuration program. Currently, the only protocol supported is the "file" protocol; this restriction may be removed in a future release.
Throws:
PDException - on input argument errors. This exception may contain error and message codes defined in the product Error Message Reference document.

PDContext

public PDContext(java.lang.String userid,
                 char[] password,
                 java.net.URL configURL)
          throws PDException
Contructs a PDContext based on a userid-password authentication and configuration information contained in the input configuration URL. Message data returned from operations using this context will be translated into the default locale.

This method requires the javax.security.auth.AuthPermission("PDAdmin") permission and permission to read the configuration URL.

Parameters:
userid - id of the user to be authenticated as.
password - password of the user to be authenticated as.
configURL - a URL reference to configuration data. The caller must have permission to access and read this URL. This URL is the same as the one specified to the SvrSslCfg configuration program. Currently, the only protocol supported is the "file" protocol; this restriction may be removed in a future release.
Throws:
PDException - on input argument errors. This exception may contain error and message codes defined in the product Error Message Reference document.

PDContext

public PDContext(java.util.Locale locale,
                 java.net.URL configURL)
          throws PDException
Contructs a PDContext based on a certificate authentication and configuration information contained in the input configuration URL. Message data returned from operations using this context will be translated into the input locale.

This method requires the javax.security.auth.AuthPermission("PDAdmin") permission and permission to read the configuration URL.

Parameters:
locale - locale for any data that is returned.
configURL - a URL reference to configuration data. The caller must have permission to access and read this URL. This URL is the same as the one specified to the SvrSslCfg configuration program. Currently, the only protocol supported is the "file" protocol; this restriction may be removed in a future release.
Throws:
PDException - on input argument errors. This exception may contain error and message codes defined in the product Error Message Reference document.

PDContext

public PDContext(java.net.URL configURL)
          throws PDException
Contructs a PDContext based on a certificate authentication and configuration information contained in the input configuration URL. Message data returned from operations using this context will be translated into the default locale.

This method requires the javax.security.auth.AuthPermission("PDAdmin") permission and permission to read the configuration URL.

Parameters:
configURL - a URL reference to configuration data. The caller must have permission to access and read this URL. This URL is the same as the one specified to the SvrSslCfg configuration program. Currently, the only protocol supported is the "file" protocol; this restriction may be removed in a future release.
Throws:
PDException - on input argument errors. This exception may contain error and message codes defined in the product Error Message Reference document.
Method Detail

getLocale

public java.util.Locale getLocale()
Returns the locale that any return messages or error text will be translated into.

getUserid

public java.lang.String getUserid()
Returns the user whose authentication was used to establish this context.

getAuthType

public int getAuthType()
Returns the authentication type used in this context.
Returns:
PDAUTHTYPE_ID if this context has been authenticated with a userid and password or PDAUTHTYPE_CERT if this context has been authenticated with a certificate.

toString

public java.lang.String toString()
Returns a String representation of this object.
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Determines whether this PDContext is equivalent to the input object.
Overrides:
equals in class java.lang.Object