Class UserPassKey

  • All Implemented Interfaces:
    java.io.Serializable

    class UserPassKey
    extends java.lang.Object
    implements java.io.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
    • Constructor Summary

      Constructors 
      Constructor Description
      UserPassKey​(java.lang.String userName)  
      UserPassKey​(java.lang.String userName, char[] password)  
      UserPassKey​(java.lang.String userName, java.lang.String userPassword)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      Only takes the user name into account.
      java.lang.String getPassword()
      Gets the value of password.
      char[] getPasswordCharArray()
      Gets the value of password.
      java.lang.String getUsername()
      Gets the value of user name.
      int hashCode()
      Only takes the user name into account.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • userName

        private final java.lang.String userName
      • userPassword

        private final char[] userPassword
    • Constructor Detail

      • UserPassKey

        UserPassKey​(java.lang.String userName)
        Since:
        2.4.0
      • UserPassKey

        UserPassKey​(java.lang.String userName,
                    char[] password)
        Since:
        2.4.0
      • UserPassKey

        UserPassKey​(java.lang.String userName,
                    java.lang.String userPassword)
    • Method Detail

      • equals

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

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

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

        public java.lang.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 java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object