Interface OperatedClientConnection
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
,HttpClientConnection
,HttpConnection
,HttpInetConnection
- All Known Implementing Classes:
DefaultClientConnection
@Deprecated public interface OperatedClientConnection extends HttpClientConnection, HttpInetConnection
Deprecated.(4.3) replaced byHttpClientConnectionManager
.A client-side connection that relies on outside logic to connect sockets to the appropriate hosts. It can be operated directly by an application, or through anoperator
.- Since:
- 4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description java.net.Socket
getSocket()
Deprecated.Obtains the socket for this connection.HttpHost
getTargetHost()
Deprecated.Obtains the target host for this connection.boolean
isSecure()
Deprecated.Indicates whether this connection is secure.void
openCompleted(boolean secure, HttpParams params)
Deprecated.Signals that the connection has been successfully open.void
opening(java.net.Socket sock, HttpHost target)
Deprecated.Signals that this connection is in the process of being open.void
update(java.net.Socket sock, HttpHost target, boolean secure, HttpParams params)
Deprecated.Updates this connection.-
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
-
-
-
-
Method Detail
-
getTargetHost
HttpHost getTargetHost()
Deprecated.Obtains the target host for this connection. If the connection is to a proxy but not tunnelled, this is the proxy. If the connection is tunnelled through a proxy, this is the target of the tunnel.The return value is well-defined only while the connection is open. It may change even while the connection is open, because of an
update
.- Returns:
- the host to which this connection is opened
-
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, because of anupdate
.- Returns:
true
if this connection is secure,false
otherwise
-
getSocket
java.net.Socket getSocket()
Deprecated.Obtains the socket for this connection. The return value is well-defined only while the connection is open. It may change even while the connection is open, because of anupdate
.- Returns:
- the socket for communicating with the
target host
-
opening
void opening(java.net.Socket sock, HttpHost target) throws java.io.IOException
Deprecated.Signals that this connection is in the process of being open.By calling this method, the connection can be re-initialized with a new Socket instance before
openCompleted(boolean, org.apache.http.params.HttpParams)
is called. This enabled the connection to close that socket ifshutdown
is called before it is fully open. Closing an unconnected socket will interrupt a thread that is blocked on the connect. Otherwise, that thread will either time out on the connect, or it returns successfully and then opens this connection which was just shut down.This method can be called multiple times if the connection is layered over another protocol. Note: This method will not close the previously used socket. It is the caller's responsibility to close that socket if it is no longer required.
The caller must invoke
openCompleted(boolean, org.apache.http.params.HttpParams)
in order to complete the process.- Parameters:
sock
- the unconnected socket which is about to be connected.target
- the target host of this connection- Throws:
java.io.IOException
-
openCompleted
void openCompleted(boolean secure, HttpParams params) throws java.io.IOException
Deprecated.Signals that the connection has been successfully open. An attempt to call this method on an open connection will cause an exception.- Parameters:
secure
-true
if this connection is secure, for example if anSSLSocket
is used, orfalse
if it is not secureparams
- parameters for this connection. The parameters will be used when creating dependent objects, for example to determine buffer sizes.- Throws:
java.io.IOException
-
update
void update(java.net.Socket sock, HttpHost target, boolean secure, HttpParams params) throws java.io.IOException
Deprecated.Updates this connection. A connection can be updated only while it is open. Updates are used for example when a tunnel has been established, or when a TLS/SSL connection has been layered on top of a plain socket connection.Note: Updating the connection will not close the previously used socket. It is the caller's responsibility to close that socket if it is no longer required.
- Parameters:
sock
- the new socket for communicating with the target host, ornull
to continue using the old socket. Ifnull
is passed, helper objects that depend on the socket should be re-used. In that case, some changes in the parameters will not take effect.target
- the new target host of this connectionsecure
-true
if this connection is now secure,false
if it is not secureparams
- new parameters for this connection- Throws:
java.io.IOException
-
-