|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.resource.spi.security Class PasswordCredential
java.lang.Object javax.resource.spi.security.PasswordCredential
- All Implemented Interfaces:
- Serializable
public final class PasswordCredential
- extends Object
- implements Serializable
类 PasswordCredential 充当用户名和密码的保存者。
version | 0.6 |
since | 0.6 |
See also | javax.resource.spi.ManagedConnectionFactory |
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 Summary | |
---|---|
PasswordCredential(String userName,
char[] password)
Creates a new PasswordCredential object from the given
user name and password. |
Method Summary | |
---|---|
boolean |
equals(Object other)
Compares this PasswordCredential with the specified object for equality. |
ManagedConnectionFactory |
getManagedConnectionFactory()
Gets the target ManagedConnectionFactory for which the user name and password has been set by the application server. |
char[] |
getPassword()
Returns the user password. |
String |
getUserName()
Returns the user name. |
int |
hashCode()
Returns the hash code for this PasswordCredential |
void |
setManagedConnectionFactory(ManagedConnectionFactory mcf)
Sets the target ManagedConenctionFactory instance for which the user name and password has been set by the application server. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public
PasswordCredential(String userName, char[] password)
通过给定的用户名和密码创建一个新 PasswordCredential
对象。
注意,在新的 PasswordCredential
对象中存储给定的用户密码之前复制该密码。
userName | 用户名 |
password | 用户的密码 |
PasswordCredential
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
- the user namepassword
- the user's password
Method Detail |
---|
public String
getUserName()
返回用户名。
return | 用户名 |
getUserName
public String getUserName()
- Returns the user name.
- Returns:
- the user name
public char[]
getPassword()
返回用户密码。
注意,此方法返回到密码的引用。不再需要密码信息后,调用方负责将其归零。
return | 密码 |
getPassword
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:
- the password
public ManagedConnectionFactory
getManagedConnectionFactory()
获取应用服务器已经设置了用户名和密码的目标 ManagedConnectionFactory。ManagedConnectionFactory 使用此字段确定它是否应该使用 PasswordCredential 登录目标 EIS 实例。
return | 已指定用户名和密码的 ManagedConnectionFactory 实例 |
getManagedConnectionFactory
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 instance for which user name and password have been specified
public void
setManagedConnectionFactory(ManagedConnectionFactory mcf)
设置应用服务器已经设置了用户名和密码的目标 ManagedConenctionFactory 实例。
mcf | 已经指定了用户名和密码的 ManagedConnectionFactory 实例 |
setManagedConnectionFactory
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 instance for which user name and password have been specified
public boolean
equals(Object other)
比较此 PasswordCredential 与指定对象的相等性。如果它们的用户名和密码相同,则两个 PasswordCredential 实例相同。
other | 将其与 PasswordCredential 比较的对象 |
return | 如果指定的对象是 PasswordCredential,且与此实例具有相同的用户名和密码,则为 true。 |
equals
public 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.
- Parameters:
other
- Object to which PasswordCredential is to be compared- Returns:
- true if and if the specified object is a PasswordCredential whose username and password are equal to this instance.
public int
hashCode()
返回此 PasswordCredential 的哈希码
return | 此 PasswordCredential 的哈希码 |
hashCode
public int hashCode()
- Returns the hash code for this PasswordCredential
- Returns:
- hash code for this PasswordCredential
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!