Class PoolEntry<T,C extends ModalCloseable>

java.lang.Object
org.apache.hc.core5.pool.PoolEntry<T,C>
Type Parameters:
T - the route type that represents the opposite endpoint of a pooled connection.
C - the connection type.

public final class PoolEntry<T,C extends ModalCloseable> extends Object
Pool entry containing a pool connection object along with its route.

The connection assigned to this pool entry may have an expiration time and also have an object representing a connection state (usually a security principal or a unique token identifying the user whose credentials have been used while establishing the connection).

Since:
4.2
  • Constructor Details

    • PoolEntry

      public PoolEntry(T route, TimeValue timeToLive, DisposalCallback<C> disposalCallback)
      Creates new PoolEntry instance.
      Parameters:
      route - route to the opposite endpoint.
      timeToLive - maximum time to live. May be zero if the connection does not have an expiry deadline.
      disposalCallback - callback invoked before connection disposal.
    • PoolEntry

      public PoolEntry(T route, TimeValue timeToLive)
      Creates new PoolEntry instance.
      Parameters:
      route - route to the opposite endpoint.
      timeToLive - maximum time to live. May be zero if the connection does not have an expiry deadline.
    • PoolEntry

      public PoolEntry(T route)
  • Method Details

    • getRoute

      public T getRoute()
    • getConnection

      public C getConnection()
    • getValidityDeadline

      public Deadline getValidityDeadline()
      Since:
      5.0
    • getState

      public Object getState()
    • getCreated

      public long getCreated()
      Since:
      5.2
    • getUpdated

      public long getUpdated()
    • getExpiryDeadline

      public Deadline getExpiryDeadline()
    • hasConnection

      public boolean hasConnection()
      Since:
      5.0
    • assignConnection

      public void assignConnection(C conn)
      Since:
      5.0
    • discardConnection

      public void discardConnection(CloseMode closeMode)
      Since:
      5.0
    • updateExpiry

      public void updateExpiry(TimeValue expiryTime)
      Since:
      5.0
    • updateState

      public void updateState(Object state)
      Since:
      5.0
    • toString

      public String toString()
      Overrides:
      toString in class Object