Class MinimalHttpAsyncClient
- java.lang.Object
-
- org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient
-
- org.apache.hc.client5.http.impl.async.MinimalHttpAsyncClient
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,HttpAsyncClient,org.apache.hc.core5.io.ModalCloseable,org.apache.hc.core5.reactor.ConnectionInitiator
@Contract(threading=SAFE_CONDITIONAL) public final class MinimalHttpAsyncClient extends CloseableHttpAsyncClient
Minimal implementation ofCloseableHttpAsyncClient. 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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidawaitShutdown(org.apache.hc.core5.util.TimeValue waitTime)voidclose()voidclose(org.apache.hc.core5.io.CloseMode closeMode)java.util.concurrent.Future<org.apache.hc.core5.reactor.IOSession>connect(org.apache.hc.core5.net.NamedEndpoint remoteEndpoint, java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, org.apache.hc.core5.util.Timeout timeout, java.lang.Object attachment, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.reactor.IOSession> callback)protected <T> java.util.concurrent.Future<T>doExecute(org.apache.hc.core5.http.HttpHost httpHost, org.apache.hc.core5.http.nio.AsyncRequestProducer requestProducer, org.apache.hc.core5.http.nio.AsyncResponseConsumer<T> responseConsumer, org.apache.hc.core5.http.nio.HandlerFactory<org.apache.hc.core5.http.nio.AsyncPushConsumer> pushHandlerFactory, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<T> callback)org.apache.hc.core5.concurrent.Cancellableexecute(org.apache.hc.core5.http.nio.AsyncClientExchangeHandler exchangeHandler)org.apache.hc.core5.concurrent.Cancellableexecute(org.apache.hc.core5.http.nio.AsyncClientExchangeHandler exchangeHandler, org.apache.hc.core5.http.nio.HandlerFactory<org.apache.hc.core5.http.nio.AsyncPushConsumer> pushHandlerFactory, org.apache.hc.core5.http.protocol.HttpContext context)org.apache.hc.core5.reactor.IOReactorStatusgetStatus()voidinitiateShutdown()java.util.concurrent.Future<org.apache.hc.core5.http.nio.AsyncClientEndpoint>lease(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.http.nio.AsyncClientEndpoint> callback)java.util.concurrent.Future<org.apache.hc.core5.http.nio.AsyncClientEndpoint>lease(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.http.nio.AsyncClientEndpoint> callback)voidregister(java.lang.String hostname, java.lang.String uriPattern, org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncPushConsumer> supplier)Deprecated.UseRequestRouterat the construction timevoidstart()
-
-
-
Method Detail
-
lease
public java.util.concurrent.Future<org.apache.hc.core5.http.nio.AsyncClientEndpoint> lease(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.http.nio.AsyncClientEndpoint> callback)
-
lease
public java.util.concurrent.Future<org.apache.hc.core5.http.nio.AsyncClientEndpoint> lease(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.http.nio.AsyncClientEndpoint> callback)
-
execute
public org.apache.hc.core5.concurrent.Cancellable execute(org.apache.hc.core5.http.nio.AsyncClientExchangeHandler exchangeHandler, org.apache.hc.core5.http.nio.HandlerFactory<org.apache.hc.core5.http.nio.AsyncPushConsumer> pushHandlerFactory, org.apache.hc.core5.http.protocol.HttpContext context)
-
doExecute
protected <T> java.util.concurrent.Future<T> doExecute(org.apache.hc.core5.http.HttpHost httpHost, org.apache.hc.core5.http.nio.AsyncRequestProducer requestProducer, org.apache.hc.core5.http.nio.AsyncResponseConsumer<T> responseConsumer, org.apache.hc.core5.http.nio.HandlerFactory<org.apache.hc.core5.http.nio.AsyncPushConsumer> pushHandlerFactory, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<T> callback)- Specified by:
doExecutein classCloseableHttpAsyncClient
-
execute
public final org.apache.hc.core5.concurrent.Cancellable execute(org.apache.hc.core5.http.nio.AsyncClientExchangeHandler exchangeHandler)
-
start
public final void start()
- Specified by:
startin classCloseableHttpAsyncClient
-
register
@Deprecated public void register(java.lang.String hostname, java.lang.String uriPattern, org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncPushConsumer> supplier)Deprecated.UseRequestRouterat the construction time- Specified by:
registerin classCloseableHttpAsyncClient
-
connect
public java.util.concurrent.Future<org.apache.hc.core5.reactor.IOSession> connect(org.apache.hc.core5.net.NamedEndpoint remoteEndpoint, java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, org.apache.hc.core5.util.Timeout timeout, java.lang.Object attachment, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.reactor.IOSession> callback)- Specified by:
connectin interfaceorg.apache.hc.core5.reactor.ConnectionInitiator
-
getStatus
public final org.apache.hc.core5.reactor.IOReactorStatus getStatus()
- Specified by:
getStatusin classCloseableHttpAsyncClient
-
awaitShutdown
public final void awaitShutdown(org.apache.hc.core5.util.TimeValue waitTime) throws java.lang.InterruptedException- Specified by:
awaitShutdownin classCloseableHttpAsyncClient- Throws:
java.lang.InterruptedException
-
initiateShutdown
public final void initiateShutdown()
- Specified by:
initiateShutdownin classCloseableHttpAsyncClient
-
close
public final void close(org.apache.hc.core5.io.CloseMode closeMode)
- Specified by:
closein interfaceorg.apache.hc.core5.io.ModalCloseable
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-