Class DefaultAsyncClientConnectionOperator
- java.lang.Object
-
- org.apache.hc.client5.http.impl.nio.DefaultAsyncClientConnectionOperator
-
- All Implemented Interfaces:
AsyncClientConnectionOperator
@Internal public class DefaultAsyncClientConnectionOperator extends java.lang.Object implements AsyncClientConnectionOperator
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.LoggerLOGprivate SchemePortResolverschemePortResolverprivate MultihomeIOSessionRequestersessionRequesterprivate org.apache.hc.core5.http.config.Lookup<org.apache.hc.core5.http.nio.ssl.TlsStrategy>tlsStrategyLookup
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefaultAsyncClientConnectionOperator(org.apache.hc.core5.http.config.Lookup<org.apache.hc.core5.http.nio.ssl.TlsStrategy> tlsStrategyLookup, SchemePortResolver schemePortResolver, DnsResolver dnsResolver)Constructs a newDefaultAsyncClientConnectionOperator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.Future<ManagedAsyncClientConnection>connect(org.apache.hc.core5.reactor.ConnectionInitiator connectionInitiator, org.apache.hc.core5.http.HttpHost host, java.net.SocketAddress localAddress, org.apache.hc.core5.util.Timeout connectTimeout, java.lang.Object attachment, org.apache.hc.core5.concurrent.FutureCallback<ManagedAsyncClientConnection> callback)Initiates operation to create a connection to the remote endpoint using the providedConnectionInitiator.java.util.concurrent.Future<ManagedAsyncClientConnection>connect(org.apache.hc.core5.reactor.ConnectionInitiator connectionInitiator, org.apache.hc.core5.http.HttpHost endpointHost, java.nio.file.Path unixDomainSocket, org.apache.hc.core5.net.NamedEndpoint endpointName, java.net.SocketAddress localAddress, org.apache.hc.core5.util.Timeout connectTimeout, java.lang.Object attachment, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<ManagedAsyncClientConnection> callback)Initiates operation to create a connection to the remote endpoint using the providedConnectionInitiator.java.util.concurrent.Future<ManagedAsyncClientConnection>connect(org.apache.hc.core5.reactor.ConnectionInitiator connectionInitiator, org.apache.hc.core5.http.HttpHost endpointHost, org.apache.hc.core5.net.NamedEndpoint endpointName, java.net.SocketAddress localAddress, org.apache.hc.core5.util.Timeout connectTimeout, java.lang.Object attachment, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<ManagedAsyncClientConnection> callback)Initiates operation to create a connection to the remote endpoint using the providedConnectionInitiator.private static java.net.SocketAddresscreateUnixSocketAddress(java.nio.file.Path socketPath)protected voidonAfterSocketConnect(org.apache.hc.core5.http.protocol.HttpContext httpContext, org.apache.hc.core5.http.HttpHost endpointHost)protected voidonAfterTlsHandshake(org.apache.hc.core5.http.protocol.HttpContext httpContext, org.apache.hc.core5.http.HttpHost endpointHost)protected voidonBeforeSocketConnect(org.apache.hc.core5.http.protocol.HttpContext httpContext, org.apache.hc.core5.http.HttpHost endpointHost)protected voidonBeforeTlsHandshake(org.apache.hc.core5.http.protocol.HttpContext httpContext, org.apache.hc.core5.http.HttpHost endpointHost)voidupgrade(ManagedAsyncClientConnection connection, org.apache.hc.core5.http.HttpHost host, java.lang.Object attachment)Upgrades transport security of the given managed connection by using the TLS security protocol.voidupgrade(ManagedAsyncClientConnection connection, org.apache.hc.core5.http.HttpHost endpointHost, org.apache.hc.core5.net.NamedEndpoint endpointName, java.lang.Object attachment, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<ManagedAsyncClientConnection> callback)Upgrades transport security of the given managed connection by using the TLS security protocol.
-
-
-
Field Detail
-
LOG
private static final org.slf4j.Logger LOG
-
schemePortResolver
private final SchemePortResolver schemePortResolver
-
sessionRequester
private final MultihomeIOSessionRequester sessionRequester
-
tlsStrategyLookup
private final org.apache.hc.core5.http.config.Lookup<org.apache.hc.core5.http.nio.ssl.TlsStrategy> tlsStrategyLookup
-
-
Constructor Detail
-
DefaultAsyncClientConnectionOperator
protected DefaultAsyncClientConnectionOperator(org.apache.hc.core5.http.config.Lookup<org.apache.hc.core5.http.nio.ssl.TlsStrategy> tlsStrategyLookup, SchemePortResolver schemePortResolver, DnsResolver dnsResolver)Constructs a newDefaultAsyncClientConnectionOperator.Note: this class is marked
@Internal; rely on it only if you are prepared for incompatible changes in a future major release. Typical client code should use the high-level builders inHttpAsyncClientsinstead.
-
-
Method Detail
-
connect
public java.util.concurrent.Future<ManagedAsyncClientConnection> connect(org.apache.hc.core5.reactor.ConnectionInitiator connectionInitiator, org.apache.hc.core5.http.HttpHost host, java.net.SocketAddress localAddress, org.apache.hc.core5.util.Timeout connectTimeout, java.lang.Object attachment, org.apache.hc.core5.concurrent.FutureCallback<ManagedAsyncClientConnection> callback)
Description copied from interface:AsyncClientConnectionOperatorInitiates operation to create a connection to the remote endpoint using the providedConnectionInitiator.- Specified by:
connectin interfaceAsyncClientConnectionOperator- Parameters:
connectionInitiator- the connection initiator.host- the address of the opposite endpoint.localAddress- the address of the local endpoint.connectTimeout- the timeout of the connect operation.attachment- the attachment, which can be any object representing custom parameter of the operation.callback- the future result callback.
-
connect
public java.util.concurrent.Future<ManagedAsyncClientConnection> connect(org.apache.hc.core5.reactor.ConnectionInitiator connectionInitiator, org.apache.hc.core5.http.HttpHost endpointHost, org.apache.hc.core5.net.NamedEndpoint endpointName, java.net.SocketAddress localAddress, org.apache.hc.core5.util.Timeout connectTimeout, java.lang.Object attachment, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<ManagedAsyncClientConnection> callback)
Description copied from interface:AsyncClientConnectionOperatorInitiates operation to create a connection to the remote endpoint using the providedConnectionInitiator.- Specified by:
connectin interfaceAsyncClientConnectionOperator- Parameters:
connectionInitiator- the connection initiator.endpointHost- the address of the remote endpoint.endpointName- the name of the remote endpoint, if different from the endpoint host name,nullotherwise. Usually taken from the request URU authority.localAddress- the address of the local endpoint.connectTimeout- the timeout of the connect operation.attachment- the attachment, which can be any object representing custom parameter of the operation.context- the execution context.callback- the future result callback.
-
connect
public java.util.concurrent.Future<ManagedAsyncClientConnection> connect(org.apache.hc.core5.reactor.ConnectionInitiator connectionInitiator, org.apache.hc.core5.http.HttpHost endpointHost, java.nio.file.Path unixDomainSocket, org.apache.hc.core5.net.NamedEndpoint endpointName, java.net.SocketAddress localAddress, org.apache.hc.core5.util.Timeout connectTimeout, java.lang.Object attachment, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<ManagedAsyncClientConnection> callback)
Description copied from interface:AsyncClientConnectionOperatorInitiates operation to create a connection to the remote endpoint using the providedConnectionInitiator.- Specified by:
connectin interfaceAsyncClientConnectionOperator- Parameters:
connectionInitiator- the connection initiator.endpointHost- the address of the remote endpoint.unixDomainSocket- the path to the UDS through which to connect, ornull.endpointName- the name of the remote endpoint, if different from the endpoint host name,nullotherwise. Usually taken from the request URU authority.localAddress- the address of the local endpoint.connectTimeout- the timeout of the connect operation.attachment- the attachment, which can be any object representing custom parameter of the operation.context- the execution context.callback- the future result callback.
-
createUnixSocketAddress
private static java.net.SocketAddress createUnixSocketAddress(java.nio.file.Path socketPath)
-
upgrade
public void upgrade(ManagedAsyncClientConnection connection, org.apache.hc.core5.http.HttpHost host, java.lang.Object attachment)
Description copied from interface:AsyncClientConnectionOperatorUpgrades transport security of the given managed connection by using the TLS security protocol.- Specified by:
upgradein interfaceAsyncClientConnectionOperator- Parameters:
connection- the managed connection.host- the address of the opposite endpoint with TLS security.attachment- the attachment, which can be any object representing custom parameter of the operation.
-
upgrade
public void upgrade(ManagedAsyncClientConnection connection, org.apache.hc.core5.http.HttpHost endpointHost, org.apache.hc.core5.net.NamedEndpoint endpointName, java.lang.Object attachment, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<ManagedAsyncClientConnection> callback)
Description copied from interface:AsyncClientConnectionOperatorUpgrades transport security of the given managed connection by using the TLS security protocol.- Specified by:
upgradein interfaceAsyncClientConnectionOperator- Parameters:
connection- the managed connection.endpointHost- the address of the remote endpoint.endpointName- the name of the remote endpoint, if different from the endpoint host name,nullotherwise. Usually taken from the request URU authority.attachment- the attachment, which can be any object representing custom parameter of the operation.context- the execution context.callback- the future result callback.
-
onBeforeSocketConnect
protected void onBeforeSocketConnect(org.apache.hc.core5.http.protocol.HttpContext httpContext, org.apache.hc.core5.http.HttpHost endpointHost)
-
onAfterSocketConnect
protected void onAfterSocketConnect(org.apache.hc.core5.http.protocol.HttpContext httpContext, org.apache.hc.core5.http.HttpHost endpointHost)
-
onBeforeTlsHandshake
protected void onBeforeTlsHandshake(org.apache.hc.core5.http.protocol.HttpContext httpContext, org.apache.hc.core5.http.HttpHost endpointHost)
-
onAfterTlsHandshake
protected void onAfterTlsHandshake(org.apache.hc.core5.http.protocol.HttpContext httpContext, org.apache.hc.core5.http.HttpHost endpointHost)
-
-