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 Object
implements HttpClientConnectionOperator
Default implementation of
HttpClientConnectionOperator used as default in Http client,
when no instance provided by user to BasicHttpClientConnectionManager or PoolingHttpClientConnectionManager constructor.- Since:
- 4.4
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DnsResolverprivate static final org.slf4j.Loggerprivate final SchemePortResolver(package private) static final Stringprivate final org.apache.hc.core5.http.config.Lookup<ConnectionSocketFactory> -
Constructor Summary
ConstructorsConstructorDescriptionDefaultHttpClientConnectionOperator(org.apache.hc.core5.http.config.Lookup<ConnectionSocketFactory> socketFactoryRegistry, SchemePortResolver schemePortResolver, DnsResolver dnsResolver) -
Method Summary
Modifier and TypeMethodDescriptionvoidconnect(ManagedHttpClientConnection conn, org.apache.hc.core5.http.HttpHost host, InetSocketAddress localAddress, org.apache.hc.core5.util.Timeout connectTimeout, org.apache.hc.core5.http.io.SocketConfig socketConfig, Object attachment, org.apache.hc.core5.http.protocol.HttpContext context) Connect the given managed connection to the remote endpoint.voidconnect(ManagedHttpClientConnection conn, org.apache.hc.core5.http.HttpHost host, 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) voidupgrade(ManagedHttpClientConnection conn, org.apache.hc.core5.http.HttpHost host, Object attachment, org.apache.hc.core5.http.protocol.HttpContext context) Upgrades transport security of the given managed connection by using the TLS security protocol.voidupgrade(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 Details
-
SOCKET_FACTORY_REGISTRY
- See Also:
-
LOG
private static final org.slf4j.Logger LOG -
socketFactoryRegistry
-
schemePortResolver
-
dnsResolver
-
-
Constructor Details
-
DefaultHttpClientConnectionOperator
public DefaultHttpClientConnectionOperator(org.apache.hc.core5.http.config.Lookup<ConnectionSocketFactory> socketFactoryRegistry, SchemePortResolver schemePortResolver, DnsResolver dnsResolver)
-
-
Method Details
-
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, 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 IOException Description copied from interface:HttpClientConnectionOperatorConnect the given managed connection to the remote endpoint.- Specified by:
connectin 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:
IOException
-
connect
public void connect(ManagedHttpClientConnection conn, org.apache.hc.core5.http.HttpHost host, InetSocketAddress localAddress, org.apache.hc.core5.util.Timeout connectTimeout, org.apache.hc.core5.http.io.SocketConfig socketConfig, Object attachment, org.apache.hc.core5.http.protocol.HttpContext context) throws IOException Description copied from interface:HttpClientConnectionOperatorConnect the given managed connection to the remote endpoint.- Specified by:
connectin 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:
IOException
-
upgrade
public void upgrade(ManagedHttpClientConnection conn, org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.protocol.HttpContext context) throws IOException Description copied from interface:HttpClientConnectionOperatorUpgrades transport security of the given managed connection by using the TLS security protocol.- Specified by:
upgradein interfaceHttpClientConnectionOperator- Parameters:
conn- the managed connection.host- the address of the opposite endpoint with TLS security.context- the execution context.- Throws:
IOException
-
upgrade
public void upgrade(ManagedHttpClientConnection conn, org.apache.hc.core5.http.HttpHost host, Object attachment, org.apache.hc.core5.http.protocol.HttpContext context) throws IOException Description copied from interface:HttpClientConnectionOperatorUpgrades transport security of the given managed connection by using the TLS security protocol.- Specified by:
upgradein 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:
IOException
-