The purpose of an HTTP connection manager is to serve as a factory for new HTTP connections, manage persistent connections and synchronize access to persistent connections making sure that only one thread of execution can have access to a connection at a time.
Implementations of this interface must be thread-safe. Access to shared data must be synchronized as methods of this interface may be executed from multiple threads.
| Modifier and Type | Method and Description |
|---|---|
| public Future | connect(AsyncConnectionEndpoint
the managed endpoint. endpoint, ConnectionInitiator connectionInitiator, Timeout connect timeout. connectTimeout, Object connect request attachment. attachment, HttpContext the actual HTTP context. context, FutureCallback<AsyncConnectionEndpoint> result callback. callback)Connects the endpoint to the initial hop (connection target in case of a direct route or to the first proxy hop in case of a route via a proxy or multiple proxies). |
| public Future | lease(String
unique operation ID or id, HttpRoute null.HTTP route of the requested connection. route, Object expected state of the connection or state, Timeout null
if the connection is not expected to carry any state.lease request timeout. requestTimeout, FutureCallback<AsyncConnectionEndpoint> result callback. callback)Returns a |
| public void | release(AsyncConnectionEndpoint
the managed endpoint. endpoint, Object the new connection state of newState, TimeValue null if state-less.the duration of time this connection is valid for reuse. validDuration)Releases the endpoint back to the manager making it potentially re-usable by other consumers. |
| public void | upgrade(AsyncConnectionEndpoint
the managed endpoint. endpoint, Object the attachment the upgrade attachment object. attachment, HttpContext the actual HTTP context. context)Upgrades transport security of the given endpoint by using the TLS security protocol. |
| public default void | upgrade(AsyncConnectionEndpoint
the managed endpoint. endpoint, Object the attachment the upgrade attachment object. attachment, HttpContext the actual HTTP context. context, FutureCallback<AsyncConnectionEndpoint> result callback. callback)Upgrades transport security of the given endpoint by using the TLS security protocol. |
| connect | back to summary |
|---|---|
| public Future Connects the endpoint to the initial hop (connection target in case of a direct route or to the first proxy hop in case of a route via a proxy or multiple proxies).
| |
| lease | back to summary |
|---|---|
| public Future Returns a
Please note that newly allocated endpoints can be leased
| |
| release | back to summary |
|---|---|
| public void release(AsyncConnectionEndpoint endpoint, Object newState, TimeValue validDuration) Releases the endpoint back to the manager making it potentially
re-usable by other consumers. Optionally, the maximum period
of how long the manager should keep the connection alive can be
defined using
| |
| upgrade | back to summary |
|---|---|
| public void upgrade(AsyncConnectionEndpoint endpoint, Object attachment, HttpContext context) Upgrades transport security of the given endpoint by using the TLS security protocol.
| |
| upgrade | back to summary |
|---|---|
| public default void upgrade(AsyncConnectionEndpoint endpoint, Object attachment, HttpContext context, FutureCallback<AsyncConnectionEndpoint> callback) Upgrades transport security of the given endpoint by using the TLS security protocol.
| |