Class HttpAsyncClients


  • public final class HttpAsyncClients
    extends java.lang.Object
    Factory methods for CloseableHttpAsyncClient instances.
    Since:
    5.0
    • Constructor Detail

      • HttpAsyncClients

        private HttpAsyncClients()
    • Method Detail

      • createMinimalProtocolProcessor

        private static org.apache.hc.core5.http.protocol.HttpProcessor createMinimalProtocolProcessor()
      • createMinimal

        public static MinimalHttpAsyncClient createMinimal​(org.apache.hc.core5.http2.config.H2Config h2Config,
                                                           org.apache.hc.core5.http.config.Http1Config h1Config,
                                                           org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig,
                                                           AsyncClientConnectionManager connmgr)
        Creates MinimalHttpAsyncClient instance optimized for HTTP/1.1 and HTTP/2 message transport without advanced HTTP protocol functionality.
        Since:
        5.2
      • createMinimal

        @Deprecated
        public static MinimalHttpAsyncClient createMinimal​(org.apache.hc.core5.http2.HttpVersionPolicy versionPolicy,
                                                           org.apache.hc.core5.http2.config.H2Config h2Config,
                                                           org.apache.hc.core5.http.config.Http1Config h1Config,
                                                           org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig)
        Creates MinimalHttpAsyncClient instance optimized for HTTP/1.1 and HTTP/2 message transport without advanced HTTP protocol functionality.
      • createMinimal

        public static MinimalHttpAsyncClient createMinimal​(org.apache.hc.core5.http2.config.H2Config h2Config,
                                                           org.apache.hc.core5.http.config.Http1Config h1Config,
                                                           org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig)
        Creates MinimalHttpAsyncClient instance optimized for HTTP/1.1 and HTTP/2 message transport without advanced HTTP protocol functionality.
      • createMinimal

        public static MinimalHttpAsyncClient createMinimal​(org.apache.hc.core5.http2.config.H2Config h2Config,
                                                           org.apache.hc.core5.http.config.Http1Config h1Config)
        Creates MinimalHttpAsyncClient instance optimized for HTTP/1.1 and HTTP/2 message transport without advanced HTTP protocol functionality.
      • createMinimalHttp2AsyncClientImpl

        private static MinimalH2AsyncClient createMinimalHttp2AsyncClientImpl​(org.apache.hc.core5.reactor.IOEventHandlerFactory eventHandlerFactory,
                                                                              AsyncPushConsumerRegistry pushConsumerRegistry,
                                                                              org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig,
                                                                              DnsResolver dnsResolver,
                                                                              org.apache.hc.core5.http.nio.ssl.TlsStrategy tlsStrategy)
      • createHttp2Minimal

        public static MinimalH2AsyncClient createHttp2Minimal​(org.apache.hc.core5.http2.config.H2Config h2Config,
                                                              org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig,
                                                              DnsResolver dnsResolver,
                                                              org.apache.hc.core5.http.nio.ssl.TlsStrategy tlsStrategy)
        Creates MinimalH2AsyncClient instance optimized for HTTP/2 multiplexing message transport without advanced HTTP protocol functionality.
      • createHttp2Minimal

        public static MinimalH2AsyncClient createHttp2Minimal​(org.apache.hc.core5.http2.config.H2Config h2Config,
                                                              org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig,
                                                              org.apache.hc.core5.http.nio.ssl.TlsStrategy tlsStrategy)
        Creates MinimalH2AsyncClient instance optimized for HTTP/2 multiplexing message transport without advanced HTTP protocol functionality.
      • createHttp2Minimal

        public static MinimalH2AsyncClient createHttp2Minimal​(org.apache.hc.core5.http2.config.H2Config h2Config,
                                                              org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig)
        Creates MinimalH2AsyncClient instance optimized for HTTP/2 multiplexing message transport without advanced HTTP protocol functionality.
      • createHttp2Minimal

        public static MinimalH2AsyncClient createHttp2Minimal​(org.apache.hc.core5.http2.config.H2Config h2Config)
        Creates MinimalH2AsyncClient instance optimized for HTTP/2 multiplexing message transport without advanced HTTP protocol functionality.
      • createHttp2Minimal

        public static MinimalH2AsyncClient createHttp2Minimal()
        Creates MinimalH2AsyncClient instance optimized for HTTP/2 multiplexing message transport without advanced HTTP protocol functionality.
      • pushRouter

        public static org.apache.hc.core5.http.nio.HandlerFactory<org.apache.hc.core5.http.nio.AsyncPushConsumer> pushRouter​(org.apache.hc.core5.http.impl.routing.RequestRouter<org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncPushConsumer>> requestRouter)
        Creates HandlerFactory backed by a push RequestRouter.
        Since:
        5.4
      • classic

        @Experimental
        public static CloseableHttpClient classic​(CloseableHttpAsyncClient client,
                                                  org.apache.hc.core5.util.Timeout operationTimeout)
        Creates an CloseableHttpClient facade backed by CloseableHttpAsyncClient built internally and acting as a compatibility bridge between the classic APIs based on the standard InputStream / OutputStream model and the underlying asynchronous message transport.

        This feature is considered experimental and may be discontinued in the future.

        Parameters:
        client - async client
        operationTimeout - maximum period an operation can block awaiting input / output.
        Since:
        5.5