Class UserPassKey

java.lang.Object
org.apache.commons.dbcp2.datasources.UserPassKey
All Implemented Interfaces:
Serializable

final class UserPassKey extends Object implements Serializable

Holds a user name and password pair. Serves as a poolable object key for the KeyedObjectPool backing a SharedPoolDataSource. Two instances with the same user name 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 user name) 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.

Since:
2.0
  • Field Details

  • Constructor Details

    • UserPassKey

      UserPassKey(char[] userName, char[] password)
    • UserPassKey

      UserPassKey(CharArray userName, CharArray userPassword)
    • UserPassKey

      UserPassKey(String userName)
    • UserPassKey

      UserPassKey(String userName, char[] password)
    • UserPassKey

      UserPassKey(String userName, String userPassword)
  • Method Details

    • equals

      public boolean equals(Object obj)
      Only takes the user name into account.
      Overrides:
      equals in class Object
    • getPassword

      String getPassword()
      Gets the value of password.
      Returns:
      value of password.
    • getPasswordCharArray

      char[] getPasswordCharArray()
      Gets the value of password.
      Returns:
      value of password.
    • getUserName

      String getUserName()
      Gets the value of user name.
      Returns:
      value of user name.
    • hashCode

      public int hashCode()
      Only takes the user name into account.
      Overrides:
      hashCode in class Object