com.tivoli.pd.jadmin
Class PDSSOCred

java.lang.Object
  extended by com.tivoli.pd.jutil.PDEnvironmentObject
      extended by com.tivoli.pd.jadmin.PDSSOCred
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class PDSSOCred
extends com.tivoli.pd.jutil.PDEnvironmentObject
implements java.lang.Cloneable

This class represents a single sign on (SSO) credential for a Security Access Manager user. An SSO credential is composed of a user, a resource, a resource type (resource or resource group), a resource userID and a resource password. A user can have more than one SSO credential, but an SSO credential cannot be assigned to more than one user.

Modes: Local,Remote

See Also:
Serialized Form

Nested Class Summary
static class PDSSOCred.CredID
          Class representing results returned from the listSSOCreds method.
static class PDSSOCred.CredInfo
          Class representing results returned from the listAndShowSSOCreds method.
 
Field Summary
static char[] PDSSOCRED_EMPTYPASSWORD
          Constant indicating an empty password value.
static java.lang.String PDSSOCRED_SSORESOURCE
          Constant indicating a resource type of "SSORESOURCE".
static java.lang.String PDSSOCRED_SSORESOURCEGROUP
          Constant indicating a resource type of "SSORESOURCEGROUP".
 
Constructor Summary
PDSSOCred(PDContext context, java.lang.String rName, java.lang.String rType, java.lang.String pUser, PDMessages messages)
          Creates a PDSSOCred object by retrieving the specified SSO Credential data from the Security Access Manager policy server.
 
Method Summary
 java.lang.Object clone()
          Returns a copy of this object.
static void createSSOCred(PDContext context, java.lang.String rName, java.lang.String rType, java.lang.String pUser, java.lang.String rUser, char[] rPassword, PDMessages messages)
          Creates an SSO resource or resource group credential for the specified Security Access Manager user in the Security Access Manager policy server.
static void deleteSSOCred(PDContext context, java.lang.String rName, java.lang.String rType, java.lang.String pUser, PDMessages messages)
          Deletes an SSO Credential from the Security Access Manager policy server.
 boolean equals(java.lang.Object obj)
          Determines whether this PDSSOCred is equivalent to the input object.
 java.lang.String getResourceName()
          Returns the name of the resource associated with the credential.
 char[] getResourcePassword()
          Returns the resource password associated with the credential.
 java.lang.String getResourceType()
          Returns the resource type associated with the credential.
 java.lang.String getResourceUser()
          Returns the resource user associated with the credential.
 java.lang.String getUser()
          Returns the Security Access Manager user associated with the credential.
static java.util.ArrayList listAndShowSSOCreds(PDContext context, java.lang.String pUser, PDMessages messages)
          Lists all of the details of the SSO Credentials for the specified Security Access Manager user.
static java.util.ArrayList listSSOCreds(PDContext context, java.lang.String pUser, PDMessages messages)
          Lists the IDs (user, resource and type) of the SSO Credentials for the specified Security Access Manager user.
 void setSSOCred(PDContext context, java.lang.String rUser, char[] rPassword, PDMessages messages)
          Modifies this SSO Credential's resource user.
static void setSSOCred(PDContext context, java.lang.String pUser, java.lang.String rName, java.lang.String rType, java.lang.String rUser, char[] rPassword, PDMessages messages)
          Modify the resource userID and/or the resource password of an SSO credential for the specified Security Access Manager user.
 java.lang.String toString()
          Returns a String representation of this object.
 
Methods inherited from class com.tivoli.pd.jutil.PDEnvironmentObject
getContext, setContext
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PDSSOCRED_SSORESOURCE

public static final java.lang.String PDSSOCRED_SSORESOURCE
Constant indicating a resource type of "SSORESOURCE".

See Also:
Constant Field Values

PDSSOCRED_SSORESOURCEGROUP

public static final java.lang.String PDSSOCRED_SSORESOURCEGROUP
Constant indicating a resource type of "SSORESOURCEGROUP".

See Also:
Constant Field Values

PDSSOCRED_EMPTYPASSWORD

public static final char[] PDSSOCRED_EMPTYPASSWORD
Constant indicating an empty password value.

Constructor Detail

PDSSOCred

public PDSSOCred(PDContext context,
                 java.lang.String rName,
                 java.lang.String rType,
                 java.lang.String pUser,
                 PDMessages messages)
          throws PDException
Creates a PDSSOCred object by retrieving the specified SSO Credential data from the Security Access Manager policy server.

This constructor corresponds to the ivadmin_ssocred_get() C API.

Parameters:
context - the context for communicating with the Security Access Manager policy server.
rName - the name of the resource associated with this credential. This value cannot be null and must have a non-zero length.
rType - the type of resource. Must be one of PDSSOCRED_SSORESOURCE or PDSSOCRED_SSORESOURCEGROUP.
pUser - the Security Access Manager user associated with the credential. This value cannot be null and must have a non-zero length.
messages - in/out parameter; empty PDMessages on input; may contain zero or more informational or warning messages on output.
Throws:
PDException - if an error occurs. This exception may contain error and message codes defined in the product Error Message Reference document.
Method Detail

getUser

public java.lang.String getUser()
                         throws PDException
Returns the Security Access Manager user associated with the credential.

This method corresponds to the ivadmin_ssocred_getuser() C API.

Throws:
PDException

getResourceName

public java.lang.String getResourceName()
                                 throws PDException
Returns the name of the resource associated with the credential.

This method corresponds to the ivadmin_ssocred_getid() C API.

Throws:
PDException

getResourceUser

public java.lang.String getResourceUser()
                                 throws PDException
Returns the resource user associated with the credential.

This method corresponds to the ivadmin_ssocred_getssouser() C API.

Throws:
PDException

getResourcePassword

public char[] getResourcePassword()
                           throws PDException
Returns the resource password associated with the credential.

This method corresponds to the ivadmin_ssocred_getssopassword() C API.

Throws:
PDException

getResourceType

public java.lang.String getResourceType()
                                 throws PDException
Returns the resource type associated with the credential. This will be either PDSSOCRED_SSORESOURCE or PDSSOCRED_SSORESOURCEGROUP.

This method corresponds to the ivadmin_ssocred_gettype() C API.

Throws:
PDException

setSSOCred

public void setSSOCred(PDContext context,
                       java.lang.String rUser,
                       char[] rPassword,
                       PDMessages messages)
                throws PDException
Modifies this SSO Credential's resource user. This change affects both the current object and the credential in the Security Access Manager policy server.

This method corresponds to the ivadmin_ssocred_set() C API.

Parameters:
context - the context for communicating with the Security Access Manager policy server.
rUser - the new resource user. This must be specified when modifying either the resource user or the resource password. An empty string will clear the resource user and password. This value cannot be null.
rPassword - the new resource password. Specifying an empty string will have no effect. To clear the password, call this method twice, first setting the username to the empty string, and then setting the username to its previous value.
messages - in/out parameter; empty PDMessages on input; may contain zero or more informational or warning messages on output.
Throws:
PDException - if an error occurs. This exception may contain error and message codes defined in the product Error Message Reference document.

toString

public java.lang.String toString()
Returns a String representation of this object.

Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()
Returns a copy of this object.

Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Determines whether this PDSSOCred is equivalent to the input object.

Overrides:
equals in class java.lang.Object

createSSOCred

public static void createSSOCred(PDContext context,
                                 java.lang.String rName,
                                 java.lang.String rType,
                                 java.lang.String pUser,
                                 java.lang.String rUser,
                                 char[] rPassword,
                                 PDMessages messages)
                          throws PDException
Creates an SSO resource or resource group credential for the specified Security Access Manager user in the Security Access Manager policy server.

This constructor corresponds to the ivadmin_ssocred_create() C API.

Parameters:
context - the context for communicating with the Security Access Manager policy server.
rName - the resource name associated with the credential. This value cannot not be null and must have a non-zero length.
rType - the type of resource associated with the credential. Must be one of PDSSOCRED_SSORESOURCE or PDSSOCRED_SSORESOURCEGROUP.
pUser - the Security Access Manager user associated with the credential. This value cannot be null and must have a non-zero length.
rUser - the resource user used to access the resource. This value cannot be null, but can have a zero length.
rPassword - the resource password used to access the resource. This value cannot be null, but can hava a zero length.
messages - in/out parameter; empty PDMessages on input; may contain zero or more informational or warning messages on output.
Throws:
PDException - if an error occurs. This exception may contain error and message codes defined in the product Error Message Reference document.

deleteSSOCred

public static void deleteSSOCred(PDContext context,
                                 java.lang.String rName,
                                 java.lang.String rType,
                                 java.lang.String pUser,
                                 PDMessages messages)
                          throws PDException
Deletes an SSO Credential from the Security Access Manager policy server.

This method corresponds to the ivadmin_ssocred_delete() C API.

Parameters:
context - the context for communicating with the Security Access Manager policy server.
rName - the resource name associated with the credential. This value cannot be null and must have a non-zero length.
rType - the type of resource associated with the credential (i.e. resource or resource group). This value must be one of PDSSOCRED_SSORESOURCE or PDSSOCRED_SSORESOURCEGROUP.
pUser - the Security Access Manager user associated with the credential. This value cannot be null and must have a non-zero length.
messages - in/out parameter; empty PDMessages on input; may contain zero or more informational or warning messages on output.
Throws:
PDException - if an error occurs. This exception may contain error and message codes defined in the product Error Message Reference document.

listSSOCreds

public static java.util.ArrayList listSSOCreds(PDContext context,
                                               java.lang.String pUser,
                                               PDMessages messages)
                                        throws PDException
Lists the IDs (user, resource and type) of the SSO Credentials for the specified Security Access Manager user. The returned list may be empty but it will never be null.

This method returns a subset of the information returned by the ivadmin_ssocred_list() C API.

Parameters:
context - the context for communicating with the Security Access Manager policy server.
pUser - the Security Access Manager user for which to return credentials. This value cannot be null and must have a non-zero length.
messages - in/out parameter; empty PDMessages on input; may contain zero or more informational or warning messages on output.
Returns:
an ArrayList of CredID objects that represent the Security Access Manager user's credentials. The returned list will never be null.
Throws:
PDException - if an error occurs. This exception may contain error and message codes defined in the product Error Message Reference document.

listAndShowSSOCreds

public static java.util.ArrayList listAndShowSSOCreds(PDContext context,
                                                      java.lang.String pUser,
                                                      PDMessages messages)
                                               throws PDException
Lists all of the details of the SSO Credentials for the specified Security Access Manager user. The returned list may be empty but it will never be null.

This method corresponds to the ivadmin_ssocred_list() C API.

Parameters:
context - the context for communicating with the Security Access Manager policy server.
pUser - the Security Access Manager user for which to return credentials. This value cannot be null and must have a non-zero length.
messages - in/out parameter; empty PDMessages on input; may contain zero or more informational or warning messages on output.
Returns:
an ArrayList of CredInfo objects that represent the details of the Security Access Manager user's credentials. The returned list will never be null.
Throws:
PDException - if an error occurs. This exception may contain error and message codes defined in the product Error Message Reference document.

setSSOCred

public static void setSSOCred(PDContext context,
                              java.lang.String pUser,
                              java.lang.String rName,
                              java.lang.String rType,
                              java.lang.String rUser,
                              char[] rPassword,
                              PDMessages messages)
                       throws PDException
Modify the resource userID and/or the resource password of an SSO credential for the specified Security Access Manager user.

This method corresponds to the ivadmin_ssocred_set() C API.

Parameters:
context - the context for communicating with the Security Access Manager policy server.
pUser - the Security Access Manager user associated with the credential. This value cannot be null and must have a non-zero length.
rName - the resource name associated with the credential. This value cannot be null and must have a non-zero length.
rType - the type of resource associated with the credential (i.e. resource or resource group). This value must be one of PDSSOCRED_SSORESOURCE or PDSSOCRED_SSORESOURCEGROUP.
rUser - the new resource user. This must be specified when modifying either the resource user or the resource password. An empty string will clear the resource user and password. This value cannot be null.
rPassword - the new resource password. Specifying an empty string will have no effect. To clear the password, call this method twice, first setting the username to the empty string, and then setting the username to its previous value.
messages - in/out parameter; empty PDMessages on input; may contain zero or more informational or warning messages on output.
Throws:
PDException - if an error occurs. This exception may contain error and message codes defined in the product Error Message Reference document.