Package org.apache.http.impl.conn
Class DefaultClientConnectionOperator
- java.lang.Object
-
- org.apache.http.impl.conn.DefaultClientConnectionOperator
-
- All Implemented Interfaces:
ClientConnectionOperator
@Deprecated @Contract(threading=SAFE_CONDITIONAL) public class DefaultClientConnectionOperator extends java.lang.Object implements ClientConnectionOperator
Deprecated.(4.3) usePoolingHttpClientConnectionManager
.Default implementation of aClientConnectionOperator
. It uses aSchemeRegistry
to look upSchemeSocketFactory
objects.This connection operator is multihome network aware and will attempt to retry failed connects against all known IP addresses sequentially until the connect is successful or all known addresses fail to respond. Please note the same
CoreConnectionPNames.CONNECTION_TIMEOUT
value will be used for each connection attempt, so in the worst case the total elapsed time before timeout can beCONNECTION_TIMEOUT * n
wheren
is the number of IP addresses of the given host. One can disable multihome support by overriding theresolveHostname(String)
method and returning only one IP address for the given host name.The following parameters can be used to customize the behavior of this class:
- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description DefaultClientConnectionOperator(SchemeRegistry schemes)
Deprecated.Creates a new client connection operator for the given scheme registry.DefaultClientConnectionOperator(SchemeRegistry schemes, DnsResolver dnsResolver)
Deprecated.Creates a new client connection operator for the given scheme registry and the given custom DNS lookup mechanism.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description OperatedClientConnection
createConnection()
Deprecated.Creates a new connection that can be operated.void
openConnection(OperatedClientConnection conn, HttpHost target, java.net.InetAddress local, HttpContext context, HttpParams params)
Deprecated.Opens a connection to the given target host.void
updateSecureConnection(OperatedClientConnection conn, HttpHost target, HttpContext context, HttpParams params)
Deprecated.Updates a connection with a layered secure connection.
-
-
-
Constructor Detail
-
DefaultClientConnectionOperator
public DefaultClientConnectionOperator(SchemeRegistry schemes)
Deprecated.Creates a new client connection operator for the given scheme registry.- Parameters:
schemes
- the scheme registry- Since:
- 4.2
-
DefaultClientConnectionOperator
public DefaultClientConnectionOperator(SchemeRegistry schemes, DnsResolver dnsResolver)
Deprecated.Creates a new client connection operator for the given scheme registry and the given custom DNS lookup mechanism.- Parameters:
schemes
- the scheme registrydnsResolver
- the custom DNS lookup mechanism
-
-
Method Detail
-
createConnection
public OperatedClientConnection createConnection()
Deprecated.Description copied from interface:ClientConnectionOperator
Creates a new connection that can be operated.- Specified by:
createConnection
in interfaceClientConnectionOperator
- Returns:
- a new, unopened connection for use with this operator
-
openConnection
public void openConnection(OperatedClientConnection conn, HttpHost target, java.net.InetAddress local, HttpContext context, HttpParams params) throws java.io.IOException
Deprecated.Description copied from interface:ClientConnectionOperator
Opens a connection to the given target host.- Specified by:
openConnection
in interfaceClientConnectionOperator
- Parameters:
conn
- the connection to opentarget
- the target host to connect tolocal
- the local address to route from, ornull
for the defaultcontext
- the context for the connectionparams
- the parameters for the connection- Throws:
java.io.IOException
- in case of a problem
-
updateSecureConnection
public void updateSecureConnection(OperatedClientConnection conn, HttpHost target, HttpContext context, HttpParams params) throws java.io.IOException
Deprecated.Description copied from interface:ClientConnectionOperator
Updates a connection with a layered secure connection. The typical use of this method is to update a tunnelled plain connection (HTTP) to a secure TLS/SSL connection (HTTPS).- Specified by:
updateSecureConnection
in interfaceClientConnectionOperator
- Parameters:
conn
- the open connection to updatetarget
- the target host for the updated connection. The connection must already be open or tunnelled to the host and port, but the scheme of the target will be used to create a layered connection.context
- the context for the connectionparams
- the parameters for the updated connection- Throws:
java.io.IOException
- in case of a problem
-
-