HttpClientConnectionManager
.@Deprecated public interface ManagedClientConnection extends HttpRoutedConnection, ManagedHttpClientConnection, ConnectionReleaseTrigger
Modifier and Type | Method and Description |
---|---|
HttpRoute |
getRoute()
Deprecated.
Obtains the current route of this connection.
|
SSLSession |
getSSLSession()
Deprecated.
Obtains the SSL session of the underlying connection, if any.
|
Object |
getState()
Deprecated.
Returns the state object associated with this connection.
|
boolean |
isMarkedReusable()
Deprecated.
Indicates whether this connection is in a reusable communication state.
|
boolean |
isSecure()
Deprecated.
Indicates whether this connection is secure.
|
void |
layerProtocol(org.apache.http.protocol.HttpContext context,
org.apache.http.params.HttpParams params)
Deprecated.
Layers a new protocol on top of a
tunnelled
connection. |
void |
markReusable()
Deprecated.
Marks this connection as being in a reusable communication state.
|
void |
open(HttpRoute route,
org.apache.http.protocol.HttpContext context,
org.apache.http.params.HttpParams params)
Deprecated.
Opens this connection according to the given route.
|
void |
setIdleDuration(long duration,
TimeUnit unit)
Deprecated.
Sets the duration that this connection can remain idle before it is
reused.
|
void |
setState(Object state)
Deprecated.
Assigns a state object to this connection.
|
void |
tunnelProxy(org.apache.http.HttpHost next,
boolean secure,
org.apache.http.params.HttpParams params)
Deprecated.
Indicates that a tunnel to an intermediate proxy has been established.
|
void |
tunnelTarget(boolean secure,
org.apache.http.params.HttpParams params)
Deprecated.
Indicates that a tunnel to the target has been established.
|
void |
unmarkReusable()
Deprecated.
Marks this connection as not being in a reusable state.
|
bind, getId, getSocket
flush, isResponseAvailable, receiveResponseEntity, receiveResponseHeader, sendRequestEntity, sendRequestHeader
getLocalAddress, getLocalPort, getRemoteAddress, getRemotePort
close, getMetrics, getSocketTimeout, isOpen, isStale, setSocketTimeout, shutdown
abortConnection, releaseConnection
boolean isSecure()
isSecure
in interface HttpRoutedConnection
true
if this connection is secure,
false
otherwiseHttpRoute getRoute()
getRoute
in interface HttpRoutedConnection
null
if not connectedSSLSession getSSLSession()
SSLSocket
, the SSL session of
that socket is obtained. This is a potentially blocking operation.
Note: Whether the underlying socket is an SSL socket
can not necessarily be determined via isSecure()
.
Plain sockets may be considered secure, for example if they are
connected to a known host in the same network segment.
On the other hand, SSL sockets may be considered insecure,
for example depending on the chosen cipher suite.
getSSLSession
in interface HttpRoutedConnection
getSSLSession
in interface ManagedHttpClientConnection
null
otherwisevoid open(HttpRoute route, org.apache.http.protocol.HttpContext context, org.apache.http.params.HttpParams params) throws IOException
route
- the route along which to open. It will be opened to
the first proxy if present, or directly to the target.context
- the context for opening this connectionparams
- the parameters for opening this connectionIOException
- in case of a problemvoid tunnelTarget(boolean secure, org.apache.http.params.HttpParams params) throws IOException
open
.
Subsequently, layerProtocol
can be called
to layer the TLS/SSL protocol on top of the tunnelled connection.
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.
secure
- true
if the tunnel should be considered
secure, false
otherwiseparams
- the parameters for tunnelling this connectionIOException
- in case of a problemvoid tunnelProxy(org.apache.http.HttpHost next, boolean secure, org.apache.http.params.HttpParams params) throws IOException
tunnelTarget(boolean, org.apache.http.params.HttpParams)
.next
- 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 tunnelTarget(boolean, org.apache.http.params.HttpParams)
to indicate an end-to-end tunnel.secure
- true
if the connection should be
considered secure, false
otherwiseparams
- the parameters for tunnelling this connectionIOException
- in case of a problemvoid layerProtocol(org.apache.http.protocol.HttpContext context, org.apache.http.params.HttpParams params) throws IOException
tunnelled
connection. This is typically used to create a TLS/SSL connection
through a proxy.
The route is the one previously passed to open
.
It is not guaranteed that the layered connection is
secure
.context
- the context for layering on top of this connectionparams
- the parameters for layering on top of this connectionIOException
- in case of a problemvoid markReusable()
A reusable communication state is necessary but not sufficient
for the connection to be reused.
A route
mismatch, the connection being closed,
or other circumstances might prevent reuse.
void unmarkReusable()
reuse strategy
.
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 markReusable
.
boolean isMarkedReusable()
markReusable
and
unmarkReusable
for details.true
if this connection is marked as being in
a reusable communication state,
false
otherwisevoid setState(Object state)
state
- The state objectObject getState()
void setIdleDuration(long duration, TimeUnit unit)
Copyright © 1999–2022 The Apache Software Foundation. All rights reserved.