Package oracle.ucp

Interface ConnectionRetrievalInfo

All Superinterfaces:
oracle.ucp.RACConnectionRetrievalInfo

public interface ConnectionRetrievalInfo extends oracle.ucp.RACConnectionRetrievalInfo
The connection retrieval info is used for borrowing existing connections and for creating new ones. It contains resource-specific information that the connection factory adapter uses to create connections. For example, the JDBC connection retrieval info object maintains the user and password that are used to create a connection from a JDBC resource.

The connection retrieval info object also provides methods for equality and hash so that like-connections can be pooled efficiently.

The connection retrieval object supports Connection Labeling, a common mechanism for all types of connections. Represented as key/value pairs, connection labels are used for application-driven connection matching purposes.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addLabel(String key, String value)
    Adds a connection label to this connection retrieval info object.
    default Predicate<oracle.ucp.common.CoreConnection>
    Default predicate for CRI matching.
    boolean
    Checks whether this instance is equal to another.
    default boolean
    Checks whether this instance is equal to another.
    Clones this connection retrieval object but removes all the connection labels associated.
    default oracle.ucp.jdbc.JDBCConnectionRetrievalInfo
    Default db account's password can be changed, but CRI as a connection attribute still holds an old password.
    default oracle.ucp.common.CriStats
    get borrow conext metadata (counters, appropriate semaphores and queues).
    Retrieves all the connection labels stored on this connection retrieval info object.
    void
    Removes the connection label with the given key from this connection retrieval info object.

    Methods inherited from interface oracle.ucp.RACConnectionRetrievalInfo

    getConnectionAffinityCallback
  • Method Details

    • addLabel

      void addLabel(String key, String value) throws UniversalConnectionPoolException
      Adds a connection label to this connection retrieval info object. This can be used for both requested labels during a connection borrowing request or actual labels applied on a borrowed connection. The addition of connection labels is cumulative; the supplied key/value pair is added to those connection labels already on this object each time this method is called. However, for each particular label key, only the last applied value is retained.
      Parameters:
      key - The key of the connection label to be added. Cannot be null or an empty string.
      value - The value of the connection label to be added. Can be null or an empty string.
      Throws:
      UniversalConnectionPoolException - If the key is null or an empty string.
    • removeLabel

      void removeLabel(String key) throws UniversalConnectionPoolException
      Removes the connection label with the given key from this connection retrieval info object. This method does nothing if there is no label stored on this object with the specified key.
      Parameters:
      key - The key of the connection label to be removed. Cannot be null or an empty string.
      Throws:
      UniversalConnectionPoolException - If the key is null or an empty string.
    • getCopyWithNoLabels

      ConnectionRetrievalInfo getCopyWithNoLabels()
      Clones this connection retrieval object but removes all the connection labels associated.
      Returns:
      A clone ConnectionRetrievalInfo object with all connection labels removed.
    • getLabels

      Properties getLabels()
      Retrieves all the connection labels stored on this connection retrieval info object. Any change to the result Properties object does not affect the stored labels.
      Returns:
      A java.util.Properties object storing all the stored labels as key/value pairs. Returns null if there are no stored labels on this connection retrieval info object.
    • equalsIncludingPassword

      boolean equalsIncludingPassword(ConnectionRetrievalInfo cri)
      Checks whether this instance is equal to another. This method also checks for password equality in addition to the equals method.
      Parameters:
      cri - Connection retrieval info object.
      Returns:
      Returns true, if the given CRI is equal to the current instance CRI including password field.
    • equalsNotIncludingPassword

      default boolean equalsNotIncludingPassword(ConnectionRetrievalInfo cri)
      Checks whether this instance is equal to another. This method ignores password equality.
      Parameters:
      cri - Connection retrieval info object.
      cri -
      Returns:
      Returns true, if the given CRI is equal to the current instance CRI ignoring password field.
    • getCriMetadata

      default oracle.ucp.common.CriStats getCriMetadata()
      get borrow conext metadata (counters, appropriate semaphores and queues).
      Returns:
      CRI metadata.
    • criMatchSelector

      default Predicate<oracle.ucp.common.CoreConnection> criMatchSelector()
      Default predicate for CRI matching.
      Returns:
      CRI matching predicate.
    • getCopyWithUpdatedPassword

      default oracle.ucp.jdbc.JDBCConnectionRetrievalInfo getCopyWithUpdatedPassword()
      Default db account's password can be changed, but CRI as a connection attribute still holds an old password. Get a that CRI with updated password.
      Returns:
      CRI with updated password.