Class DefaultHttpClientConnectionOperator
- java.lang.Object
-
- org.apache.hc.client5.http.impl.io.DefaultHttpClientConnectionOperator
-
- All Implemented Interfaces:
HttpClientConnectionOperator
@Internal @Contract(threading=STATELESS) public class DefaultHttpClientConnectionOperator extends java.lang.Object implements HttpClientConnectionOperator
Default implementation ofHttpClientConnectionOperator
used as default in Http client, when no instance provided by user toBasicHttpClientConnectionManager
orPoolingHttpClientConnectionManager
constructor.- Since:
- 4.4
-
-
Field Summary
Fields Modifier and Type Field Description private DnsResolver
dnsResolver
private static org.slf4j.Logger
LOG
private SchemePortResolver
schemePortResolver
(package private) static java.lang.String
SOCKET_FACTORY_REGISTRY
private org.apache.hc.core5.http.config.Lookup<ConnectionSocketFactory>
socketFactoryRegistry
-
Constructor Summary
Constructors Constructor Description DefaultHttpClientConnectionOperator(org.apache.hc.core5.http.config.Lookup<ConnectionSocketFactory> socketFactoryRegistry, SchemePortResolver schemePortResolver, DnsResolver dnsResolver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
connect(ManagedHttpClientConnection conn, org.apache.hc.core5.http.HttpHost host, java.net.InetSocketAddress localAddress, org.apache.hc.core5.util.Timeout connectTimeout, org.apache.hc.core5.http.io.SocketConfig socketConfig, java.lang.Object attachment, org.apache.hc.core5.http.protocol.HttpContext context)
Connect the given managed connection to the remote endpoint.void
connect(ManagedHttpClientConnection conn, org.apache.hc.core5.http.HttpHost host, java.net.InetSocketAddress localAddress, org.apache.hc.core5.util.TimeValue connectTimeout, org.apache.hc.core5.http.io.SocketConfig socketConfig, org.apache.hc.core5.http.protocol.HttpContext context)
Connect the given managed connection to the remote endpoint.private org.apache.hc.core5.http.config.Lookup<ConnectionSocketFactory>
getSocketFactoryRegistry(org.apache.hc.core5.http.protocol.HttpContext context)
void
upgrade(ManagedHttpClientConnection conn, org.apache.hc.core5.http.HttpHost host, java.lang.Object attachment, org.apache.hc.core5.http.protocol.HttpContext context)
Upgrades transport security of the given managed connection by using the TLS security protocol.void
upgrade(ManagedHttpClientConnection conn, org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.protocol.HttpContext context)
Upgrades transport security of the given managed connection by using the TLS security protocol.
-
-
-
Field Detail
-
SOCKET_FACTORY_REGISTRY
static final java.lang.String SOCKET_FACTORY_REGISTRY
- See Also:
- Constant Field Values
-
LOG
private static final org.slf4j.Logger LOG
-
socketFactoryRegistry
private final org.apache.hc.core5.http.config.Lookup<ConnectionSocketFactory> socketFactoryRegistry
-
schemePortResolver
private final SchemePortResolver schemePortResolver
-
dnsResolver
private final DnsResolver dnsResolver
-
-
Constructor Detail
-
DefaultHttpClientConnectionOperator
public DefaultHttpClientConnectionOperator(org.apache.hc.core5.http.config.Lookup<ConnectionSocketFactory> socketFactoryRegistry, SchemePortResolver schemePortResolver, DnsResolver dnsResolver)
-
-
Method Detail
-
getSocketFactoryRegistry
private org.apache.hc.core5.http.config.Lookup<ConnectionSocketFactory> getSocketFactoryRegistry(org.apache.hc.core5.http.protocol.HttpContext context)
-
connect
public void connect(ManagedHttpClientConnection conn, org.apache.hc.core5.http.HttpHost host, java.net.InetSocketAddress localAddress, org.apache.hc.core5.util.TimeValue connectTimeout, org.apache.hc.core5.http.io.SocketConfig socketConfig, org.apache.hc.core5.http.protocol.HttpContext context) throws java.io.IOException
Description copied from interface:HttpClientConnectionOperator
Connect the given managed connection to the remote endpoint.- Specified by:
connect
in interfaceHttpClientConnectionOperator
- Parameters:
conn
- the managed connection.host
- the address of the opposite endpoint.localAddress
- the address of the local endpoint.connectTimeout
- the timeout of the connect operation.socketConfig
- the socket configuration.context
- the execution context.- Throws:
java.io.IOException
-
connect
public void connect(ManagedHttpClientConnection conn, org.apache.hc.core5.http.HttpHost host, java.net.InetSocketAddress localAddress, org.apache.hc.core5.util.Timeout connectTimeout, org.apache.hc.core5.http.io.SocketConfig socketConfig, java.lang.Object attachment, org.apache.hc.core5.http.protocol.HttpContext context) throws java.io.IOException
Description copied from interface:HttpClientConnectionOperator
Connect the given managed connection to the remote endpoint.- Specified by:
connect
in interfaceHttpClientConnectionOperator
- Parameters:
conn
- the managed connection.host
- the address of the opposite endpoint.localAddress
- the address of the local endpoint.connectTimeout
- the timeout of the connect operation.socketConfig
- the socket configuration.attachment
- connect request attachment.context
- the execution context.- Throws:
java.io.IOException
-
upgrade
public void upgrade(ManagedHttpClientConnection conn, org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.protocol.HttpContext context) throws java.io.IOException
Description copied from interface:HttpClientConnectionOperator
Upgrades transport security of the given managed connection by using the TLS security protocol.- Specified by:
upgrade
in interfaceHttpClientConnectionOperator
- Parameters:
conn
- the managed connection.host
- the address of the opposite endpoint with TLS security.context
- the execution context.- Throws:
java.io.IOException
-
upgrade
public void upgrade(ManagedHttpClientConnection conn, org.apache.hc.core5.http.HttpHost host, java.lang.Object attachment, org.apache.hc.core5.http.protocol.HttpContext context) throws java.io.IOException
Description copied from interface:HttpClientConnectionOperator
Upgrades transport security of the given managed connection by using the TLS security protocol.- Specified by:
upgrade
in interfaceHttpClientConnectionOperator
- Parameters:
conn
- the managed connection.host
- the address of the opposite endpoint with TLS security.attachment
- connect request attachment.context
- the execution context.- Throws:
java.io.IOException
-
-