Top Description Fields Constructors Methods
javax.resource.spi.security

public final Class PasswordCredential

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
javax.resource.spi.ManagedConnectionFactory

The class PasswordCredential acts as a holder for username and password.
Author
Rahul Sharma
Since
0.6
Version
0.6
See Also
javax.resource.spi.ManagedConnectionFactory

Field Summary

Modifier and TypeField and Description
private ManagedConnectionFactory
private char[]
private String

Constructor Summary

AccessConstructor and Description
public
PasswordCredential(String
the user name
userName
,
char[]
the user's password
password
)

Creates a new PasswordCredential object from the given user name and password.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if and if the specified object is a PasswordCredential whose username and password are equal to this instance.
equals
(Object
Object to which PasswordCredential is to be compared
other
)

Overrides java.lang.Object.equals.

Compares this PasswordCredential with the specified object for equality.
public ManagedConnectionFactory

Returns:

ManagedConnectionFactory instance for which user name and password have been specified
getManagedConnectionFactory
()

Gets the target ManagedConnectionFactory for which the user name and password has been set by the application server.

public char[]

Returns:

the password
getPassword
()

Returns the user password.

public String

Returns:

the user name
getUserName
()

Returns the user name.

public int

Returns:

hash code for this PasswordCredential
hashCode
()

Overrides java.lang.Object.hashCode.

Returns the hash code for this PasswordCredential
public void
setManagedConnectionFactory(ManagedConnectionFactory
ManagedConnectionFactory instance for which user name and password have been specified
mcf
)

Sets the target ManagedConenctionFactory instance for which the user name and password has been set by the application server.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

mcfback to summary
private ManagedConnectionFactory mcf
passwordback to summary
private char[] password
userNameback to summary
private String userName

Constructor Detail

PasswordCredentialback to summary
public PasswordCredential(String userName, char[] password)

Creates a new PasswordCredential object from the given user name and password.

Note that the given user password is cloned before it is stored in the new PasswordCredential object.

Parameters
userName:String

the user name

password:char[]

the user's password

Method Detail

equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Compares this PasswordCredential with the specified object for equality. The two PasswordCredential instances are the same if they are equal in username and password.

Parameters
other:Object

Object to which PasswordCredential is to be compared

Returns:boolean

true if and if the specified object is a PasswordCredential whose username and password are equal to this instance.

getManagedConnectionFactoryback to summary
public 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

ManagedConnectionFactory instance for which user name and password have been specified

getPasswordback to summary
public 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:char[]

the password

getUserNameback to summary
public String getUserName()

Returns the user name.

Returns:String

the user name

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns the hash code for this PasswordCredential

Returns:int

hash code for this PasswordCredential

setManagedConnectionFactoryback to summary
public 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

ManagedConnectionFactory instance for which user name and password have been specified