class UserPassKey
extends java.lang.Object
implements java.io.Serializable
Holds a username, password pair. Serves as a poolable object key for the KeyedObjectPool backing a SharedPoolDataSource. Two instances with the same username are considered equal. This ensures that there will be only one keyed pool for each user in the pool. The password is used (along with the username) by the KeyedCPDSConnectionFactory when creating new connections.
InstanceKeyDataSource.getConnection(String, String)
validates that the password used to create
a connection matches the password provided by the client.
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
password |
private static long |
serialVersionUID |
private java.lang.String |
username |
Constructor and Description |
---|
UserPassKey(java.lang.String username,
java.lang.String password) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getPassword()
Get the value of password.
|
java.lang.String |
getUsername()
Get the value of username.
|
int |
hashCode()
Returns the hash of the username.
|
java.lang.String |
toString() |
private static final long serialVersionUID
private final java.lang.String password
private final java.lang.String username
public java.lang.String getPassword()
public java.lang.String getUsername()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
true
if the username fields for both
objects are equal. Two instances with the same username
but different passwords are considered equal.Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object