org.apache.hc.core5.http.impl.io

## Class DefaultBHttpClientConnectionFactory

- java.lang.Object
- - org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnectionFactory

- All Implemented Interfaces:
    HttpConnectionFactory<DefaultBHttpClientConnection>

      @Contract(threading=IMMUTABLE_CONDITIONAL)
      public class DefaultBHttpClientConnectionFactory
      extends Object
      implements HttpConnectionFactory<DefaultBHttpClientConnection>

  Default factory for `HttpClientConnection`s.
  Since:
    4.3

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `DefaultBHttpClientConnectionFactory.Builder` Builder for `DefaultBHttpClientConnectionFactory`.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultBHttpClientConnectionFactory()`
    `DefaultBHttpClientConnectionFactory(Http1Config http1Config, CharCodingConfig charCodingConfig)`
    `DefaultBHttpClientConnectionFactory(Http1Config http1Config, CharCodingConfig charCodingConfig, ContentLengthStrategy incomingContentStrategy, ContentLengthStrategy outgoingContentStrategy, HttpMessageWriterFactory<ClassicHttpRequest> requestWriterFactory, HttpMessageParserFactory<ClassicHttpResponse> responseParserFactory)`
    `DefaultBHttpClientConnectionFactory(Http1Config http1Config, CharCodingConfig charCodingConfig, HttpMessageWriterFactory<ClassicHttpRequest> requestWriterFactory, HttpMessageParserFactory<ClassicHttpResponse> responseParserFactory)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static DefaultBHttpClientConnectionFactory.Builder` | `builder()` Create a new `DefaultBHttpClientConnectionFactory.Builder`.
    `DefaultBHttpClientConnection` | `createConnection(Socket socket)` Creates TLS connection with a `SSLSocket` layered over a plain `Socket`.
    `DefaultBHttpClientConnection` | `createConnection(SSLSocket sslSocket, Socket socket)` Creates TLS connection with a `SSLSocket` layered over a plain `Socket`.

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

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

- - ### Constructor Detail

    - #### DefaultBHttpClientConnectionFactory

          public DefaultBHttpClientConnectionFactory(Http1Config http1Config,
                                                     CharCodingConfig charCodingConfig,
                                                     ContentLengthStrategy incomingContentStrategy,
                                                     ContentLengthStrategy outgoingContentStrategy,
                                                     HttpMessageWriterFactory<ClassicHttpRequest> requestWriterFactory,
                                                     HttpMessageParserFactory<ClassicHttpResponse> responseParserFactory)

    - #### DefaultBHttpClientConnectionFactory

          public DefaultBHttpClientConnectionFactory(Http1Config http1Config,
                                                     CharCodingConfig charCodingConfig,
                                                     HttpMessageWriterFactory<ClassicHttpRequest> requestWriterFactory,
                                                     HttpMessageParserFactory<ClassicHttpResponse> responseParserFactory)

    - #### DefaultBHttpClientConnectionFactory

          public DefaultBHttpClientConnectionFactory(Http1Config http1Config,
                                                     CharCodingConfig charCodingConfig)

    - #### DefaultBHttpClientConnectionFactory

          public DefaultBHttpClientConnectionFactory()

  - ### Method Detail

    - #### createConnection

          public DefaultBHttpClientConnection createConnection(Socket socket)
                                                        throws IOException

      Description copied from interface: `HttpConnectionFactory`
      Creates TLS connection with a `SSLSocket` layered over a plain `Socket`.
      Specified by:
        `createConnection` in interface `HttpConnectionFactory<DefaultBHttpClientConnection>`
      Parameters:
        `socket` - the plain socket SSL socket has been layered over.
      Returns:
        a new HttpConnection.
      Throws:
        `IOException` - in case of an I/O error.

    - #### createConnection

          public DefaultBHttpClientConnection createConnection(SSLSocket sslSocket,
                                                               Socket socket)
                                                        throws IOException

      Description copied from interface: `HttpConnectionFactory`
      Creates TLS connection with a `SSLSocket` layered over a plain `Socket`.
      Specified by:
        `createConnection` in interface `HttpConnectionFactory<DefaultBHttpClientConnection>`
      Parameters:
        `sslSocket` - the SSL socket. May be `null`.
        `socket` - the plain socket SSL socket has been layered over.
      Returns:
        a new HttpConnection.
      Throws:
        `IOException` - in case of an I/O error.
      Since:
        5.3

    - #### builder

          public static DefaultBHttpClientConnectionFactory.Builder builder()

      Create a new `DefaultBHttpClientConnectionFactory.Builder`.
      Since:
        5.1

Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.