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 Details

    • 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(org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig)
      Sets I/O reactor configuration.
      Returns:
      this instance.
    • setHttpProcessor

      public final H2ServerBootstrap setHttpProcessor(org.apache.hc.core5.http.protocol.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(org.apache.hc.core5.http.config.Http1Config http1Config)
      Sets HTTP/1.1 protocol parameters
      Returns:
      this instance.
    • setCharset

      public final H2ServerBootstrap setCharset(org.apache.hc.core5.http.config.CharCodingConfig charCodingConfig)
      Sets message char coding.
      Returns:
      this instance.
    • setTlsStrategy

      public final H2ServerBootstrap setTlsStrategy(org.apache.hc.core5.http.nio.ssl.TlsStrategy tlsStrategy)
      Sets TlsStrategy instance.
      Returns:
      this instance.
    • setHandshakeTimeout

      public final H2ServerBootstrap setHandshakeTimeout(org.apache.hc.core5.util.Timeout handshakeTimeout)
    • setIOSessionDecorator

      public final H2ServerBootstrap setIOSessionDecorator(org.apache.hc.core5.function.Decorator<org.apache.hc.core5.reactor.IOSession> ioSessionDecorator)
      Sets IOSession Decorator instance.
      Returns:
      this instance.
    • setIOReactorMetricsListener

      public final H2ServerBootstrap setIOReactorMetricsListener(org.apache.hc.core5.reactor.IOReactorMetricsListener threadPoolListener)
      Sets IOReactorMetricsListener instance.
      Returns:
      this instance.
      Since:
      5.4
    • setExceptionCallback

      public final H2ServerBootstrap setExceptionCallback(org.apache.hc.core5.function.Callback<Exception> exceptionCallback)
      Sets Exception Callback instance.
      Returns:
      this instance.
    • setIOSessionListener

      public final H2ServerBootstrap setIOSessionListener(org.apache.hc.core5.reactor.IOSessionListener sessionListener)
      Sets IOSessionListener instance.
      Returns:
      this instance.
    • setStreamListener

      public final H2ServerBootstrap setStreamListener(H2StreamListener h2StreamListener)
      Sets H2StreamListener instance.
      Returns:
      this instance.
    • setFrameFactory

      public final H2ServerBootstrap setFrameFactory(FrameFactory frameFactory)
      Sets FrameFactory instance.
      Returns:
      this instance.
      Since:
      5.4
    • setStreamListener

      public final H2ServerBootstrap setStreamListener(org.apache.hc.core5.http.impl.Http1StreamListener http1StreamListener)
      Sets Http1StreamListener instance.
      Returns:
      this instance.
    • setLookupRegistry

      @Deprecated public final H2ServerBootstrap setLookupRegistry(org.apache.hc.core5.http.protocol.LookupRegistry<org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncServerExchangeHandler>> lookupRegistry)
      Deprecated.
      Use RequestRouter.
      Returns:
      this instance.
    • setRequestRouter

      public final H2ServerBootstrap setRequestRouter(org.apache.hc.core5.http.HttpRequestMapper<org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncServerExchangeHandler>> requestRouter)
      Sets HttpRequestMapper instance.
      Returns:
      this instance.
      Since:
      5.3
      See Also:
      • RequestRouter
    • register

      public final H2ServerBootstrap register(String uriPattern, org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.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, org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.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, org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncServerExchangeHandler> supplier)
      Returns:
      this instance.
    • register

      public final <T> H2ServerBootstrap register(String uriPattern, org.apache.hc.core5.http.nio.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, org.apache.hc.core5.http.nio.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, org.apache.hc.core5.http.nio.AsyncServerRequestHandler<T> requestHandler)
      Type Parameters:
      T - request handler representation.
      Returns:
      this instance.
    • addFilterBefore

      public final H2ServerBootstrap addFilterBefore(String existing, String name, org.apache.hc.core5.http.nio.AsyncFilterHandler filterHandler)
      Adds the filter before the filter with the given name.
      Returns:
      this instance.
    • addFilterAfter

      public final H2ServerBootstrap addFilterAfter(String existing, String name, org.apache.hc.core5.http.nio.AsyncFilterHandler filterHandler)
      Adds the filter after the filter with the given name.
      Returns:
      this instance.
    • replaceFilter

      public final H2ServerBootstrap replaceFilter(String existing, org.apache.hc.core5.http.nio.AsyncFilterHandler filterHandler)
      Replace an existing filter with the given name with new filter.
      Returns:
      this instance.
    • addFilterFirst

      public final H2ServerBootstrap addFilterFirst(String name, org.apache.hc.core5.http.nio.AsyncFilterHandler filterHandler)
      Add an filter to the head of the processing list.
      Returns:
      this instance.
    • addFilterLast

      public final H2ServerBootstrap addFilterLast(String name, org.apache.hc.core5.http.nio.AsyncFilterHandler filterHandler)
      Add an filter to the tail of the processing list.
      Returns:
      this instance.
    • create

      public org.apache.hc.core5.http.impl.bootstrap.HttpAsyncServer create()