Package jakarta.resource.spi.security
Class PasswordCredential
- java.lang.Object
- 
- jakarta.resource.spi.security.PasswordCredential
 
- 
- All Implemented Interfaces:
- Serializable
 
 public final class PasswordCredential extends Object implements Serializable The class PasswordCredential acts as a holder for username and password.- Since:
- 0.6
- Version:
- 0.6
- Author:
- Rahul Sharma
- See Also:
- ManagedConnectionFactory, Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description PasswordCredential(String userName, char[] password)Creates a newPasswordCredentialobject from the given user name and password.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)Compares this PasswordCredential with the specified object for equality.ManagedConnectionFactorygetManagedConnectionFactory()Gets the target ManagedConnectionFactory for which the user name and password has been set by the application server.char[]getPassword()Returns the user password.StringgetUserName()Returns the user name.inthashCode()Returns the hash code for this PasswordCredentialvoidsetManagedConnectionFactory(ManagedConnectionFactory mcf)Sets the target ManagedConenctionFactory instance for which the user name and password has been set by the application server.
 
- 
- 
- 
Constructor Detail- 
PasswordCredentialpublic PasswordCredential(String userName, char[] password) Creates a newPasswordCredentialobject from the given user name and password.Note that the given user password is cloned before it is stored in the new PasswordCredentialobject.- Parameters:
- userName- the user name
- password- the user's password
 
 
- 
 - 
Method Detail- 
getUserNamepublic String getUserName() Returns the user name.- Returns:
- the user name
 
 - 
getPasswordpublic char[] getPassword() Returns the user password.Note that this method returns a reference to the password. It is the caller's responsibility to zero out the password information after it is no longer needed. - Returns:
- the password
 
 - 
getManagedConnectionFactorypublic ManagedConnectionFactory getManagedConnectionFactory() Gets the target ManagedConnectionFactory for which the user name and password has been set by the application server. A ManagedConnection- Factory uses this field to find out whether PasswordCredential should be used by it for sign-on to the target EIS instance.- Returns:
- ManagedConnectionFactory instance for which user name and password have been specified
 
 - 
setManagedConnectionFactorypublic void setManagedConnectionFactory(ManagedConnectionFactory mcf) Sets the target ManagedConenctionFactory instance for which the user name and password has been set by the application server.- Parameters:
- mcf- ManagedConnectionFactory instance for which user name and password have been specified
 
 - 
equalspublic boolean equals(Object other) Compares this PasswordCredential with the specified object for equality. The two PasswordCredential instances are the same if they are equal in username and password.
 
- 
 
-