Top Description Fields Constructors Methods
org.apache.hc.client5.http.impl.io

public Class DefaultHttpClientConnectionOperator

extends Object
implements HttpClientConnectionOperator
Class Inheritance
All Implemented Interfaces
org.apache.hc.client5.http.io.HttpClientConnectionOperator
Annotations
@Internal
@Contract
threading:STATELESS
Imports
java.io.IOException, java.net.InetAddress, .InetSocketAddress, .Proxy, .Socket, .SocketAddress, java.util.Arrays, org.apache.hc.client5.http.ConnectExceptionSupport, .DnsResolver, .SchemePortResolver, .SystemDefaultDnsResolver, .UnsupportedSchemeException, org.apache.hc.client5.http.impl.ConnPoolSupport, .DefaultSchemePortResolver, org.apache.hc.client5.http.io.HttpClientConnectionOperator, .ManagedHttpClientConnection, org.apache.hc.client5.http.protocol.HttpClientContext, org.apache.hc.client5.http.socket.ConnectionSocketFactory, .LayeredConnectionSocketFactory, org.apache.hc.core5.annotation.Contract, .Internal, .ThreadingBehavior, org.apache.hc.core5.http.ConnectionClosedException, .HttpHost, org.apache.hc.core5.http.config.Lookup, org.apache.hc.core5.http.io.SocketConfig, org.apache.hc.core5.http.protocol.HttpContext, org.apache.hc.core5.util.Args, .TimeValue, .Timeout, org.slf4j.Logger, .LoggerFactory

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

Modifier and TypeField and Description
private final DnsResolver
private static final Logger
private final SchemePortResolver
pack-priv static final String
private final Lookup<ConnectionSocketFactory>

Constructor Summary

AccessConstructor and Description
public
DefaultHttpClientConnectionOperator(final Lookup<ConnectionSocketFactory> socketFactoryRegistry, final SchemePortResolver schemePortResolver, final DnsResolver dnsResolver)

Method Summary

Modifier and TypeMethod and Description
public void
connect(final ManagedHttpClientConnection
the managed connection.
conn
,
final HttpHost
the address of the opposite endpoint.
host
,
final InetSocketAddress
the address of the local endpoint.
localAddress
,
final TimeValue
the timeout of the connect operation.
connectTimeout
,
final SocketConfig
the socket configuration.
socketConfig
,
final HttpContext
the execution context.
context
)

Implements org.apache.hc.client5.http.io.HttpClientConnectionOperator.connect.

Connect the given managed connection to the remote endpoint.
public void
connect(final ManagedHttpClientConnection
the managed connection.
conn
,
final HttpHost
the address of the opposite endpoint.
host
,
final InetSocketAddress
the address of the local endpoint.
localAddress
,
final Timeout
the timeout of the connect operation.
connectTimeout
,
final SocketConfig
the socket configuration.
socketConfig
,
final Object
connect request attachment.
attachment
,
final HttpContext
the execution context.
context
)

Overrides default org.apache.hc.client5.http.io.HttpClientConnectionOperator.connect.

Connect the given managed connection to the remote endpoint.
private Lookup<ConnectionSocketFactory>
public void
upgrade(final ManagedHttpClientConnection
the managed connection.
conn
,
final HttpHost
the address of the opposite endpoint with TLS security.
host
,
final HttpContext
the execution context.
context
)

Implements org.apache.hc.client5.http.io.HttpClientConnectionOperator.upgrade.

Upgrades transport security of the given managed connection by using the TLS security protocol.
public void
upgrade(final ManagedHttpClientConnection
the managed connection.
conn
,
final HttpHost
the address of the opposite endpoint with TLS security.
host
,
final Object
connect request attachment.
attachment
,
final HttpContext
the execution context.
context
)

Overrides default org.apache.hc.client5.http.io.HttpClientConnectionOperator.upgrade.

Upgrades transport security of the given managed connection by using the TLS security protocol.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dnsResolverback to summary
private final DnsResolver dnsResolver
LOGback to summary
private static final Logger LOG
schemePortResolverback to summary
private final SchemePortResolver schemePortResolver
SOCKET_FACTORY_REGISTRYback to summary
pack-priv static final String SOCKET_FACTORY_REGISTRY
socketFactoryRegistryback to summary
private final Lookup<ConnectionSocketFactory> socketFactoryRegistry

Constructor Detail

DefaultHttpClientConnectionOperatorback to summary
public DefaultHttpClientConnectionOperator(final Lookup<ConnectionSocketFactory> socketFactoryRegistry, final SchemePortResolver schemePortResolver, final DnsResolver dnsResolver)

Method Detail

connectback to summary
public void connect(final ManagedHttpClientConnection conn, final HttpHost host, final InetSocketAddress localAddress, final TimeValue connectTimeout, final SocketConfig socketConfig, final HttpContext context) throws IOException

Implements org.apache.hc.client5.http.io.HttpClientConnectionOperator.connect.

Doc from org.apache.hc.client5.http.io.HttpClientConnectionOperator.connect.

Connect the given managed connection to the remote endpoint.

Parameters
conn:ManagedHttpClientConnection

the managed connection.

host:HttpHost

the address of the opposite endpoint.

localAddress:InetSocketAddress

the address of the local endpoint.

connectTimeout:TimeValue

the timeout of the connect operation.

socketConfig:SocketConfig

the socket configuration.

context:HttpContext

the execution context.

Annotations
@Override
connectback to summary
public void connect(final ManagedHttpClientConnection conn, final HttpHost host, final InetSocketAddress localAddress, final Timeout connectTimeout, final SocketConfig socketConfig, final Object attachment, final HttpContext context) throws IOException

Overrides default org.apache.hc.client5.http.io.HttpClientConnectionOperator.connect.

Doc from org.apache.hc.client5.http.io.HttpClientConnectionOperator.connect.

Connect the given managed connection to the remote endpoint.

Parameters
conn:ManagedHttpClientConnection

the managed connection.

host:HttpHost

the address of the opposite endpoint.

localAddress:InetSocketAddress

the address of the local endpoint.

connectTimeout:Timeout

the timeout of the connect operation.

socketConfig:SocketConfig

the socket configuration.

attachment:Object

connect request attachment.

context:HttpContext

the execution context.

Annotations
@Override
getSocketFactoryRegistryback to summary
private Lookup<ConnectionSocketFactory> getSocketFactoryRegistry(final HttpContext context)
Annotations
@SuppressWarnings:unchecked
upgradeback to summary
public void upgrade(final ManagedHttpClientConnection conn, final HttpHost host, final HttpContext context) throws IOException

Implements org.apache.hc.client5.http.io.HttpClientConnectionOperator.upgrade.

Doc from org.apache.hc.client5.http.io.HttpClientConnectionOperator.upgrade.

Upgrades transport security of the given managed connection by using the TLS security protocol.

Parameters
conn:ManagedHttpClientConnection

the managed connection.

host:HttpHost

the address of the opposite endpoint with TLS security.

context:HttpContext

the execution context.

Annotations
@Override
upgradeback to summary
public void upgrade(final ManagedHttpClientConnection conn, final HttpHost host, final Object attachment, final HttpContext context) throws IOException

Overrides default org.apache.hc.client5.http.io.HttpClientConnectionOperator.upgrade.

Doc from org.apache.hc.client5.http.io.HttpClientConnectionOperator.upgrade.

Upgrades transport security of the given managed connection by using the TLS security protocol.

Parameters
conn:ManagedHttpClientConnection

the managed connection.

host:HttpHost

the address of the opposite endpoint with TLS security.

attachment:Object

connect request attachment.

context:HttpContext

the execution context.

Annotations
@Override