IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid.security.plugins.builtins
Class UserPasswordCredential

java.lang.Object
  extended by com.ibm.websphere.objectgrid.security.plugins.builtins.UserPasswordCredential
All Implemented Interfaces:
Credential, Serializable

public class UserPasswordCredential
extends Object
implements Credential

This class represents a credential containing a user ID and password.

Since:
WAS XD 6.0.1, XC10
See Also:
Credential, UserPasswordCredentialGenerator.getCredential(), Serialized Form

Constructor Summary
UserPasswordCredential(String userName, String password)
          Creates a UserPasswordCredential with the specified user name and password.
 
Method Summary
 boolean equals(Object o)
          Checks two UserPasswordCredential objects for equality.
 String getPassword()
          Gets the password for this credential.
 String getUserName()
          Gets the user name for this credential.
 int hashCode()
          Returns the hashcode of the UserPasswordCredential object.
 void setPassword(String password)
          Sets the password for this credential.
 void setUserName(String userName)
          Sets the user name for this credential.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UserPasswordCredential

public UserPasswordCredential(String userName,
                              String password)
Creates a UserPasswordCredential with the specified user name and password.

Parameters:
userName - the user name for this credential
password - the password for this credential
Throws:
IllegalArgumentException - if userName or password is null
Method Detail

getUserName

public String getUserName()
Gets the user name for this credential.

Returns:
the user name argument that was passed to the constructor or the setUserName(String) method of this class
See Also:
setUserName(String)

setUserName

public void setUserName(String userName)
Sets the user name for this credential.

Parameters:
userName - the user name to set.
Throws:
IllegalArgumentException - if userName is null

getPassword

public String getPassword()
Gets the password for this credential.

Returns:
the password argument that was passed to the constructor or the setPassword(String) method of this class
See Also:
setPassword(String)

setPassword

public void setPassword(String password)
Sets the password for this credential.

Parameters:
password - the password to set.
Throws:
IllegalArgumentException - if password is null

equals

public boolean equals(Object o)
Checks two UserPasswordCredential objects for equality.

Two UserPasswordCredential objects are equal if and only if their user names and passwords are equal.

Specified by:
equals in interface Credential
Overrides:
equals in class Object
Parameters:
o - the object we are testing for equality with this object.
Returns:
true if both UserPasswordCredential objects are equivalent.
See Also:
Credential.equals(Object)

hashCode

public int hashCode()
Returns the hashcode of the UserPasswordCredential object.

Specified by:
hashCode in interface Credential
Overrides:
hashCode in class Object
Returns:
the hash code of this object
See Also:
Credential.hashCode()

toString

public String toString()
Overrides:
toString in class Object
Returns:
the string presentation of the UserPasswordCredential object.

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

© Copyright International Business Machines Corp 2005,2012. All rights reserved.