Deprecated
(4.3) use ManagedHttpClientConnectionFactory.
| Modifier and Type | Field and Description |
|---|---|
| private volatile long | |
| private final ClientConnectionManager | manager
Deprecated
as a consequence of
ClientConnectionManager being deprecated.
|
| private final ClientConnectionOperator | operator
Deprecated
as a consequence of
ClientConnectionOperator being deprecated.
|
| private volatile HttpPoolEntry | poolEntry
Deprecated
as a consequence of
HttpPoolEntry being deprecated.
|
| private volatile boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv | ManagedClientConnectionImpl(final ClientConnectionManager manager, final ClientConnectionOperator operator, final HttpPoolEntry entry)
Deprecated
as a consequence of
ClientConnectionManager, ClientConnectionOperator and HttpPoolEntry being deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
| public void | abortConnection()
Implements org. |
| public void | bind(final Socket
the socket to bind the connection to. socket)Implements org. |
| public void | |
| pack-priv HttpPoolEntry | |
| private OperatedClientConnection | |
| private HttpPoolEntry | |
| public void | flush()
Implements org. |
| public Object | |
| private OperatedClientConnection | |
| public String | getId()
Implements org. |
| public InetAddress | |
| public int | |
| public ClientConnectionManager | |
| public HttpConnectionMetrics | getMetrics()
Implements org. |
| pack-priv HttpPoolEntry | |
| public InetAddress | |
| public int | |
| public HttpRoute | getRoute()
Implements org. |
| public Socket | getSocket()
Implements org. |
| public int | getSocketTimeout()
Implements org. |
| public SSLSession | getSSLSession()
Implements org. |
| public Object | getState()
Implements org. |
| public boolean | isMarkedReusable()
Implements org. |
| public boolean | |
| public boolean | isResponseAvailable(final int
the maximum time in milliseconds to wait for data timeout)Implements org. |
| public boolean | isSecure()
Implements org. |
| public boolean | isStale()
Implements org. |
| public void | layerProtocol(final HttpContext
the context for layering on top of this connection context, final HttpParams the parameters for layering on top of this connection params)Implements org.
Deprecated
as a consequence of
Layers a new protocol on top of a HttpParams being deprecated.
tunnelled
connection.
|
| public void | markReusable()
Implements org. |
| public void | open(final HttpRoute
the route along which to open. It will be opened to
the first proxy if present, or directly to the target. route, final HttpContext the context for opening this connection context, final HttpParams the parameters for opening this connection params)Implements org.
Deprecated
as a consequence of
Opens this connection according to the given route.
HttpParams being deprecated.
|
| public void | receiveResponseEntity(final HttpResponse
the response to attach the entity to response)Implements org. |
| public HttpResponse | receiveResponseHeader()
Implements org. |
| public void | releaseConnection()
Implements org. |
| public Object | |
| public void | sendRequestEntity(final HttpEntityEnclosingRequest
the request whose entity to send. request)Implements org. |
| public void | sendRequestHeader(final HttpRequest
the request whose headers to send. request)Implements org. |
| public void | |
| public void | setIdleDuration(final long duration, final TimeUnit unit)
Implements org. |
| public void | setSocketTimeout(final int
timeout value in milliseconds timeout)Implements org. |
| public void | setState(final Object
The state object state)Implements org. |
| public void | |
| public void | tunnelProxy(final HttpHost
the proxy to which the tunnel was established.
This is not the proxy through which
the tunnel was established, but the new end point
of the tunnel. The tunnel does not yet
reach to the target, use next, final boolean tunnelTarget
to indicate an end-to-end tunnel.true if the connection should be
considered secure, false otherwisethe parameters for tunnelling this connection params)Implements org.
Deprecated
as a consequence of
Indicates that a tunnel to an intermediate proxy has been established.
HttpParams being deprecated.
|
| public void | tunnelTarget(final boolean
true if the tunnel should be considered
secure, false otherwisethe parameters for tunnelling this connection params)Implements org.
Deprecated
as a consequence of
Indicates that a tunnel to the target has been established.
HttpParams being deprecated.
|
| public void | unmarkReusable()
Implements org. |
| duration | back to summary |
|---|---|
| private volatile long duration | |
| manager | back to summary |
|---|---|
| private final ClientConnectionManager manager
Deprecated as a consequence of | |
| operator | back to summary |
|---|---|
| private final ClientConnectionOperator operator
Deprecated as a consequence of | |
| poolEntry | back to summary |
|---|---|
| private volatile HttpPoolEntry poolEntry
Deprecated as a consequence of | |
| reusable | back to summary |
|---|---|
| private volatile boolean reusable | |
| ManagedClientConnectionImpl | back to summary |
|---|---|
| pack-priv ManagedClientConnectionImpl(final ClientConnectionManager manager, final ClientConnectionOperator operator, final HttpPoolEntry entry)
Deprecated as a consequence of | |
| abortConnection | back to summary |
|---|---|
| public void abortConnection() Implements org. Doc from org. Releases the connection without the option of keep-alive.
This is a "hard" release that implies a shutdown of the connection.
Use
| |
| bind | back to summary |
|---|---|
| public void bind(final Socket socket) throws IOException Implements org. Doc from org. Binds this connection to the given socket. The connection is considered open if it is bound and the underlying socket is connection to a remote host. | |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements org. Doc from org. Closes this connection gracefully.
This method will attempt to flush the internal output
buffer prior to closing the underlying socket.
This method MUST NOT be called from a different thread to force
shutdown of the connection. Use
| |
| detach | back to summary |
|---|---|
| pack-priv HttpPoolEntry detach()
Deprecated as a consequence of | |
| ensureConnection | back to summary |
|---|---|
| private OperatedClientConnection ensureConnection()
Deprecated as a consequence of | |
| ensurePoolEntry | back to summary |
|---|---|
| private HttpPoolEntry ensurePoolEntry()
Deprecated as a consequence of | |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Implements org. Doc from org. Writes out all pending buffered data over the open connection.
| |
| getAttribute | back to summary |
|---|---|
| public Object getAttribute(final String id) | |
| getConnection | back to summary |
|---|---|
| private OperatedClientConnection getConnection()
Deprecated as a consequence of | |
| getId | back to summary |
|---|---|
| public String getId() Implements org. Doc from org. Returns connection ID which is expected to be unique for the life span of the connection manager.
| |
| getLocalAddress | back to summary |
|---|---|
| public InetAddress getLocalAddress() Implements org.
| |
| getLocalPort | back to summary |
|---|---|
| public int getLocalPort() Implements org.
| |
| getManager | back to summary |
|---|---|
| public ClientConnectionManager getManager()
Deprecated as a consequence of | |
| getMetrics | back to summary |
|---|---|
| public HttpConnectionMetrics getMetrics() Implements org. Doc from org. Returns a collection of connection metrics.
| |
| getPoolEntry | back to summary |
|---|---|
| pack-priv HttpPoolEntry getPoolEntry()
Deprecated as a consequence of | |
| getRemoteAddress | back to summary |
|---|---|
| public InetAddress getRemoteAddress() Implements org.
| |
| getRemotePort | back to summary |
|---|---|
| public int getRemotePort() Implements org.
| |
| getRoute | back to summary |
|---|---|
| public HttpRoute getRoute() Implements org. Doc from org. Obtains the current route of this connection. | |
| getSocket | back to summary |
|---|---|
| public Socket getSocket() Implements org. Doc from org. Returns the underlying socket.
| |
| getSocketTimeout | back to summary |
|---|---|
| public int getSocketTimeout() Implements org. Doc from org. Returns the socket timeout value.
| |
| getSSLSession | back to summary |
|---|---|
| public SSLSession getSSLSession() Implements org. Doc from org. Obtains the SSL session of the underlying connection, if any.
If this connection is open, and the underlying socket is an
Note Whether the underlying socket is an SSL socket
can not necessarily be determined via
| |
| getState | back to summary |
|---|---|
| public Object getState() Implements org. Doc from org. Returns the state object associated with this connection. | |
| isMarkedReusable | back to summary |
|---|---|
| public boolean isMarkedReusable() Implements org. Doc from org. Indicates whether this connection is in a reusable communication state.
See
| |
| isOpen | back to summary |
|---|---|
| public boolean isOpen() Implements org. Doc from org. Checks if this connection is open.
| |
| isResponseAvailable | back to summary |
|---|---|
| public boolean isResponseAvailable(final int timeout) throws IOException Implements org. Doc from org. Checks if response data is available from the connection. May wait for the specified time until some data becomes available. Note that some implementations may completely ignore the timeout parameter.
| |
| isSecure | back to summary |
|---|---|
| public boolean isSecure() Implements org. Doc from org. Indicates whether this connection is secure. The return value is well-defined only while the connection is open. It may change even while the connection is open.
| |
| isStale | back to summary |
|---|---|
| public boolean isStale() Implements org. Doc from org. Checks whether this connection has gone down. Network connections may get closed during some time of inactivity for several reasons. The next time a read is attempted on such a connection it will throw an IOException. This method tries to alleviate this inconvenience by trying to find out if a connection is still usable. Implementations may do that by attempting a read with a very small timeout. Thus this method may block for a small amount of time before returning a result. It is therefore an expensive operation.
| |
| layerProtocol | back to summary |
|---|---|
| public void layerProtocol(final HttpContext context, final HttpParams params) throws IOException Implements org. Doc from org. Deprecated as a consequence of Layers a new protocol on top of a
| |
| markReusable | back to summary |
|---|---|
| public void markReusable() Implements org. Doc from org. Marks this connection as being in a reusable communication state. The checkpoints for reuseable communication states (in the absence of pipelining) are before sending a request and after receiving the response in its entirety. The connection will automatically clear the checkpoint when used for communication. A call to this method indicates that the next checkpoint has been reached.
A reusable communication state is necessary but not sufficient
for the connection to be reused.
A
| |
| open | back to summary |
|---|---|
| public void open(final HttpRoute route, final HttpContext context, final HttpParams params) throws IOException Implements org. Doc from org. Deprecated as a consequence of Opens this connection according to the given route.
| |
| receiveResponseEntity | back to summary |
|---|---|
| public void receiveResponseEntity(final HttpResponse response) throws HttpException, IOException Implements org. Doc from org. Receives the next response entity available from this connection and attaches it to an existing HttpResponse object.
| |
| receiveResponseHeader | back to summary |
|---|---|
| public HttpResponse receiveResponseHeader() throws HttpException, IOException Implements org. Doc from org. Receives the request line and headers of the next response available from this connection. The caller should examine the HttpResponse object to find out if it should try to receive a response entity as well.
| |
| releaseConnection | back to summary |
|---|---|
| public void releaseConnection() Implements org. Doc from org. Releases the connection with the option of keep-alive. This is a
"graceful" release and may cause IO operations for consuming the
remainder of a response entity. Use
| |
| removeAttribute | back to summary |
|---|---|
| public Object removeAttribute(final String id) | |
| sendRequestEntity | back to summary |
|---|---|
| public void sendRequestEntity(final HttpEntityEnclosingRequest request) throws HttpException, IOException Implements org. Doc from org. Sends the request entity over the connection.
| |
| sendRequestHeader | back to summary |
|---|---|
| public void sendRequestHeader(final HttpRequest request) throws HttpException, IOException Implements org. Doc from org. Sends the request line and all headers over the connection.
| |
| setAttribute | back to summary |
|---|---|
| public void setAttribute(final String id, final Object obj) | |
| setIdleDuration | back to summary |
|---|---|
| public void setIdleDuration(final long duration, final TimeUnit unit) Implements org. Doc from org. Sets the duration that this connection can remain idle before it is reused. The connection should not be used again if this time elapses. The idle duration must be reset after each request sent over this connection. The elapsed time starts counting when the connection is released, which is typically after the headers (and any response body, if present) is fully consumed.
| |
| setSocketTimeout | back to summary |
|---|---|
| public void setSocketTimeout(final int timeout) Implements org. Doc from org. Sets the socket timeout value.
| |
| setState | back to summary |
|---|---|
| public void setState(final Object state) Implements org. Doc from org. Assigns a state object to this connection. Connection managers may make use of the connection state when allocating persistent connections. | |
| shutdown | back to summary |
|---|---|
| public void shutdown() throws IOException Implements org. Doc from org. Force-closes this connection. This is the only method of a connection which may be called from a different thread to terminate the connection. This method will not attempt to flush the transmitter's internal buffer prior to closing the underlying socket.
| |
| tunnelProxy | back to summary |
|---|---|
| public void tunnelProxy(final HttpHost next, final boolean secure, final HttpParams params) throws IOException Implements org. Doc from org. Deprecated as a consequence of Indicates that a tunnel to an intermediate proxy has been established.
This is used exclusively for so-called proxy chains, where
a request has to pass through multiple proxies before reaching the
target. In that case, all proxies but the last need to be tunnelled
when establishing the connection. Tunnelling of the last proxy to the
target is optional and would be indicated via
| |
| tunnelTarget | back to summary |
|---|---|
| public void tunnelTarget(final boolean secure, final HttpParams params) throws IOException Implements org. Doc from org. Deprecated as a consequence of Indicates that a tunnel to the target has been established.
The route is the one previously passed to Note In HttpClient 3, a call to the corresponding method would automatically trigger the layering of the TLS/SSL protocol. This is not the case anymore, you can establish a tunnel without layering a new protocol over the connection.
| |
| unmarkReusable | back to summary |
|---|---|
| public void unmarkReusable() Implements org. Doc from org. Marks this connection as not being in a reusable state.
This can be used immediately before releasing this connection
to prevent its reuse. Reasons for preventing reuse include
error conditions and the evaluation of a
Note It is not necessary to call here before writing to
or reading from this connection. Communication attempts will
automatically unmark the state as non-reusable. It can then
be switched back using
| |