org.apache.hc.core5.pool

## 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 Summary

    Constructors
    Constructor and Description
    `PoolEntry(T route)`
    `PoolEntry(T route, TimeValue timeToLive)` Creates new `PoolEntry` instance.
    `PoolEntry(T route, TimeValue timeToLive, DisposalCallback<C> disposalCallback)` Creates new `PoolEntry` instance.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `assignConnection(C conn)`
    `void` | `discardConnection(CloseMode closeMode)`
    `C` | `getConnection()`
    `Deadline` | `getExpiryDeadline()`
    `T` | `getRoute()`
    `Object` | `getState()`
    `long` | `getUpdated()`
    `Deadline` | `getValidityDeadline()`
    `boolean` | `hasConnection()`
    `String` | `toString()`
    `void` | `updateExpiry(TimeValue expiryTime)`
    `void` | `updateState(Object state)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### 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 Detail

    - #### getRoute

          public T getRoute()

    - #### getConnection

          public C getConnection()

    - #### getValidityDeadline

          public Deadline getValidityDeadline()

      Since:
        5.0

    - #### getState

          public Object getState()

    - #### 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`

Copyright © 2005–2020 The Apache Software Foundation. All rights reserved.