org.apache.hc.client5.http.impl.io

## 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

### Constructor Summary

Constructors
Constructor and Description
`DefaultHttpClientConnectionOperator(DetachedSocketFactory detachedSocketFactory, SchemePortResolver schemePortResolver, DnsResolver dnsResolver, Lookup<TlsSocketStrategy> tlsSocketStrategyLookup)`
`DefaultHttpClientConnectionOperator(Lookup<ConnectionSocketFactory> socketFactoryRegistry, SchemePortResolver schemePortResolver, DnsResolver dnsResolver)` Deprecated. Do not use.
`DefaultHttpClientConnectionOperator(SchemePortResolver schemePortResolver, DnsResolver dnsResolver, Lookup<TlsSocketStrategy> tlsSocketStrategyLookup)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `connect(ManagedHttpClientConnection conn, HttpHost host, InetSocketAddress localAddress, TimeValue connectTimeout, SocketConfig socketConfig, HttpContext context)` Connect the given managed connection to the remote endpoint.
`void` `connect(ManagedHttpClientConnection conn, HttpHost endpointHost, NamedEndpoint endpointName, InetSocketAddress localAddress, Timeout connectTimeout, SocketConfig socketConfig, Object attachment, HttpContext context)` Connect the given managed connection to the remote endpoint.
`void` `connect(ManagedHttpClientConnection conn, HttpHost endpointHost, NamedEndpoint endpointName, Path unixDomainSocket, InetSocketAddress localAddress, Timeout connectTimeout, SocketConfig socketConfig, Object attachment, HttpContext context)` Connect the given managed connection to the remote endpoint.
`protected void` `onAfterSocketConnect(HttpContext httpContext, HttpHost endpointHost)`
`protected void` `onAfterTlsHandshake(HttpContext httpContext, HttpHost endpointHost)`
`protected void` `onBeforeSocketConnect(HttpContext httpContext, HttpHost endpointHost)`
`protected void` `onBeforeTlsHandshake(HttpContext httpContext, HttpHost endpointHost)`
`void` `upgrade(ManagedHttpClientConnection conn, HttpHost host, HttpContext context)` Upgrades transport security of the given managed connection by using the TLS security protocol.
`void` `upgrade(ManagedHttpClientConnection conn, HttpHost endpointHost, NamedEndpoint endpointName, Object attachment, HttpContext context)` Upgrades transport security of the given managed connection by using the TLS security protocol.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### DefaultHttpClientConnectionOperator

    public DefaultHttpClientConnectionOperator(DetachedSocketFactory detachedSocketFactory,
                                               SchemePortResolver schemePortResolver,
                                               DnsResolver dnsResolver,
                                               Lookup<TlsSocketStrategy> tlsSocketStrategyLookup)

#### DefaultHttpClientConnectionOperator

    @Deprecated
    public DefaultHttpClientConnectionOperator(Lookup<ConnectionSocketFactory> socketFactoryRegistry,
                                                           SchemePortResolver schemePortResolver,
                                                           DnsResolver dnsResolver)

Deprecated. Do not use.

#### DefaultHttpClientConnectionOperator

    public DefaultHttpClientConnectionOperator(SchemePortResolver schemePortResolver,
                                               DnsResolver dnsResolver,
                                               Lookup<TlsSocketStrategy> tlsSocketStrategyLookup)

### Method Detail

#### connect

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

Description copied from interface: `HttpClientConnectionOperator`
Connect the given managed connection to the remote endpoint.

Specified by:
  `connect` in interface `HttpClientConnectionOperator`
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,
                        HttpHost endpointHost,
                        NamedEndpoint endpointName,
                        InetSocketAddress localAddress,
                        Timeout connectTimeout,
                        SocketConfig socketConfig,
                        Object attachment,
                        HttpContext context)
                 throws IOException

Description copied from interface: `HttpClientConnectionOperator`
Connect the given managed connection to the remote endpoint.

Specified by:
  `connect` in interface `HttpClientConnectionOperator`
Parameters:
  `conn` - the managed connection.
  `endpointHost` - the address of the remote endpoint.
  `endpointName` - the name of the remote endpoint, if different from the endpoint host name, `null` otherwise. Usually taken from the request URU authority.
  `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`

#### connect

    public void connect(ManagedHttpClientConnection conn,
                        HttpHost endpointHost,
                        NamedEndpoint endpointName,
                        Path unixDomainSocket,
                        InetSocketAddress localAddress,
                        Timeout connectTimeout,
                        SocketConfig socketConfig,
                        Object attachment,
                        HttpContext context)
                 throws IOException

Description copied from interface: `HttpClientConnectionOperator`
Connect the given managed connection to the remote endpoint.

Specified by:
  `connect` in interface `HttpClientConnectionOperator`
Parameters:
  `conn` - the managed connection.
  `endpointHost` - the address of the remote endpoint.
  `endpointName` - the name of the remote endpoint, if different from the endpoint host name, `null` otherwise. Usually taken from the request URU authority.
  `unixDomainSocket` - the path to the Unix domain socket, or `null` if none.
  `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,
                        HttpHost host,
                        HttpContext context)
                 throws IOException

Description copied from interface: `HttpClientConnectionOperator`
Upgrades transport security of the given managed connection by using the TLS security protocol.

Specified by:
  `upgrade` in interface `HttpClientConnectionOperator`
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,
                        HttpHost endpointHost,
                        NamedEndpoint endpointName,
                        Object attachment,
                        HttpContext context)
                 throws IOException

Description copied from interface: `HttpClientConnectionOperator`
Upgrades transport security of the given managed connection by using the TLS security protocol.

Specified by:
  `upgrade` in interface `HttpClientConnectionOperator`
Parameters:
  `conn` - the managed connection.
  `endpointHost` - the address of the remote endpoint.
  `endpointName` - the name of the remote endpoint, if different from the endpoint host name, `null` otherwise. Usually taken from the request URU authority.
  `attachment` - connect request attachment.
  `context` - the execution context.
Throws:
  `IOException`

#### onBeforeSocketConnect

    protected void onBeforeSocketConnect(HttpContext httpContext,
                                         HttpHost endpointHost)

#### onAfterSocketConnect

    protected void onAfterSocketConnect(HttpContext httpContext,
                                        HttpHost endpointHost)

#### onBeforeTlsHandshake

    protected void onBeforeTlsHandshake(HttpContext httpContext,
                                        HttpHost endpointHost)

#### onAfterTlsHandshake

    protected void onAfterTlsHandshake(HttpContext httpContext,
                                       HttpHost endpointHost)