Search in sources :

Example 6 with HandlerFactory

use of org.apache.hc.core5.http.nio.HandlerFactory in project httpcomponents-core by apache.

the class H2MultiplexingRequester method execute.

private void execute(final AsyncClientExchangeHandler exchangeHandler, final HandlerFactory<AsyncPushConsumer> pushHandlerFactory, final CancellableDependency cancellableDependency, final Timeout timeout, final HttpContext context) {
    Args.notNull(exchangeHandler, "Exchange handler");
    Args.notNull(timeout, "Timeout");
    Args.notNull(context, "Context");
    try {
        exchangeHandler.produceRequest((request, entityDetails, httpContext) -> {
            final String scheme = request.getScheme();
            final URIAuthority authority = request.getAuthority();
            if (authority == null) {
                throw new ProtocolException("Request authority not specified");
            }
            final HttpHost target = new HttpHost(scheme, authority);
            connPool.getSession(target, timeout, new FutureCallback<IOSession>() {

                @Override
                public void completed(final IOSession ioSession) {
                    ioSession.enqueue(new RequestExecutionCommand(new AsyncClientExchangeHandler() {

                        @Override
                        public void releaseResources() {
                            exchangeHandler.releaseResources();
                        }

                        @Override
                        public void produceRequest(final RequestChannel channel, final HttpContext httpContext) throws HttpException, IOException {
                            channel.sendRequest(request, entityDetails, httpContext);
                        }

                        @Override
                        public int available() {
                            return exchangeHandler.available();
                        }

                        @Override
                        public void produce(final DataStreamChannel channel) throws IOException {
                            exchangeHandler.produce(channel);
                        }

                        @Override
                        public void consumeInformation(final HttpResponse response, final HttpContext httpContext) throws HttpException, IOException {
                            exchangeHandler.consumeInformation(response, httpContext);
                        }

                        @Override
                        public void consumeResponse(final HttpResponse response, final EntityDetails entityDetails, final HttpContext httpContext) throws HttpException, IOException {
                            exchangeHandler.consumeResponse(response, entityDetails, httpContext);
                        }

                        @Override
                        public void updateCapacity(final CapacityChannel capacityChannel) throws IOException {
                            exchangeHandler.updateCapacity(capacityChannel);
                        }

                        @Override
                        public void consume(final ByteBuffer src) throws IOException {
                            exchangeHandler.consume(src);
                        }

                        @Override
                        public void streamEnd(final List<? extends Header> trailers) throws HttpException, IOException {
                            exchangeHandler.streamEnd(trailers);
                        }

                        @Override
                        public void cancel() {
                            exchangeHandler.cancel();
                        }

                        @Override
                        public void failed(final Exception cause) {
                            exchangeHandler.failed(cause);
                        }
                    }, pushHandlerFactory, cancellableDependency, context), Command.Priority.NORMAL);
                    if (!ioSession.isOpen()) {
                        exchangeHandler.failed(new ConnectionClosedException());
                    }
                }

                @Override
                public void failed(final Exception ex) {
                    exchangeHandler.failed(ex);
                }

                @Override
                public void cancelled() {
                    exchangeHandler.cancel();
                }
            });
        }, context);
    } catch (final IOException | HttpException ex) {
        exchangeHandler.failed(ex);
    }
}
Also used : ProtocolException(org.apache.hc.core5.http.ProtocolException) URIAuthority(org.apache.hc.core5.net.URIAuthority) AsyncClientExchangeHandler(org.apache.hc.core5.http.nio.AsyncClientExchangeHandler) HttpContext(org.apache.hc.core5.http.protocol.HttpContext) HttpResponse(org.apache.hc.core5.http.HttpResponse) ConnectionClosedException(org.apache.hc.core5.http.ConnectionClosedException) IOException(java.io.IOException) RequestExecutionCommand(org.apache.hc.core5.http.nio.command.RequestExecutionCommand) ByteBuffer(java.nio.ByteBuffer) DataStreamChannel(org.apache.hc.core5.http.nio.DataStreamChannel) HttpException(org.apache.hc.core5.http.HttpException) ProtocolException(org.apache.hc.core5.http.ProtocolException) IOException(java.io.IOException) ConnectionClosedException(org.apache.hc.core5.http.ConnectionClosedException) CapacityChannel(org.apache.hc.core5.http.nio.CapacityChannel) HttpHost(org.apache.hc.core5.http.HttpHost) EntityDetails(org.apache.hc.core5.http.EntityDetails) IOSession(org.apache.hc.core5.reactor.IOSession) HttpException(org.apache.hc.core5.http.HttpException) RequestChannel(org.apache.hc.core5.http.nio.RequestChannel)

Example 7 with HandlerFactory

use of org.apache.hc.core5.http.nio.HandlerFactory in project httpcomponents-core by apache.

the class H2MultiplexingRequester method execute.

public final <T> Future<T> execute(final AsyncRequestProducer requestProducer, final AsyncResponseConsumer<T> responseConsumer, final HandlerFactory<AsyncPushConsumer> pushHandlerFactory, final Timeout timeout, final HttpContext context, final FutureCallback<T> callback) {
    Args.notNull(requestProducer, "Request producer");
    Args.notNull(responseConsumer, "Response consumer");
    Args.notNull(timeout, "Timeout");
    final ComplexFuture<T> future = new ComplexFuture<>(callback);
    final AsyncClientExchangeHandler exchangeHandler = new BasicClientExchangeHandler<>(requestProducer, responseConsumer, new FutureContribution<T>(future) {

        @Override
        public void completed(final T result) {
            future.completed(result);
        }
    });
    execute(exchangeHandler, pushHandlerFactory, future, timeout, context != null ? context : HttpCoreContext.create());
    return future;
}
Also used : AsyncClientExchangeHandler(org.apache.hc.core5.http.nio.AsyncClientExchangeHandler) BasicClientExchangeHandler(org.apache.hc.core5.http.nio.support.BasicClientExchangeHandler) ComplexFuture(org.apache.hc.core5.concurrent.ComplexFuture)

Example 8 with HandlerFactory

use of org.apache.hc.core5.http.nio.HandlerFactory in project httpcomponents-core by apache.

the class ServerH2StreamMultiplexer method createRemotelyInitiatedStream.

@Override
H2StreamHandler createRemotelyInitiatedStream(final H2StreamChannel channel, final HttpProcessor httpProcessor, final BasicHttpConnectionMetrics connMetrics, final HandlerFactory<AsyncPushConsumer> pushHandlerFactory) throws IOException {
    final HttpCoreContext context = HttpCoreContext.create();
    context.setAttribute(HttpCoreContext.SSL_SESSION, getSSLSession());
    context.setAttribute(HttpCoreContext.CONNECTION_ENDPOINT, getEndpointDetails());
    return new ServerH2StreamHandler(channel, httpProcessor, connMetrics, exchangeHandlerFactory, context);
}
Also used : HttpCoreContext(org.apache.hc.core5.http.protocol.HttpCoreContext)

Example 9 with HandlerFactory

use of org.apache.hc.core5.http.nio.HandlerFactory in project httpcomponents-core by apache.

the class Http1IntegrationTest method testTruncatedChunk.

@Test
public void testTruncatedChunk() throws Exception {
    final InetSocketAddress serverEndpoint = server.start(new InternalServerHttp1EventHandlerFactory(HttpProcessors.server(), (request, context) -> new MessageExchangeHandler<String>(new StringAsyncEntityConsumer()) {

        @Override
        protected void handle(final Message<HttpRequest, String> request, final AsyncServerRequestHandler.ResponseTrigger responseTrigger, final HttpContext context) throws IOException, HttpException {
            responseTrigger.submitResponse(new BasicResponseProducer(new StringAsyncEntityProducer("useful stuff")), context);
        }
    }, Http1Config.DEFAULT, CharCodingConfig.DEFAULT, DefaultConnectionReuseStrategy.INSTANCE, scheme == URIScheme.HTTPS ? SSLTestContexts.createServerSSLContext() : null, null, null) {

        @Override
        protected ServerHttp1StreamDuplexer createServerHttp1StreamDuplexer(final ProtocolIOSession ioSession, final HttpProcessor httpProcessor, final HandlerFactory<AsyncServerExchangeHandler> exchangeHandlerFactory, final Http1Config http1Config, final CharCodingConfig connectionConfig, final ConnectionReuseStrategy connectionReuseStrategy, final NHttpMessageParser<HttpRequest> incomingMessageParser, final NHttpMessageWriter<HttpResponse> outgoingMessageWriter, final ContentLengthStrategy incomingContentStrategy, final ContentLengthStrategy outgoingContentStrategy, final Http1StreamListener streamListener) {
            return new ServerHttp1StreamDuplexer(ioSession, httpProcessor, exchangeHandlerFactory, scheme.id, http1Config, connectionConfig, connectionReuseStrategy, incomingMessageParser, outgoingMessageWriter, incomingContentStrategy, outgoingContentStrategy, streamListener) {

                @Override
                protected ContentEncoder createContentEncoder(final long len, final WritableByteChannel channel, final SessionOutputBuffer buffer, final BasicHttpTransportMetrics metrics) throws HttpException {
                    if (len == ContentLengthStrategy.CHUNKED) {
                        return new BrokenChunkEncoder(channel, buffer, metrics);
                    } else {
                        return super.createContentEncoder(len, channel, buffer, metrics);
                    }
                }
            };
        }
    });
    client.start();
    final Future<ClientSessionEndpoint> connectFuture = client.connect("localhost", serverEndpoint.getPort(), TIMEOUT);
    final ClientSessionEndpoint streamEndpoint = connectFuture.get();
    final AsyncRequestProducer requestProducer = new BasicRequestProducer(Method.GET, createRequestURI(serverEndpoint, "/hello"));
    final StringAsyncEntityConsumer entityConsumer = new StringAsyncEntityConsumer() {

        @Override
        public void releaseResources() {
        // Do not clear internal content buffer
        }
    };
    final BasicResponseConsumer<String> responseConsumer = new BasicResponseConsumer<>(entityConsumer);
    final Future<Message<HttpResponse, String>> future1 = streamEndpoint.execute(requestProducer, responseConsumer, null);
    final ExecutionException exception = Assertions.assertThrows(ExecutionException.class, () -> future1.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit()));
    final Throwable cause = exception.getCause();
    Assertions.assertTrue(cause instanceof MalformedChunkCodingException);
    Assertions.assertEquals("garbage", entityConsumer.generateContent());
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) Arrays(java.util.Arrays) BasicResponseProducer(org.apache.hc.core5.http.nio.support.BasicResponseProducer) IOReactorConfig(org.apache.hc.core5.reactor.IOReactorConfig) CharCodingConfig(org.apache.hc.core5.http.config.CharCodingConfig) BasicAsyncServerExpectationDecorator(org.apache.hc.core5.http.nio.support.BasicAsyncServerExpectationDecorator) StringAsyncEntityConsumer(org.apache.hc.core5.http.nio.entity.StringAsyncEntityConsumer) AbstractClassicEntityProducer(org.apache.hc.core5.http.nio.support.classic.AbstractClassicEntityProducer) HttpProcessor(org.apache.hc.core5.http.protocol.HttpProcessor) Future(java.util.concurrent.Future) Map(java.util.Map) DigestingEntityProducer(org.apache.hc.core5.http.nio.entity.DigestingEntityProducer) AbstractClassicServerExchangeHandler(org.apache.hc.core5.http.nio.support.classic.AbstractClassicServerExchangeHandler) RequestConnControl(org.apache.hc.core5.http.protocol.RequestConnControl) CancellationException(java.util.concurrent.CancellationException) DataStreamChannel(org.apache.hc.core5.http.nio.DataStreamChannel) HandlerFactory(org.apache.hc.core5.http.nio.HandlerFactory) ContentLengthStrategy(org.apache.hc.core5.http.ContentLengthStrategy) ConnectionReuseStrategy(org.apache.hc.core5.http.ConnectionReuseStrategy) Timeout(org.apache.hc.core5.util.Timeout) StandardCharsets(java.nio.charset.StandardCharsets) Executors(java.util.concurrent.Executors) MalformedChunkCodingException(org.apache.hc.core5.http.MalformedChunkCodingException) HeaderElements(org.apache.hc.core5.http.HeaderElements) CapacityChannel(org.apache.hc.core5.http.nio.CapacityChannel) HttpContext(org.apache.hc.core5.http.protocol.HttpContext) AsyncServerRequestHandler(org.apache.hc.core5.http.nio.AsyncServerRequestHandler) RunWith(org.junit.runner.RunWith) InterruptedIOException(java.io.InterruptedIOException) NHttpMessageParser(org.apache.hc.core5.http.nio.NHttpMessageParser) EntityDetails(org.apache.hc.core5.http.EntityDetails) HttpVersion(org.apache.hc.core5.http.HttpVersion) StringTokenizer(java.util.StringTokenizer) RequestTargetHost(org.apache.hc.core5.http.protocol.RequestTargetHost) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) NHttpMessageWriter(org.apache.hc.core5.http.nio.NHttpMessageWriter) SessionOutputBuffer(org.apache.hc.core5.http.nio.SessionOutputBuffer) AsyncResponseProducer(org.apache.hc.core5.http.nio.AsyncResponseProducer) BasicHttpRequest(org.apache.hc.core5.http.message.BasicHttpRequest) ImmediateResponseExchangeHandler(org.apache.hc.core5.http.nio.support.ImmediateResponseExchangeHandler) BufferedWriter(java.io.BufferedWriter) IOException(java.io.IOException) Test(org.junit.Test) InputStreamReader(java.io.InputStreamReader) URIScheme(org.apache.hc.core5.http.URIScheme) ExecutionException(java.util.concurrent.ExecutionException) BasicRequestProducer(org.apache.hc.core5.http.nio.support.BasicRequestProducer) HttpHeaders(org.apache.hc.core5.http.HttpHeaders) AfterEach(org.junit.jupiter.api.AfterEach) HttpHost(org.apache.hc.core5.http.HttpHost) HttpRequest(org.apache.hc.core5.http.HttpRequest) ContentType(org.apache.hc.core5.http.ContentType) WritableByteChannel(java.nio.channels.WritableByteChannel) AsyncRequestProducer(org.apache.hc.core5.http.nio.AsyncRequestProducer) BufferedReader(java.io.BufferedReader) HttpStatus(org.apache.hc.core5.http.HttpStatus) AsyncEntityProducers(org.apache.hc.core5.http.nio.entity.AsyncEntityProducers) CoreMatchers(org.hamcrest.CoreMatchers) AsyncRequestBuilder(org.apache.hc.core5.http.nio.support.AsyncRequestBuilder) RequestContent(org.apache.hc.core5.http.protocol.RequestContent) URISyntaxException(java.net.URISyntaxException) LoggerFactory(org.slf4j.LoggerFactory) Random(java.util.Random) BasicHttpTransportMetrics(org.apache.hc.core5.http.impl.BasicHttpTransportMetrics) ByteBuffer(java.nio.ByteBuffer) AbstractClassicEntityConsumer(org.apache.hc.core5.http.nio.support.classic.AbstractClassicEntityConsumer) HttpProcessors(org.apache.hc.core5.http.impl.HttpProcessors) URI(java.net.URI) Http1Config(org.apache.hc.core5.http.config.Http1Config) EnableRuleMigrationSupport(org.junit.jupiter.migrationsupport.rules.EnableRuleMigrationSupport) AsyncServerExchangeHandler(org.apache.hc.core5.http.nio.AsyncServerExchangeHandler) RequestValidateHost(org.apache.hc.core5.http.protocol.RequestValidateHost) Parameterized(org.junit.runners.Parameterized) Message(org.apache.hc.core5.http.Message) TimeValue(org.apache.hc.core5.util.TimeValue) Collection(java.util.Collection) BasicResponseConsumer(org.apache.hc.core5.http.nio.support.BasicResponseConsumer) InetSocketAddress(java.net.InetSocketAddress) StringAsyncEntityProducer(org.apache.hc.core5.http.nio.entity.StringAsyncEntityProducer) List(java.util.List) ContentEncoder(org.apache.hc.core5.http.nio.ContentEncoder) SSLTestContexts(org.apache.hc.core5.testing.SSLTestContexts) CharArrayBuffer(org.apache.hc.core5.util.CharArrayBuffer) ProtocolIOSession(org.apache.hc.core5.reactor.ProtocolIOSession) Queue(java.util.Queue) DefaultConnectionReuseStrategy(org.apache.hc.core5.http.impl.DefaultConnectionReuseStrategy) AbstractContentEncoder(org.apache.hc.core5.http.impl.nio.AbstractContentEncoder) HashMap(java.util.HashMap) AtomicReference(java.util.concurrent.atomic.AtomicReference) ResponseChannel(org.apache.hc.core5.http.nio.ResponseChannel) TextUtils(org.apache.hc.core5.util.TextUtils) AsyncRequestConsumer(org.apache.hc.core5.http.nio.AsyncRequestConsumer) Charset(java.nio.charset.Charset) OutputStreamWriter(java.io.OutputStreamWriter) ServerHttp1StreamDuplexer(org.apache.hc.core5.http.impl.nio.ServerHttp1StreamDuplexer) HttpResponse(org.apache.hc.core5.http.HttpResponse) LinkedList(java.util.LinkedList) Http1StreamListener(org.apache.hc.core5.http.impl.Http1StreamListener) DefaultHttpProcessor(org.apache.hc.core5.http.protocol.DefaultHttpProcessor) OutputStream(java.io.OutputStream) HttpException(org.apache.hc.core5.http.HttpException) Logger(org.slf4j.Logger) Header(org.apache.hc.core5.http.Header) ProtocolException(org.apache.hc.core5.http.ProtocolException) BasicRequestConsumer(org.apache.hc.core5.http.nio.support.BasicRequestConsumer) AbstractServerExchangeHandler(org.apache.hc.core5.http.nio.support.AbstractServerExchangeHandler) DigestingEntityConsumer(org.apache.hc.core5.http.nio.entity.DigestingEntityConsumer) AsyncEntityProducer(org.apache.hc.core5.http.nio.AsyncEntityProducer) IOSession(org.apache.hc.core5.reactor.IOSession) Method(org.apache.hc.core5.http.Method) BasicHttpResponse(org.apache.hc.core5.http.message.BasicHttpResponse) Assertions(org.junit.jupiter.api.Assertions) InputStream(java.io.InputStream) CharCodingConfig(org.apache.hc.core5.http.config.CharCodingConfig) Message(org.apache.hc.core5.http.Message) InetSocketAddress(java.net.InetSocketAddress) ProtocolIOSession(org.apache.hc.core5.reactor.ProtocolIOSession) HttpProcessor(org.apache.hc.core5.http.protocol.HttpProcessor) DefaultHttpProcessor(org.apache.hc.core5.http.protocol.DefaultHttpProcessor) StringAsyncEntityProducer(org.apache.hc.core5.http.nio.entity.StringAsyncEntityProducer) Http1StreamListener(org.apache.hc.core5.http.impl.Http1StreamListener) AsyncRequestProducer(org.apache.hc.core5.http.nio.AsyncRequestProducer) SessionOutputBuffer(org.apache.hc.core5.http.nio.SessionOutputBuffer) BasicResponseConsumer(org.apache.hc.core5.http.nio.support.BasicResponseConsumer) HttpException(org.apache.hc.core5.http.HttpException) ExecutionException(java.util.concurrent.ExecutionException) AsyncServerExchangeHandler(org.apache.hc.core5.http.nio.AsyncServerExchangeHandler) StringAsyncEntityConsumer(org.apache.hc.core5.http.nio.entity.StringAsyncEntityConsumer) BasicHttpRequest(org.apache.hc.core5.http.message.BasicHttpRequest) HttpRequest(org.apache.hc.core5.http.HttpRequest) MalformedChunkCodingException(org.apache.hc.core5.http.MalformedChunkCodingException) ServerHttp1StreamDuplexer(org.apache.hc.core5.http.impl.nio.ServerHttp1StreamDuplexer) ContentEncoder(org.apache.hc.core5.http.nio.ContentEncoder) AbstractContentEncoder(org.apache.hc.core5.http.impl.nio.AbstractContentEncoder) BasicRequestProducer(org.apache.hc.core5.http.nio.support.BasicRequestProducer) HttpContext(org.apache.hc.core5.http.protocol.HttpContext) WritableByteChannel(java.nio.channels.WritableByteChannel) HttpResponse(org.apache.hc.core5.http.HttpResponse) BasicHttpResponse(org.apache.hc.core5.http.message.BasicHttpResponse) ContentLengthStrategy(org.apache.hc.core5.http.ContentLengthStrategy) BasicHttpTransportMetrics(org.apache.hc.core5.http.impl.BasicHttpTransportMetrics) ConnectionReuseStrategy(org.apache.hc.core5.http.ConnectionReuseStrategy) DefaultConnectionReuseStrategy(org.apache.hc.core5.http.impl.DefaultConnectionReuseStrategy) BasicResponseProducer(org.apache.hc.core5.http.nio.support.BasicResponseProducer) Http1Config(org.apache.hc.core5.http.config.Http1Config) Test(org.junit.Test)

Example 10 with HandlerFactory

use of org.apache.hc.core5.http.nio.HandlerFactory in project httpcomponents-core by apache.

the class AsyncServerBootstrap method create.

public HttpAsyncServer create() {
    final RequestHandlerRegistry<Supplier<AsyncServerExchangeHandler>> registry = new RequestHandlerRegistry<>(canonicalHostName != null ? canonicalHostName : InetAddressUtils.getCanonicalLocalHostName(), () -> lookupRegistry != null ? lookupRegistry : UriPatternType.newMatcher(UriPatternType.URI_PATTERN));
    for (final HandlerEntry<Supplier<AsyncServerExchangeHandler>> entry : handlerList) {
        registry.register(entry.hostname, entry.uriPattern, entry.handler);
    }
    final HandlerFactory<AsyncServerExchangeHandler> handlerFactory;
    if (!filters.isEmpty()) {
        final NamedElementChain<AsyncFilterHandler> filterChainDefinition = new NamedElementChain<>();
        filterChainDefinition.addLast(new TerminalAsyncServerFilter(new DefaultAsyncResponseExchangeHandlerFactory(registry)), StandardFilter.MAIN_HANDLER.name());
        filterChainDefinition.addFirst(new AsyncServerExpectationFilter(), StandardFilter.EXPECT_CONTINUE.name());
        for (final FilterEntry<AsyncFilterHandler> entry : filters) {
            switch(entry.position) {
                case AFTER:
                    filterChainDefinition.addAfter(entry.existing, entry.filterHandler, entry.name);
                    break;
                case BEFORE:
                    filterChainDefinition.addBefore(entry.existing, entry.filterHandler, entry.name);
                    break;
                case REPLACE:
                    filterChainDefinition.replace(entry.existing, entry.filterHandler);
                    break;
                case FIRST:
                    filterChainDefinition.addFirst(entry.filterHandler, entry.name);
                    break;
                case LAST:
                    // Don't add last, after TerminalAsyncServerFilter, as that does not delegate to the chain
                    // Instead, add the filter just before it, making it effectively the last filter
                    filterChainDefinition.addBefore(StandardFilter.MAIN_HANDLER.name(), entry.filterHandler, entry.name);
                    break;
            }
        }
        NamedElementChain<AsyncFilterHandler>.Node current = filterChainDefinition.getLast();
        AsyncServerFilterChainElement execChain = null;
        while (current != null) {
            execChain = new AsyncServerFilterChainElement(current.getValue(), execChain);
            current = current.getPrevious();
        }
        handlerFactory = new AsyncServerFilterChainExchangeHandlerFactory(execChain, exceptionCallback);
    } else {
        handlerFactory = new DefaultAsyncResponseExchangeHandlerFactory(registry, handler -> new BasicAsyncServerExpectationDecorator(handler, exceptionCallback));
    }
    final ServerHttp1StreamDuplexerFactory streamHandlerFactory = new ServerHttp1StreamDuplexerFactory(httpProcessor != null ? httpProcessor : HttpProcessors.server(), handlerFactory, http1Config != null ? http1Config : Http1Config.DEFAULT, charCodingConfig != null ? charCodingConfig : CharCodingConfig.DEFAULT, connStrategy != null ? connStrategy : DefaultConnectionReuseStrategy.INSTANCE, DefaultHttpRequestParserFactory.INSTANCE, DefaultHttpResponseWriterFactory.INSTANCE, DefaultContentLengthStrategy.INSTANCE, DefaultContentLengthStrategy.INSTANCE, streamListener);
    final IOEventHandlerFactory ioEventHandlerFactory = new ServerHttp1IOEventHandlerFactory(streamHandlerFactory, tlsStrategy, handshakeTimeout);
    return new HttpAsyncServer(ioEventHandlerFactory, ioReactorConfig, ioSessionDecorator, exceptionCallback, sessionListener);
}
Also used : AsyncServerFilterChainElement(org.apache.hc.core5.http.nio.support.AsyncServerFilterChainElement) AsyncServerFilterChainExchangeHandlerFactory(org.apache.hc.core5.http.nio.support.AsyncServerFilterChainExchangeHandlerFactory) RequestHandlerRegistry(org.apache.hc.core5.http.protocol.RequestHandlerRegistry) Args(org.apache.hc.core5.util.Args) IOReactorConfig(org.apache.hc.core5.reactor.IOReactorConfig) CharCodingConfig(org.apache.hc.core5.http.config.CharCodingConfig) AsyncServerRequestHandler(org.apache.hc.core5.http.nio.AsyncServerRequestHandler) AsyncServerFilterChainElement(org.apache.hc.core5.http.nio.support.AsyncServerFilterChainElement) BasicAsyncServerExpectationDecorator(org.apache.hc.core5.http.nio.support.BasicAsyncServerExpectationDecorator) IOSessionListener(org.apache.hc.core5.reactor.IOSessionListener) Supplier(org.apache.hc.core5.function.Supplier) ArrayList(java.util.ArrayList) ServerHttp1IOEventHandlerFactory(org.apache.hc.core5.http.impl.nio.ServerHttp1IOEventHandlerFactory) HttpProcessor(org.apache.hc.core5.http.protocol.HttpProcessor) HttpProcessors(org.apache.hc.core5.http.impl.HttpProcessors) DefaultHttpResponseWriterFactory(org.apache.hc.core5.http.impl.nio.DefaultHttpResponseWriterFactory) LookupRegistry(org.apache.hc.core5.http.protocol.LookupRegistry) Http1Config(org.apache.hc.core5.http.config.Http1Config) NamedElementChain(org.apache.hc.core5.http.config.NamedElementChain) Http1StreamListener(org.apache.hc.core5.http.impl.Http1StreamListener) AsyncServerExchangeHandler(org.apache.hc.core5.http.nio.AsyncServerExchangeHandler) AsyncFilterHandler(org.apache.hc.core5.http.nio.AsyncFilterHandler) BasicServerExchangeHandler(org.apache.hc.core5.http.nio.support.BasicServerExchangeHandler) Decorator(org.apache.hc.core5.function.Decorator) HandlerFactory(org.apache.hc.core5.http.nio.HandlerFactory) Callback(org.apache.hc.core5.function.Callback) ConnectionReuseStrategy(org.apache.hc.core5.http.ConnectionReuseStrategy) Timeout(org.apache.hc.core5.util.Timeout) DefaultContentLengthStrategy(org.apache.hc.core5.http.impl.DefaultContentLengthStrategy) UriPatternType(org.apache.hc.core5.http.protocol.UriPatternType) IOEventHandlerFactory(org.apache.hc.core5.reactor.IOEventHandlerFactory) List(java.util.List) DefaultHttpRequestParserFactory(org.apache.hc.core5.http.impl.nio.DefaultHttpRequestParserFactory) IOSession(org.apache.hc.core5.reactor.IOSession) TerminalAsyncServerFilter(org.apache.hc.core5.http.nio.support.TerminalAsyncServerFilter) InetAddressUtils(org.apache.hc.core5.net.InetAddressUtils) ServerHttp1StreamDuplexerFactory(org.apache.hc.core5.http.impl.nio.ServerHttp1StreamDuplexerFactory) TlsStrategy(org.apache.hc.core5.http.nio.ssl.TlsStrategy) AsyncServerExpectationFilter(org.apache.hc.core5.http.nio.support.AsyncServerExpectationFilter) DefaultAsyncResponseExchangeHandlerFactory(org.apache.hc.core5.http.nio.support.DefaultAsyncResponseExchangeHandlerFactory) DefaultConnectionReuseStrategy(org.apache.hc.core5.http.impl.DefaultConnectionReuseStrategy) AsyncFilterHandler(org.apache.hc.core5.http.nio.AsyncFilterHandler) ServerHttp1StreamDuplexerFactory(org.apache.hc.core5.http.impl.nio.ServerHttp1StreamDuplexerFactory) BasicAsyncServerExpectationDecorator(org.apache.hc.core5.http.nio.support.BasicAsyncServerExpectationDecorator) TerminalAsyncServerFilter(org.apache.hc.core5.http.nio.support.TerminalAsyncServerFilter) AsyncServerExpectationFilter(org.apache.hc.core5.http.nio.support.AsyncServerExpectationFilter) DefaultAsyncResponseExchangeHandlerFactory(org.apache.hc.core5.http.nio.support.DefaultAsyncResponseExchangeHandlerFactory) NamedElementChain(org.apache.hc.core5.http.config.NamedElementChain) RequestHandlerRegistry(org.apache.hc.core5.http.protocol.RequestHandlerRegistry) Supplier(org.apache.hc.core5.function.Supplier) AsyncServerFilterChainExchangeHandlerFactory(org.apache.hc.core5.http.nio.support.AsyncServerFilterChainExchangeHandlerFactory) ServerHttp1IOEventHandlerFactory(org.apache.hc.core5.http.impl.nio.ServerHttp1IOEventHandlerFactory) IOEventHandlerFactory(org.apache.hc.core5.reactor.IOEventHandlerFactory) ServerHttp1IOEventHandlerFactory(org.apache.hc.core5.http.impl.nio.ServerHttp1IOEventHandlerFactory) AsyncServerExchangeHandler(org.apache.hc.core5.http.nio.AsyncServerExchangeHandler)

Aggregations

AsyncClientExchangeHandler (org.apache.hc.core5.http.nio.AsyncClientExchangeHandler)5 List (java.util.List)4 HandlerFactory (org.apache.hc.core5.http.nio.HandlerFactory)4 HttpContext (org.apache.hc.core5.http.protocol.HttpContext)4 IOSession (org.apache.hc.core5.reactor.IOSession)4 IOException (java.io.IOException)3 ByteBuffer (java.nio.ByteBuffer)3 ConnectionClosedException (org.apache.hc.core5.http.ConnectionClosedException)3 EntityDetails (org.apache.hc.core5.http.EntityDetails)3 HttpException (org.apache.hc.core5.http.HttpException)3 HttpHost (org.apache.hc.core5.http.HttpHost)3 HttpResponse (org.apache.hc.core5.http.HttpResponse)3 ProtocolException (org.apache.hc.core5.http.ProtocolException)3 CharCodingConfig (org.apache.hc.core5.http.config.CharCodingConfig)3 Http1Config (org.apache.hc.core5.http.config.Http1Config)3 DefaultConnectionReuseStrategy (org.apache.hc.core5.http.impl.DefaultConnectionReuseStrategy)3 Http1StreamListener (org.apache.hc.core5.http.impl.Http1StreamListener)3 HttpProcessors (org.apache.hc.core5.http.impl.HttpProcessors)3 AsyncServerExchangeHandler (org.apache.hc.core5.http.nio.AsyncServerExchangeHandler)3 AsyncServerRequestHandler (org.apache.hc.core5.http.nio.AsyncServerRequestHandler)3