Interface ManagedClientConnection
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
,ConnectionReleaseTrigger
,HttpClientConnection
,HttpConnection
,HttpInetConnection
,HttpRoutedConnection
,ManagedHttpClientConnection
- All Known Implementing Classes:
AbstractClientConnAdapter
,AbstractPooledConnAdapter
,BasicPooledConnAdapter
@Deprecated public interface ManagedClientConnection extends HttpRoutedConnection, ManagedHttpClientConnection, ConnectionReleaseTrigger
Deprecated.(4.3) replaced byHttpClientConnectionManager
.A client-side connection with advanced connection logic. Instances are typically obtained from a connection manager.- Since:
- 4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description HttpRoute
getRoute()
Deprecated.Obtains the current route of this connection.javax.net.ssl.SSLSession
getSSLSession()
Deprecated.Obtains the SSL session of the underlying connection, if any.java.lang.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(HttpContext context, HttpParams params)
Deprecated.Layers a new protocol on top of atunnelled
connection.void
markReusable()
Deprecated.Marks this connection as being in a reusable communication state.void
open(HttpRoute route, HttpContext context, HttpParams params)
Deprecated.Opens this connection according to the given route.void
setIdleDuration(long duration, java.util.concurrent.TimeUnit unit)
Deprecated.Sets the duration that this connection can remain idle before it is reused.void
setState(java.lang.Object state)
Deprecated.Assigns a state object to this connection.void
tunnelProxy(HttpHost next, boolean secure, HttpParams params)
Deprecated.Indicates that a tunnel to an intermediate proxy has been established.void
tunnelTarget(boolean secure, 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.-
Methods inherited from interface org.apache.http.conn.ConnectionReleaseTrigger
abortConnection, releaseConnection
-
Methods inherited from interface org.apache.http.HttpClientConnection
flush, isResponseAvailable, receiveResponseEntity, receiveResponseHeader, sendRequestEntity, sendRequestHeader
-
Methods inherited from interface org.apache.http.HttpConnection
close, getMetrics, getSocketTimeout, isOpen, isStale, setSocketTimeout, shutdown
-
Methods inherited from interface org.apache.http.HttpInetConnection
getLocalAddress, getLocalPort, getRemoteAddress, getRemotePort
-
Methods inherited from interface org.apache.http.conn.ManagedHttpClientConnection
bind, getId, getSocket
-
-
-
-
Method Detail
-
isSecure
boolean isSecure()
Deprecated.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.- Specified by:
isSecure
in interfaceHttpRoutedConnection
- Returns:
true
if this connection is secure,false
otherwise
-
getRoute
HttpRoute getRoute()
Deprecated.Obtains the current route of this connection.- Specified by:
getRoute
in interfaceHttpRoutedConnection
- Returns:
- the route established so far, or
null
if not connected
-
getSSLSession
javax.net.ssl.SSLSession getSSLSession()
Deprecated.Obtains the SSL session of the underlying connection, if any. If this connection is open, and the underlying socket is anSSLSocket
, 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.- Specified by:
getSSLSession
in interfaceHttpRoutedConnection
- Specified by:
getSSLSession
in interfaceManagedHttpClientConnection
- Returns:
- the underlying SSL session if available,
null
otherwise
-
open
void open(HttpRoute route, HttpContext context, HttpParams params) throws java.io.IOException
Deprecated.Opens this connection according to the given route.- Parameters:
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 connection- Throws:
java.io.IOException
- in case of a problem
-
tunnelTarget
void tunnelTarget(boolean secure, HttpParams params) throws java.io.IOException
Deprecated.Indicates that a tunnel to the target has been established. The route is the one previously passed toopen
. 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.
- Parameters:
secure
-true
if the tunnel should be considered secure,false
otherwiseparams
- the parameters for tunnelling this connection- Throws:
java.io.IOException
- in case of a problem
-
tunnelProxy
void tunnelProxy(HttpHost next, boolean secure, HttpParams params) throws java.io.IOException
Deprecated.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 viatunnelTarget(boolean, org.apache.http.params.HttpParams)
.- Parameters:
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, usetunnelTarget(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 connection- Throws:
java.io.IOException
- in case of a problem
-
layerProtocol
void layerProtocol(HttpContext context, HttpParams params) throws java.io.IOException
Deprecated.Layers a new protocol on top of atunnelled
connection. This is typically used to create a TLS/SSL connection through a proxy. The route is the one previously passed toopen
. It is not guaranteed that the layered connection issecure
.- Parameters:
context
- the context for layering on top of this connectionparams
- the parameters for layering on top of this connection- Throws:
java.io.IOException
- in case of a problem
-
markReusable
void markReusable()
Deprecated.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
route
mismatch, the connection being closed, or other circumstances might prevent reuse.
-
unmarkReusable
void unmarkReusable()
Deprecated.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 areuse 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
.
-
isMarkedReusable
boolean isMarkedReusable()
Deprecated.Indicates whether this connection is in a reusable communication state. SeemarkReusable
andunmarkReusable
for details.- Returns:
true
if this connection is marked as being in a reusable communication state,false
otherwise
-
setState
void setState(java.lang.Object state)
Deprecated.Assigns a state object to this connection. Connection managers may make use of the connection state when allocating persistent connections.- Parameters:
state
- The state object
-
getState
java.lang.Object getState()
Deprecated.Returns the state object associated with this connection.- Returns:
- The state object
-
setIdleDuration
void setIdleDuration(long duration, java.util.concurrent.TimeUnit unit)
Deprecated.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.
-
-