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

## Class DefaultBHttpServerConnectionFactory

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

- All Implemented Interfaces:
    HttpConnectionFactory<DefaultBHttpServerConnection>

      @Contract(threading=IMMUTABLE_CONDITIONAL)
      public class DefaultBHttpServerConnectionFactory
      extends Object
      implements HttpConnectionFactory<DefaultBHttpServerConnection>

  Default factory for `HttpServerConnection`s.
  Since:
    4.3

- - ### Nested Class Summary

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultBHttpServerConnectionFactory(String scheme, Http1Config http1Config, CharCodingConfig charCodingConfig)`
    `DefaultBHttpServerConnectionFactory(String scheme, Http1Config http1Config, CharCodingConfig charCodingConfig, ContentLengthStrategy incomingContentStrategy, ContentLengthStrategy outgoingContentStrategy, HttpMessageParserFactory<ClassicHttpRequest> requestParserFactory, HttpMessageWriterFactory<ClassicHttpResponse> responseWriterFactory)`
    `DefaultBHttpServerConnectionFactory(String scheme, Http1Config http1Config, CharCodingConfig charCodingConfig, HttpMessageParserFactory<ClassicHttpRequest> requestParserFactory, HttpMessageWriterFactory<ClassicHttpResponse> responseWriterFactory)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static DefaultBHttpServerConnectionFactory.Builder` | `builder()` Create a new `DefaultBHttpServerConnectionFactory.Builder`.
    `DefaultBHttpServerConnection` | `createConnection(Socket socket)` Creates TLS connection with a `SSLSocket` layered over a plain `Socket`.
    `DefaultBHttpServerConnection` | `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

    - #### DefaultBHttpServerConnectionFactory

          public DefaultBHttpServerConnectionFactory(String scheme,
                                                     Http1Config http1Config,
                                                     CharCodingConfig charCodingConfig,
                                                     ContentLengthStrategy incomingContentStrategy,
                                                     ContentLengthStrategy outgoingContentStrategy,
                                                     HttpMessageParserFactory<ClassicHttpRequest> requestParserFactory,
                                                     HttpMessageWriterFactory<ClassicHttpResponse> responseWriterFactory)

    - #### DefaultBHttpServerConnectionFactory

          public DefaultBHttpServerConnectionFactory(String scheme,
                                                     Http1Config http1Config,
                                                     CharCodingConfig charCodingConfig,
                                                     HttpMessageParserFactory<ClassicHttpRequest> requestParserFactory,
                                                     HttpMessageWriterFactory<ClassicHttpResponse> responseWriterFactory)

    - #### DefaultBHttpServerConnectionFactory

          public DefaultBHttpServerConnectionFactory(String scheme,
                                                     Http1Config http1Config,
                                                     CharCodingConfig charCodingConfig)

  - ### Method Detail

    - #### createConnection

          public DefaultBHttpServerConnection 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<DefaultBHttpServerConnection>`
      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 DefaultBHttpServerConnection 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<DefaultBHttpServerConnection>`
      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 DefaultBHttpServerConnectionFactory.Builder builder()

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

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