org.apache.hc.core5.http.impl.bootstrap

## Class ServerBootstrap

- java.lang.Object
- - org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap

-     public class ServerBootstrap
      extends Object

  `HttpServer` bootstrap.
  Since:
    4.4

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ServerBootstrap` | `addFilterAfter(String existing, String name, HttpFilterHandler filterHandler)` Adds the filter after the filter with the given name.
    `ServerBootstrap` | `addFilterBefore(String existing, String name, HttpFilterHandler filterHandler)` Adds the filter before the filter with the given name.
    `ServerBootstrap` | `addFilterFirst(String name, HttpFilterHandler filterHandler)` Add an filter to the head of the processing list.
    `ServerBootstrap` | `addFilterLast(String name, HttpFilterHandler filterHandler)` Add an filter to the tail of the processing list.
    `static ServerBootstrap` | `bootstrap()`
    `HttpServer` | `create()`
    `ServerBootstrap` | `register(String uriPattern, HttpRequestHandler requestHandler)` Registers the given `HttpRequestHandler` as a default handler for URIs matching the given pattern.
    `ServerBootstrap` | `registerVirtual(String hostname, String uriPattern, HttpRequestHandler requestHandler)` Registers the given `HttpRequestHandler` as a handler for URIs matching the given host and the pattern.
    `ServerBootstrap` | `replaceFilter(String existing, HttpFilterHandler filterHandler)` Replace an existing filter with the given name with new filter.
    `ServerBootstrap` | `setCanonicalHostName(String canonicalHostName)` Sets canonical name (fully qualified domain name) of the server.
    `ServerBootstrap` | `setCharCodingConfig(CharCodingConfig charCodingConfig)` Sets connection configuration.
    `ServerBootstrap` | `setConnectionFactory(HttpConnectionFactory<? extends DefaultBHttpServerConnection> connectionFactory)` Assigns `HttpConnectionFactory` instance.
    `ServerBootstrap` | `setConnectionReuseStrategy(ConnectionReuseStrategy connStrategy)` Assigns `ConnectionReuseStrategy` instance.
    `ServerBootstrap` | `setExceptionListener(ExceptionListener exceptionListener)` Assigns `ExceptionListener` instance.
    `ServerBootstrap` | `setHttp1Config(Http1Config http1Config)` Sets connection configuration.
    `ServerBootstrap` | `setHttpProcessor(HttpProcessor httpProcessor)` Assigns `HttpProcessor` instance.
    `ServerBootstrap` | `setListenerPort(int listenerPort)` Sets listener port number.
    `ServerBootstrap` | `setLocalAddress(InetAddress localAddress)` Assigns local interface for the listener.
    `ServerBootstrap` | `setLookupRegistry(LookupRegistry<HttpRequestHandler> lookupRegistry)` Assigns `LookupRegistry` instance.
    `ServerBootstrap` | `setResponseFactory(HttpResponseFactory<ClassicHttpResponse> responseFactory)` Assigns `HttpResponseFactory` instance.
    `ServerBootstrap` | `setServerSocketFactory(ServerSocketFactory serverSocketFactory)` Assigns `ServerSocketFactory` instance.
    `ServerBootstrap` | `setSocketConfig(SocketConfig socketConfig)` Sets socket configuration.
    `ServerBootstrap` | `setSslContext(SSLContext sslContext)` Assigns `SSLContext` instance.
    `ServerBootstrap` | `setSslSetupHandler(Callback<SSLParameters> sslSetupHandler)` Assigns `Callback` for `SSLParameters`.
    `ServerBootstrap` | `setStreamListener(Http1StreamListener streamListener)` Assigns `ExceptionListener` instance.

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

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

- - ### Method Detail

    - #### bootstrap

          public static ServerBootstrap bootstrap()

    - #### setCanonicalHostName

          public final ServerBootstrap setCanonicalHostName(String canonicalHostName)

      Sets canonical name (fully qualified domain name) of the server.
      Since:
        5.0

    - #### setListenerPort

          public final ServerBootstrap setListenerPort(int listenerPort)

      Sets listener port number.

    - #### setLocalAddress

          public final ServerBootstrap setLocalAddress(InetAddress localAddress)

      Assigns local interface for the listener.

    - #### setSocketConfig

          public final ServerBootstrap setSocketConfig(SocketConfig socketConfig)

      Sets socket configuration.

    - #### setHttp1Config

          public final ServerBootstrap setHttp1Config(Http1Config http1Config)

      Sets connection configuration.

    - #### setCharCodingConfig

          public final ServerBootstrap setCharCodingConfig(CharCodingConfig charCodingConfig)

      Sets connection configuration.

    - #### setHttpProcessor

          public final ServerBootstrap setHttpProcessor(HttpProcessor httpProcessor)

      Assigns `HttpProcessor` instance.

    - #### setConnectionReuseStrategy

          public final ServerBootstrap setConnectionReuseStrategy(ConnectionReuseStrategy connStrategy)

      Assigns `ConnectionReuseStrategy` instance.

    - #### setResponseFactory

          public final ServerBootstrap setResponseFactory(HttpResponseFactory<ClassicHttpResponse> responseFactory)

      Assigns `HttpResponseFactory` instance.

    - #### setLookupRegistry

          public final ServerBootstrap setLookupRegistry(LookupRegistry<HttpRequestHandler> lookupRegistry)

      Assigns `LookupRegistry` instance.

    - #### register

          public final ServerBootstrap register(String uriPattern,
                                 HttpRequestHandler requestHandler)

      Registers the given `HttpRequestHandler` as a default handler for URIs matching the given pattern.
      Parameters:
        `uriPattern` - the pattern to register the handler for.
        `requestHandler` - the handler.

    - #### registerVirtual

          public final ServerBootstrap registerVirtual(String hostname,
                                        String uriPattern,
                                        HttpRequestHandler requestHandler)

      Registers the given `HttpRequestHandler` as a handler for URIs matching the given host and the pattern.
      Parameters:
        `hostname` -
        `uriPattern` - the pattern to register the handler for.
        `requestHandler` - the handler.

    - #### setConnectionFactory

          public final ServerBootstrap setConnectionFactory(HttpConnectionFactory<? extends DefaultBHttpServerConnection> connectionFactory)

      Assigns `HttpConnectionFactory` instance.

    - #### setServerSocketFactory

          public final ServerBootstrap setServerSocketFactory(ServerSocketFactory serverSocketFactory)

      Assigns `ServerSocketFactory` instance.

    - #### setSslContext

          public final ServerBootstrap setSslContext(SSLContext sslContext)

      Assigns `SSLContext` instance.

      Please note this value can be overridden by the `setServerSocketFactory( javax.net.ServerSocketFactory)` method.

    - #### setSslSetupHandler

          public final ServerBootstrap setSslSetupHandler(Callback<SSLParameters> sslSetupHandler)

      Assigns `Callback` for `SSLParameters`.

    - #### setExceptionListener

          public final ServerBootstrap setExceptionListener(ExceptionListener exceptionListener)

      Assigns `ExceptionListener` instance.

    - #### setStreamListener

          public final ServerBootstrap setStreamListener(Http1StreamListener streamListener)

      Assigns `ExceptionListener` instance.

    - #### addFilterBefore

          public final ServerBootstrap addFilterBefore(String existing,
                                        String name,
                                        HttpFilterHandler filterHandler)

      Adds the filter before the filter with the given name.

    - #### addFilterAfter

          public final ServerBootstrap addFilterAfter(String existing,
                                       String name,
                                       HttpFilterHandler filterHandler)

      Adds the filter after the filter with the given name.

    - #### replaceFilter

          public final ServerBootstrap replaceFilter(String existing,
                                      HttpFilterHandler filterHandler)

      Replace an existing filter with the given name with new filter.

    - #### addFilterFirst

          public final ServerBootstrap addFilterFirst(String name,
                                       HttpFilterHandler filterHandler)

      Add an filter to the head of the processing list.

    - #### addFilterLast

          public final ServerBootstrap addFilterLast(String name,
                                      HttpFilterHandler filterHandler)

      Add an filter to the tail of the processing list.

    - #### create

          public HttpServer create()

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