org.apache.hc.core5.testing.nio

## Class H2TestServer

- java.lang.Object
- - org.apache.hc.core5.testing.nio.AsyncServer
  - - org.apache.hc.core5.testing.nio.H2TestServer

- All Implemented Interfaces:
    AutoCloseable

      public class H2TestServer
      extends AsyncServer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `H2TestServer()`
    `H2TestServer(IOReactorConfig ioReactorConfig, SSLContext sslContext, SSLSessionInitializer sslSessionInitializer, SSLSessionVerifier sslSessionVerifier)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `awaitShutdown(TimeValue waitTime)`
    `void` | `close()`
    `void` | `configure(Decorator<AsyncServerExchangeHandler> exchangeHandlerDecorator)`
    `void` | `configure(H2Config h2Config)`
    `void` | `configure(Http1Config http1Config)`
    `void` | `configure(HttpProcessor httpProcessor)`
    `protected void` | `execute(IOEventHandlerFactory ioEventHandlerFactory)`
    `IOReactorStatus` | `getStatus()`
    `void` | `initiateShutdown()`
    `<T> void` | `register(String uriPattern, AsyncServerRequestHandler<T> requestHandler)`
    `void` | `register(String uriPattern, Supplier<AsyncServerExchangeHandler> supplier)`
    `void` | `shutdown(TimeValue graceTime)`
    `InetSocketAddress` | `start()`
    `InetSocketAddress` | `start(H2Config h2Config)` Deprecated. Use `configure(H2Config)`, `start()`.
    `InetSocketAddress` | `start(Http1Config http1Config)` Deprecated. Use `configure(Http1Config)`, `start()`.
    `InetSocketAddress` | `start(HttpProcessor httpProcessor, Decorator<AsyncServerExchangeHandler> exchangeHandlerDecorator, H2Config h2Config)` Deprecated. Use `configure(H2Config)`, `configure(HttpProcessor)`, `configure(Decorator)`, `start()`.
    `InetSocketAddress` | `start(HttpProcessor httpProcessor, Decorator<AsyncServerExchangeHandler> exchangeHandlerDecorator, Http1Config http1Config)` Deprecated. Use `configure(Http1Config)`, `configure(HttpProcessor)`, `configure(Decorator)`, `start()`.
    `InetSocketAddress` | `start(HttpProcessor httpProcessor, Http1Config http1Config)` Deprecated. Use `configure(Http1Config)`, `configure(HttpProcessor)`, `start()`.
    `void` | `start(IOEventHandlerFactory handlerFactory)`

    - ### Methods inherited from class org.apache.hc.core5.testing.nio.AsyncServer

      `getEndpoints, listen`

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

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

- - ### Constructor Detail

    - #### H2TestServer

          public H2TestServer(IOReactorConfig ioReactorConfig,
                              SSLContext sslContext,
                              SSLSessionInitializer sslSessionInitializer,
                              SSLSessionVerifier sslSessionVerifier)
                       throws IOException

      Throws:
        `IOException`

    - #### H2TestServer

          public H2TestServer()
                       throws IOException

      Throws:
        `IOException`

  - ### Method Detail

    - #### register

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

    - #### register

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

    - #### configure

          public void configure(H2Config h2Config)

      Since:
        5.3

    - #### configure

          public void configure(Http1Config http1Config)

      Since:
        5.3

    - #### configure

          public void configure(HttpProcessor httpProcessor)

      Since:
        5.3

    - #### configure

          public void configure(Decorator<AsyncServerExchangeHandler> exchangeHandlerDecorator)

      Since:
        5.3

    - #### start

          public void start(IOEventHandlerFactory handlerFactory)
                     throws IOException

      Throws:
        `IOException`

    - #### start

          @Deprecated
          public InetSocketAddress start(HttpProcessor httpProcessor,
                                                     Decorator<AsyncServerExchangeHandler> exchangeHandlerDecorator,
                                                     Http1Config http1Config)
                                              throws Exception

      Deprecated. Use `configure(Http1Config)`, `configure(HttpProcessor)`, `configure(Decorator)`, `start()`.
      Throws:
        `Exception`

    - #### start

          @Deprecated
          public InetSocketAddress start(HttpProcessor httpProcessor,
                                                     Decorator<AsyncServerExchangeHandler> exchangeHandlerDecorator,
                                                     H2Config h2Config)
                                              throws Exception

      Deprecated. Use `configure(H2Config)`, `configure(HttpProcessor)`, `configure(Decorator)`, `start()`.
      Throws:
        `Exception`

    - #### start

          @Deprecated
          public InetSocketAddress start(HttpProcessor httpProcessor,
                                                     Http1Config http1Config)
                                              throws Exception

      Deprecated. Use `configure(Http1Config)`, `configure(HttpProcessor)`, `start()`.
      Throws:
        `Exception`

    - #### start

          @Deprecated
          public InetSocketAddress start(H2Config h2Config)
                                              throws Exception

      Deprecated. Use `configure(H2Config)`, `start()`.
      Throws:
        `Exception`

    - #### start

          @Deprecated
          public InetSocketAddress start(Http1Config http1Config)
                                              throws Exception

      Deprecated. Use `configure(Http1Config)`, `start()`.
      Throws:
        `Exception`

    - #### start

          public InetSocketAddress start()
                                  throws Exception

      Throws:
        `Exception`

    - #### execute

          protected void execute(IOEventHandlerFactory ioEventHandlerFactory)
                          throws IOException

      Throws:
        `IOException`

    - #### getStatus

          public IOReactorStatus getStatus()

    - #### awaitShutdown

          public void awaitShutdown(TimeValue waitTime)
                             throws InterruptedException

      Throws:
        `InterruptedException`

    - #### initiateShutdown

          public void initiateShutdown()

    - #### shutdown

          public void shutdown(TimeValue graceTime)

    - #### close

          public void close()
                     throws Exception

      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `Exception`

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