Top Description Inners Fields Constructors Methods
org.apache.hc.client5.http.impl.async

public final Class MinimalHttpAsyncClient

extends AbstractMinimalHttpAsyncClientBase
Class Inheritance
Annotations
@Contract
threading:SAFE_CONDITIONAL
Imports
java.io.IOException, java.nio.ByteBuffer, java.util.List, java.util.concurrent.CancellationException, .Future, .ThreadFactory, java.util.concurrent.atomic.AtomicBoolean, .AtomicInteger, org.apache.hc.client5.http.HttpRoute, .SchemePortResolver, org.apache.hc.client5.http.config.Configurable, .RequestConfig, .TlsConfig, org.apache.hc.client5.http.impl.ConnPoolSupport, .DefaultSchemePortResolver, .ExecSupport, org.apache.hc.client5.http.impl.classic.RequestFailedException, org.apache.hc.client5.http.nio.AsyncClientConnectionManager, .AsyncConnectionEndpoint, org.apache.hc.client5.http.protocol.HttpClientContext, org.apache.hc.client5.http.routing.RoutingSupport, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.concurrent.BasicFuture, .Cancellable, .ComplexCancellable, .ComplexFuture, .FutureCallback, org.apache.hc.core5.http.EntityDetails, .Header, .HttpException, .HttpHost, .HttpResponse, .HttpStatus, org.apache.hc.core5.http.nio.AsyncClientEndpoint, .AsyncClientExchangeHandler, .AsyncPushConsumer, .CapacityChannel, .DataStreamChannel, .HandlerFactory, .RequestChannel, org.apache.hc.core5.http.nio.command.ShutdownCommand, org.apache.hc.core5.http.protocol.HttpContext, org.apache.hc.core5.io.CloseMode, .Closer, org.apache.hc.core5.reactor.Command, .DefaultConnectingIOReactor, .IOEventHandlerFactory, .IOReactorConfig, org.apache.hc.core5.util.Args, .Asserts, .TimeValue, .Timeout, org.slf4j.Logger, .LoggerFactory

Minimal implementation of CloseableHttpAsyncClient. This client is optimized for HTTP/1.1 and HTTP/2 message transport and does not support advanced HTTP protocol functionality such as request execution via a proxy, state management, authentication and request redirects.

Concurrent message exchanges executed by this client will get assigned to separate connections leased from the connection pool.

Since
5.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private static final Logger
private final AsyncClientConnectionManager
private final SchemePortResolver
private final TlsConfig

Constructor Summary

AccessConstructor and Description
pack-priv
MinimalHttpAsyncClient(final IOEventHandlerFactory eventHandlerFactory, final AsyncPushConsumerRegistry pushConsumerRegistry, final IOReactorConfig reactorConfig, final ThreadFactory threadFactory, final ThreadFactory workerThreadFactory, final AsyncClientConnectionManager manager, final SchemePortResolver schemePortResolver, final TlsConfig tlsConfig)

Method Summary

Modifier and TypeMethod and Description
public Cancellable
public Future<AsyncClientEndpoint>
lease(final HttpHost host, final FutureCallback<AsyncClientEndpoint> callback)

public Future<AsyncClientEndpoint>
lease(final HttpHost host, final HttpContext context, final FutureCallback<AsyncClientEndpoint> callback)

private Future<AsyncConnectionEndpoint>
leaseEndpoint(final HttpHost host, final Timeout connectionRequestTimeout, final Timeout connectTimeout, final HttpClientContext clientContext, final FutureCallback<AsyncConnectionEndpoint> callback)

Inherited from org.apache.hc.client5.http.impl.async.AbstractMinimalHttpAsyncClientBase:
doExecuteexecute

Field Detail

LOGback to summary
private static final Logger LOG

Hides org.apache.hc.client5.http.impl.async.AbstractHttpAsyncClientBase.LOG.

managerback to summary
private final AsyncClientConnectionManager manager
schemePortResolverback to summary
private final SchemePortResolver schemePortResolver
tlsConfigback to summary
private final TlsConfig tlsConfig

Constructor Detail

MinimalHttpAsyncClientback to summary
pack-priv MinimalHttpAsyncClient(final IOEventHandlerFactory eventHandlerFactory, final AsyncPushConsumerRegistry pushConsumerRegistry, final IOReactorConfig reactorConfig, final ThreadFactory threadFactory, final ThreadFactory workerThreadFactory, final AsyncClientConnectionManager manager, final SchemePortResolver schemePortResolver, final TlsConfig tlsConfig)

Method Detail

executeback to summary
public Cancellable execute(final AsyncClientExchangeHandler exchangeHandler, final HandlerFactory<AsyncPushConsumer> pushHandlerFactory, final HttpContext context)

Implements abstract org.apache.hc.client5.http.impl.async.AbstractMinimalHttpAsyncClientBase.execute.

Annotations
@Override
leaseback to summary
public Future<AsyncClientEndpoint> lease(final HttpHost host, final FutureCallback<AsyncClientEndpoint> callback)
leaseback to summary
public Future<AsyncClientEndpoint> lease(final HttpHost host, final HttpContext context, final FutureCallback<AsyncClientEndpoint> callback)
leaseEndpointback to summary
private Future<AsyncConnectionEndpoint> leaseEndpoint(final HttpHost host, final Timeout connectionRequestTimeout, final Timeout connectTimeout, final HttpClientContext clientContext, final FutureCallback<AsyncConnectionEndpoint> callback)
org.apache.hc.client5.http.impl.async back to summary

private Class MinimalHttpAsyncClient.InternalAsyncClientEndpoint

extends AsyncClientEndpoint
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final AsyncConnectionEndpoint
private final AtomicBoolean

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
execute(final AsyncClientExchangeHandler exchangeHandler, final HandlerFactory<AsyncPushConsumer> pushHandlerFactory, final HttpContext context)

Implements abstract org.apache.hc.core5.http.nio.AsyncClientEndpoint.execute.

Initiates a message exchange using the given handler.
public boolean
isConnected()

Implements abstract org.apache.hc.core5.http.nio.AsyncClientEndpoint.isConnected.

Determines if the connection to the remote endpoint is still open and valid.
pack-priv boolean
public void
releaseAndDiscard()

Implements abstract org.apache.hc.core5.http.nio.AsyncClientEndpoint.releaseAndDiscard.

Shuts down the underlying connection and removes it from the connection pool.
public void
releaseAndReuse()

Implements abstract org.apache.hc.core5.http.nio.AsyncClientEndpoint.releaseAndReuse.

Releases the underlying connection back to the connection pool as re-usable.
public void
setSocketTimeout(final Timeout timeout)

Inherited from org.apache.hc.core5.http.nio.AsyncClientEndpoint:
executeexecuteexecuteexecute

Field Detail

connectionEndpointback to summary
private final AsyncConnectionEndpoint connectionEndpoint
releasedback to summary
private final AtomicBoolean released

Constructor Detail

InternalAsyncClientEndpointback to summary
pack-priv InternalAsyncClientEndpoint(final AsyncConnectionEndpoint connectionEndpoint)

Method Detail

executeback to summary
public void execute(final AsyncClientExchangeHandler exchangeHandler, final HandlerFactory<AsyncPushConsumer> pushHandlerFactory, final HttpContext context)

Implements abstract org.apache.hc.core5.http.nio.AsyncClientEndpoint.execute.

Doc from org.apache.hc.core5.http.nio.AsyncClientEndpoint.execute.

Initiates a message exchange using the given handler.

Once the endpoint is no longer needed it MUST be released with releaseAndReuse() or releaseAndDiscard().

Annotations
@Override
isConnectedback to summary
public boolean isConnected()

Implements abstract org.apache.hc.core5.http.nio.AsyncClientEndpoint.isConnected.

Doc from org.apache.hc.core5.http.nio.AsyncClientEndpoint.isConnected.

Determines if the connection to the remote endpoint is still open and valid.

Annotations
@Override
isReleasedback to summary
pack-priv boolean isReleased()
releaseAndDiscardback to summary
public void releaseAndDiscard()

Implements abstract org.apache.hc.core5.http.nio.AsyncClientEndpoint.releaseAndDiscard.

Doc from org.apache.hc.core5.http.nio.AsyncClientEndpoint.releaseAndDiscard.

Shuts down the underlying connection and removes it from the connection pool.

Annotations
@Override
releaseAndReuseback to summary
public void releaseAndReuse()

Implements abstract org.apache.hc.core5.http.nio.AsyncClientEndpoint.releaseAndReuse.

Doc from org.apache.hc.core5.http.nio.AsyncClientEndpoint.releaseAndReuse.

Releases the underlying connection back to the connection pool as re-usable.

Annotations
@Override
setSocketTimeoutback to summary
public void setSocketTimeout(final Timeout timeout)