com.ibm.rational.rpe.common.utils
Class Credential

java.lang.Object
  extended by com.ibm.rational.rpe.common.utils.Credential

public class Credential
extends java.lang.Object

The credential class is used to store authentication information, which is used to access data sources, templates, stylesheets, and other artifacts. A credential has the following properties:

All members are optional and are null initially.


Field Summary
static java.lang.String AUTHENTICATION_METHOD_BASIC
          Deprecated. 
 
Constructor Summary
Credential()
           
Credential(java.lang.String cookies)
           
Credential(java.lang.String username, java.lang.String password)
           
Credential(java.lang.String username, java.lang.String password, java.lang.String cookies)
           
Credential(java.lang.String username, java.lang.String password, java.lang.String cookies, java.lang.String authenticationMethod)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getAuthenticationMethod()
           
 java.lang.String getCookies()
          Returns the cookies stored for this credential object.
 java.lang.String getPassword()
          Returns the password stored in this credential instance.
 java.lang.String getUsername()
          Returns the user name stored in this credential instance.
 int hashCode()
           
static boolean isEmpty(Credential credential)
          Returns true if the credential object that is passed as an argument is null or has no property set.
 void setAuthenticationMethod(java.lang.String authenticationMethod)
          Sets the authentication method to be used.
 void setCookies(java.lang.String cookies)
          Sets the cookies stored for this credential object.
 void setPassword(java.lang.String password)
          Sets the password stored in this credential instance.
 void setUsername(java.lang.String username)
          Sets the user name.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AUTHENTICATION_METHOD_BASIC

@Deprecated
public static final java.lang.String AUTHENTICATION_METHOD_BASIC
Deprecated. 
Deprecated. Use AuthenticationMethod.AUTHENTICATION_METHOD_BASIC

See Also:
Constant Field Values
Constructor Detail

Credential

public Credential()

Credential

public Credential(java.lang.String cookies)

Credential

public Credential(java.lang.String username,
                  java.lang.String password)

Credential

public Credential(java.lang.String username,
                  java.lang.String password,
                  java.lang.String cookies)

Credential

public Credential(java.lang.String username,
                  java.lang.String password,
                  java.lang.String cookies,
                  java.lang.String authenticationMethod)
Method Detail

getUsername

public java.lang.String getUsername()
Returns the user name stored in this credential instance. The default value is null.


setUsername

public void setUsername(java.lang.String username)
Sets the user name.


getPassword

public java.lang.String getPassword()
Returns the password stored in this credential instance. The default value is null. The password can be in plain text or in encrypted format. When the credential information is read from a document specification or a template, the password is in encrypted format.


setPassword

public void setPassword(java.lang.String password)
Sets the password stored in this credential instance. The value can be null. The password can be in plain text or in encrypted format. When the credential information is read from a document specification or a template, the password is in encrypted format.


getCookies

public java.lang.String getCookies()
Returns the cookies stored for this credential object. The default value is null. The cookies value does not get updated by Rational Publishing Engine during the authentication process so this property always returns the last value set via constructors or the setCookies method. Cookies and the username/password are usually mutually exclusive.


setCookies

public void setCookies(java.lang.String cookies)
Sets the cookies stored for this credential object. The cookies value is not updated by Rational Publishing Engine during the authentication process. Cookies and the username/password are usually mutually exclusive.


setAuthenticationMethod

public void setAuthenticationMethod(java.lang.String authenticationMethod)
Sets the authentication method to be used. If the value is empty, the RPE engine attempts all the known authentication methods in order until either one method succeeds or all methods fail. See AuthenticationMethod for the list of supported authentication methods. For the best performance, set this authentication method to same value used by the source.

Parameters:
authenticationMethod - - a string value from the list defined by AuthenticationMethod

getAuthenticationMethod

public java.lang.String getAuthenticationMethod()

isEmpty

public static boolean isEmpty(Credential credential)
Returns true if the credential object that is passed as an argument is null or has no property set.

Parameters:
credential -
Returns:

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object