org.apache.hc.core5.http2.impl.nio.bootstrap

## Class H2ServerBootstrap

- java.lang.Object
- - org.apache.hc.core5.http2.impl.nio.bootstrap.H2ServerBootstrap

-     public class H2ServerBootstrap
      extends Object

  HTTP/2 capable `HttpAsyncServer` bootstrap.
  Since:
    5.0

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `H2ServerBootstrap` | `addFilterAfter(String existing, String name, AsyncFilterHandler filterHandler)` Adds the filter after the filter with the given name.
    `H2ServerBootstrap` | `addFilterBefore(String existing, String name, AsyncFilterHandler filterHandler)` Adds the filter before the filter with the given name.
    `H2ServerBootstrap` | `addFilterFirst(String name, AsyncFilterHandler filterHandler)` Add an filter to the head of the processing list.
    `H2ServerBootstrap` | `addFilterLast(String name, AsyncFilterHandler filterHandler)` Add an filter to the tail of the processing list.
    `static H2ServerBootstrap` | `bootstrap()`
    `HttpAsyncServer` | `create()`
    `<T> H2ServerBootstrap` | `register(String uriPattern, AsyncServerRequestHandler<T> requestHandler)` Registers the given `AsyncServerRequestHandler` as a default handler for URIs matching the given pattern.
    `<T> H2ServerBootstrap` | `register(String hostname, String uriPattern, AsyncServerRequestHandler<T> requestHandler)` Registers the given `AsyncServerRequestHandler` as a handler for URIs matching the given host and the pattern.
    `H2ServerBootstrap` | `register(String hostname, String uriPattern, Supplier<AsyncServerExchangeHandler> supplier)` Registers the given `AsyncServerExchangeHandler` `Supplier` as a handler for URIs matching the given host and the pattern.
    `H2ServerBootstrap` | `register(String uriPattern, Supplier<AsyncServerExchangeHandler> supplier)` Registers the given `AsyncServerExchangeHandler` `Supplier` as a default handler for URIs matching the given pattern.
    `<T> H2ServerBootstrap` | `registerVirtual(String hostname, String uriPattern, AsyncServerRequestHandler<T> requestHandler)` Deprecated. Use `register(String, String, Supplier)`.
    `H2ServerBootstrap` | `registerVirtual(String hostname, String uriPattern, Supplier<AsyncServerExchangeHandler> supplier)` Deprecated. Use `register(String, String, Supplier)`.
    `H2ServerBootstrap` | `replaceFilter(String existing, AsyncFilterHandler filterHandler)` Replace an existing filter with the given name with new filter.
    `H2ServerBootstrap` | `setCanonicalHostName(String canonicalHostName)` Sets canonical name (fully qualified domain name) of the server.
    `H2ServerBootstrap` | `setCharset(CharCodingConfig charCodingConfig)` Sets message char coding.
    `H2ServerBootstrap` | `setExceptionCallback(Callback<Exception> exceptionCallback)` Sets `Exception` `Callback` instance.
    `H2ServerBootstrap` | `setH2Config(H2Config h2Config)` Sets HTTP/2 protocol parameters
    `H2ServerBootstrap` | `setHandshakeTimeout(Timeout handshakeTimeout)`
    `H2ServerBootstrap` | `setHttp1Config(Http1Config http1Config)` Sets HTTP/1.1 protocol parameters
    `H2ServerBootstrap` | `setHttpProcessor(HttpProcessor httpProcessor)` Sets `HttpProcessor` instance.
    `H2ServerBootstrap` | `setIOReactorConfig(IOReactorConfig ioReactorConfig)` Sets I/O reactor configuration.
    `H2ServerBootstrap` | `setIOSessionDecorator(Decorator<IOSession> ioSessionDecorator)` Sets `IOSession` `Decorator` instance.
    `H2ServerBootstrap` | `setIOSessionListener(IOSessionListener sessionListener)` Sets `IOSessionListener` instance.
    `H2ServerBootstrap` | `setLookupRegistry(LookupRegistry<Supplier<AsyncServerExchangeHandler>> lookupRegistry)` Deprecated. Use `RequestRouter`.
    `H2ServerBootstrap` | `setRequestRouter(HttpRequestMapper<Supplier<AsyncServerExchangeHandler>> requestRouter)` Sets `HttpRequestMapper` instance.
    `H2ServerBootstrap` | `setStreamListener(H2StreamListener h2StreamListener)` Sets `H2StreamListener` instance.
    `H2ServerBootstrap` | `setStreamListener(Http1StreamListener http1StreamListener)` Sets `Http1StreamListener` instance.
    `H2ServerBootstrap` | `setTlsStrategy(TlsStrategy tlsStrategy)` Sets `TlsStrategy` instance.
    `H2ServerBootstrap` | `setVersionPolicy(HttpVersionPolicy versionPolicy)` Sets HTTP protocol version policy

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

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

- - ### Method Detail

    - #### bootstrap

          public static H2ServerBootstrap bootstrap()

    - #### setCanonicalHostName

          public final H2ServerBootstrap setCanonicalHostName(String canonicalHostName)

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

    - #### setIOReactorConfig

          public final H2ServerBootstrap setIOReactorConfig(IOReactorConfig ioReactorConfig)

      Sets I/O reactor configuration.
      Returns:
        this instance.

    - #### setHttpProcessor

          public final H2ServerBootstrap setHttpProcessor(HttpProcessor httpProcessor)

      Sets `HttpProcessor` instance.
      Returns:
        this instance.

    - #### setVersionPolicy

          public final H2ServerBootstrap setVersionPolicy(HttpVersionPolicy versionPolicy)

      Sets HTTP protocol version policy
      Returns:
        this instance.

    - #### setH2Config

          public final H2ServerBootstrap setH2Config(H2Config h2Config)

      Sets HTTP/2 protocol parameters
      Returns:
        this instance.

    - #### setHttp1Config

          public final H2ServerBootstrap setHttp1Config(Http1Config http1Config)

      Sets HTTP/1.1 protocol parameters
      Returns:
        this instance.

    - #### setCharset

          public final H2ServerBootstrap setCharset(CharCodingConfig charCodingConfig)

      Sets message char coding.
      Returns:
        this instance.

    - #### setTlsStrategy

          public final H2ServerBootstrap setTlsStrategy(TlsStrategy tlsStrategy)

      Sets `TlsStrategy` instance.
      Returns:
        this instance.

    - #### setHandshakeTimeout

          public final H2ServerBootstrap setHandshakeTimeout(Timeout handshakeTimeout)

    - #### setIOSessionDecorator

          public final H2ServerBootstrap setIOSessionDecorator(Decorator<IOSession> ioSessionDecorator)

      Sets `IOSession` `Decorator` instance.
      Returns:
        this instance.

    - #### setExceptionCallback

          public final H2ServerBootstrap setExceptionCallback(Callback<Exception> exceptionCallback)

      Sets `Exception` `Callback` instance.
      Returns:
        this instance.

    - #### setIOSessionListener

          public final H2ServerBootstrap setIOSessionListener(IOSessionListener sessionListener)

      Sets `IOSessionListener` instance.
      Returns:
        this instance.

    - #### setStreamListener

          public final H2ServerBootstrap setStreamListener(H2StreamListener h2StreamListener)

      Sets `H2StreamListener` instance.
      Returns:
        this instance.

    - #### setStreamListener

          public final H2ServerBootstrap setStreamListener(Http1StreamListener http1StreamListener)

      Sets `Http1StreamListener` instance.
      Returns:
        this instance.

    - #### setLookupRegistry

          @Deprecated
          public final H2ServerBootstrap setLookupRegistry(LookupRegistry<Supplier<AsyncServerExchangeHandler>> lookupRegistry)

      Deprecated. Use `RequestRouter`.
      Returns:
        this instance.

    - #### setRequestRouter

          public final H2ServerBootstrap setRequestRouter(HttpRequestMapper<Supplier<AsyncServerExchangeHandler>> requestRouter)

      Sets `HttpRequestMapper` instance.
      Returns:
        this instance.
      Since:
        5.3
      See Also:
        `RequestRouter`

    - #### register

          public final H2ServerBootstrap register(String uriPattern,
                                                  Supplier<AsyncServerExchangeHandler> supplier)

      Registers the given `AsyncServerExchangeHandler` `Supplier` as a default handler for URIs matching the given pattern.
      Parameters:
        `uriPattern` - the pattern to register the handler for.
        `supplier` - the handler supplier.
      Returns:
        this instance.

    - #### register

          public final H2ServerBootstrap register(String hostname,
                                                  String uriPattern,
                                                  Supplier<AsyncServerExchangeHandler> supplier)

      Registers the given `AsyncServerExchangeHandler` `Supplier` as a handler for URIs matching the given host and the pattern.
      Parameters:
        `hostname` - the host name
        `uriPattern` - the pattern to register the handler for.
        `supplier` - the handler supplier.
      Returns:
        this instance.
      Since:
        5.3

    - #### registerVirtual

          @Deprecated
          public final H2ServerBootstrap registerVirtual(String hostname,
                                                                     String uriPattern,
                                                                     Supplier<AsyncServerExchangeHandler> supplier)

      Deprecated. Use `register(String, String, Supplier)`.
      Returns:
        this instance.

    - #### register

          public final <T> H2ServerBootstrap register(String uriPattern,
                                                      AsyncServerRequestHandler<T> requestHandler)

      Registers the given `AsyncServerRequestHandler` as a default handler for URIs matching the given pattern.
      Type Parameters:
        `T` - request handler representation.
      Parameters:
        `uriPattern` - the pattern to register the handler for.
        `requestHandler` - the handler.
      Returns:
        this instance.

    - #### register

          public final <T> H2ServerBootstrap register(String hostname,
                                                      String uriPattern,
                                                      AsyncServerRequestHandler<T> requestHandler)

      Registers the given `AsyncServerRequestHandler` as a handler for URIs matching the given host and the pattern.
      Type Parameters:
        `T` - request handler representation.
      Parameters:
        `hostname` - the host name
        `uriPattern` - the pattern to register the handler for.
        `requestHandler` - the handler.
      Returns:
        this instance.
      Since:
        5.3

    - #### registerVirtual

          @Deprecated
          public final <T> H2ServerBootstrap registerVirtual(String hostname,
                                                                         String uriPattern,
                                                                         AsyncServerRequestHandler<T> requestHandler)

      Deprecated. Use `register(String, String, Supplier)`.
      Type Parameters:
        `T` - request handler representation.
      Returns:
        this instance.

    - #### addFilterBefore

          public final H2ServerBootstrap addFilterBefore(String existing,
                                                         String name,
                                                         AsyncFilterHandler filterHandler)

      Adds the filter before the filter with the given name.
      Returns:
        this instance.

    - #### addFilterAfter

          public final H2ServerBootstrap addFilterAfter(String existing,
                                                        String name,
                                                        AsyncFilterHandler filterHandler)

      Adds the filter after the filter with the given name.
      Returns:
        this instance.

    - #### replaceFilter

          public final H2ServerBootstrap replaceFilter(String existing,
                                                       AsyncFilterHandler filterHandler)

      Replace an existing filter with the given name with new filter.
      Returns:
        this instance.

    - #### addFilterFirst

          public final H2ServerBootstrap addFilterFirst(String name,
                                                        AsyncFilterHandler filterHandler)

      Add an filter to the head of the processing list.
      Returns:
        this instance.

    - #### addFilterLast

          public final H2ServerBootstrap addFilterLast(String name,
                                                       AsyncFilterHandler filterHandler)

      Add an filter to the tail of the processing list.
      Returns:
        this instance.

    - #### create

          public HttpAsyncServer create()

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