@Deprecated public abstract class AbstractHttpAsyncClient extends Object implements HttpAsyncClient
Modifier | Constructor and Description |
---|---|
protected |
AbstractHttpAsyncClient(ClientAsyncConnectionManager connmgr)
Deprecated.
|
protected |
AbstractHttpAsyncClient(org.apache.http.impl.nio.reactor.IOReactorConfig config)
Deprecated.
|
protected AbstractHttpAsyncClient(ClientAsyncConnectionManager connmgr)
protected AbstractHttpAsyncClient(org.apache.http.impl.nio.reactor.IOReactorConfig config) throws org.apache.http.nio.reactor.IOReactorException
protected abstract HttpParams createHttpParams()
protected abstract BasicHttpProcessor createHttpProcessor()
protected HttpContext createHttpContext()
protected ConnectionReuseStrategy createConnectionReuseStrategy()
protected ConnectionKeepAliveStrategy createConnectionKeepAliveStrategy()
protected AuthSchemeRegistry createAuthSchemeRegistry()
protected CookieSpecRegistry createCookieSpecRegistry()
protected AuthenticationStrategy createTargetAuthenticationStrategy()
protected AuthenticationStrategy createProxyAuthenticationStrategy()
protected CookieStore createCookieStore()
protected CredentialsProvider createCredentialsProvider()
protected HttpRoutePlanner createHttpRoutePlanner()
protected UserTokenHandler createUserTokenHandler()
public final HttpParams getParams()
public void setParams(HttpParams params)
public ClientAsyncConnectionManager getConnectionManager()
public final ConnectionReuseStrategy getConnectionReuseStrategy()
public void setReuseStrategy(ConnectionReuseStrategy reuseStrategy)
public final ConnectionKeepAliveStrategy getConnectionKeepAliveStrategy()
public void setKeepAliveStrategy(ConnectionKeepAliveStrategy keepAliveStrategy)
public final RedirectStrategy getRedirectStrategy()
public void setRedirectStrategy(RedirectStrategy redirectStrategy)
public final AuthSchemeRegistry getAuthSchemes()
public void setAuthSchemes(AuthSchemeRegistry authSchemeRegistry)
public final CookieSpecRegistry getCookieSpecs()
public void setCookieSpecs(CookieSpecRegistry cookieSpecRegistry)
public final AuthenticationStrategy getTargetAuthenticationStrategy()
public void setTargetAuthenticationStrategy(AuthenticationStrategy targetAuthStrategy)
public final AuthenticationStrategy getProxyAuthenticationStrategy()
public void setProxyAuthenticationStrategy(AuthenticationStrategy proxyAuthStrategy)
public final CookieStore getCookieStore()
public void setCookieStore(CookieStore cookieStore)
public final CredentialsProvider getCredentialsProvider()
public void setCredentialsProvider(CredentialsProvider credsProvider)
public final HttpRoutePlanner getRoutePlanner()
public void setRoutePlanner(HttpRoutePlanner routePlanner)
public final UserTokenHandler getUserTokenHandler()
public void setUserTokenHandler(UserTokenHandler userTokenHandler)
protected final BasicHttpProcessor getHttpProcessor()
public int getResponseInterceptorCount()
public HttpResponseInterceptor getResponseInterceptor(int index)
public HttpRequestInterceptor getRequestInterceptor(int index)
public int getRequestInterceptorCount()
public void addResponseInterceptor(HttpResponseInterceptor itcp)
public void addResponseInterceptor(HttpResponseInterceptor itcp, int index)
public void clearResponseInterceptors()
public void removeResponseInterceptorByClass(Class<? extends HttpResponseInterceptor> clazz)
public void addRequestInterceptor(HttpRequestInterceptor itcp)
public void addRequestInterceptor(HttpRequestInterceptor itcp, int index)
public void clearRequestInterceptors()
public void removeRequestInterceptorByClass(Class<? extends HttpRequestInterceptor> clazz)
public org.apache.http.nio.reactor.IOReactorStatus getStatus()
public void start()
public void shutdown() throws InterruptedException
InterruptedException
public <T> Future<T> execute(org.apache.http.nio.protocol.HttpAsyncRequestProducer requestProducer, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> responseConsumer, HttpContext context, FutureCallback<T> callback)
HttpAsyncClient
The request producer passed to this method will be used to generate a request message and stream out its content without buffering it in memory. The response consumer passed to this method will be used to process a response message without buffering its content in memory.
Please note it may be unsafe to interact with the context instance while the request is still being executed.
execute
in interface HttpAsyncClient
T
- the result type of request execution.requestProducer
- request producer callback.responseConsumer
- response consumer callaback.context
- HTTP contextcallback
- future callback.public <T> Future<T> execute(org.apache.http.nio.protocol.HttpAsyncRequestProducer requestProducer, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> responseConsumer, FutureCallback<T> callback)
HttpAsyncClient
The request producer passed to this method will be used to generate a request message and stream out its content without buffering it in memory. The response consumer passed to this method will be used to process a response message without buffering its content in memory.
execute
in interface HttpAsyncClient
T
- the result type of request execution.requestProducer
- request producer callback.responseConsumer
- response consumer callaback.callback
- future callback.public Future<HttpResponse> execute(HttpHost target, HttpRequest request, HttpContext context, FutureCallback<HttpResponse> callback)
HttpAsyncClient
Please note it may be unsafe to interact with the context instance while the request is still being executed.
execute
in interface HttpAsyncClient
target
- the target host for the request.
Implementations may accept null
if they can still determine a route, for example
to a default target or by inspecting the request.request
- the request to executecontext
- the context to use for the execution, or
null
to use the default contextcallback
- future callback.public Future<HttpResponse> execute(HttpHost target, HttpRequest request, FutureCallback<HttpResponse> callback)
HttpAsyncClient
execute
in interface HttpAsyncClient
target
- the target host for the request.
Implementations may accept null
if they can still determine a route, for example
to a default target or by inspecting the request.request
- the request to executecallback
- future callback.public Future<HttpResponse> execute(HttpUriRequest request, FutureCallback<HttpResponse> callback)
HttpAsyncClient
execute
in interface HttpAsyncClient
request
- the request to executecallback
- future callback.public Future<HttpResponse> execute(HttpUriRequest request, HttpContext context, FutureCallback<HttpResponse> callback)
HttpAsyncClient
Please note it may be unsafe to interact with the context instance while the request is still being executed.
execute
in interface HttpAsyncClient
request
- the request to executecontext
- HTTP contextcallback
- future callback.Copyright © 2010–2021 The Apache Software Foundation. All rights reserved.