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

public final Class AsyncProtocolExec

extends Object
implements AsyncExecChainHandler
Class Inheritance
All Implemented Interfaces
org.apache.hc.client5.http.async.AsyncExecChainHandler
Annotations
@Contract
threading:STATELESS
@Internal
Imports
java.io.IOException, java.util.Iterator, java.util.concurrent.atomic.AtomicBoolean, org.apache.hc.client5.http.AuthenticationStrategy, .HttpRoute, .SchemePortResolver, org.apache.hc.client5.http.async.AsyncExecCallback, .AsyncExecChain, .AsyncExecChainHandler, .AsyncExecRuntime, org.apache.hc.client5.http.auth.AuthExchange, .ChallengeType, org.apache.hc.client5.http.config.RequestConfig, org.apache.hc.client5.http.impl.DefaultSchemePortResolver, .RequestSupport, org.apache.hc.client5.http.impl.auth.AuthCacheKeeper, .HttpAuthenticator, org.apache.hc.client5.http.protocol.HttpClientContext, org.apache.hc.core5.annotation.Contract, .Internal, .ThreadingBehavior, org.apache.hc.core5.http.EntityDetails, .Header, .HttpException, .HttpHeaders, .HttpHost, .HttpRequest, .HttpResponse, .Method, .ProtocolException, org.apache.hc.core5.http.nio.AsyncDataConsumer, .AsyncEntityProducer, org.apache.hc.core5.http.support.BasicRequestBuilder, org.apache.hc.core5.net.URIAuthority, org.apache.hc.core5.util.Args, org.slf4j.Logger, .LoggerFactory

Request execution handler in the asynchronous request execution chain that is responsible for implementation of HTTP specification requirements.

Further responsibilities such as communication with the opposite endpoint is delegated to the next executor in the request execution chain.

Since
5.0

Field Summary

Modifier and TypeField and Description
private final AuthCacheKeeper
private final HttpAuthenticator
private static final Logger
private final AuthenticationStrategy
private final SchemePortResolver
private final AuthenticationStrategy

Constructor Summary

AccessConstructor and Description
pack-priv
AsyncProtocolExec(final AuthenticationStrategy targetAuthStrategy, final AuthenticationStrategy proxyAuthStrategy, final SchemePortResolver schemePortResolver, final boolean authCachingDisabled)

Method Summary

Modifier and TypeMethod and Description
public void
execute(final HttpRequest
the actual request.
userRequest
,
final AsyncEntityProducer
the request entity producer or null if the request does not enclose an entity.
entityProducer
,
final AsyncExecChain.Scope
the execution scope .
scope
,
final AsyncExecChain
the next element in the request execution chain.
chain
,
final AsyncExecCallback
the execution callback.
asyncExecCallback
)

Implements org.apache.hc.client5.http.async.AsyncExecChainHandler.execute.

Executes the actual HTTP request.
private void
internalExecute(final HttpHost target, final String pathPrefix, final AuthExchange targetAuthExchange, final AuthExchange proxyAuthExchange, final AtomicBoolean challenged, final HttpRequest request, final AsyncEntityProducer entityProducer, final AsyncExecChain.Scope scope, final AsyncExecChain chain, final AsyncExecCallback asyncExecCallback)

private boolean
needAuthentication(final AuthExchange targetAuthExchange, final AuthExchange proxyAuthExchange, final HttpHost proxy, final HttpHost target, final String pathPrefix, final HttpResponse response, final HttpClientContext context)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

authCacheKeeperback to summary
private final AuthCacheKeeper authCacheKeeper
authenticatorback to summary
private final HttpAuthenticator authenticator
LOGback to summary
private static final Logger LOG
proxyAuthStrategyback to summary
private final AuthenticationStrategy proxyAuthStrategy
schemePortResolverback to summary
private final SchemePortResolver schemePortResolver
targetAuthStrategyback to summary
private final AuthenticationStrategy targetAuthStrategy

Constructor Detail

AsyncProtocolExecback to summary
pack-priv AsyncProtocolExec(final AuthenticationStrategy targetAuthStrategy, final AuthenticationStrategy proxyAuthStrategy, final SchemePortResolver schemePortResolver, final boolean authCachingDisabled)

Method Detail

executeback to summary
public void execute(final HttpRequest userRequest, final AsyncEntityProducer entityProducer, final AsyncExecChain.Scope scope, final AsyncExecChain chain, final AsyncExecCallback asyncExecCallback) throws HttpException, IOException

Implements org.apache.hc.client5.http.async.AsyncExecChainHandler.execute.

Doc from org.apache.hc.client5.http.async.AsyncExecChainHandler.execute.

Executes the actual HTTP request. The handler can choose to return a response message immediately inside the call or asynchronously at some later point or delegate request execution to the next element in the execution chain.

Parameters
userRequest:HttpRequest

the actual request.

entityProducer:AsyncEntityProducer

the request entity producer or null if the request does not enclose an entity.

scope:AsyncExecChain.Scope

the execution scope .

chain:AsyncExecChain

the next element in the request execution chain.

asyncExecCallback:AsyncExecCallback

the execution callback.

Annotations
@Override
internalExecuteback to summary
private void internalExecute(final HttpHost target, final String pathPrefix, final AuthExchange targetAuthExchange, final AuthExchange proxyAuthExchange, final AtomicBoolean challenged, final HttpRequest request, final AsyncEntityProducer entityProducer, final AsyncExecChain.Scope scope, final AsyncExecChain chain, final AsyncExecCallback asyncExecCallback) throws HttpException, IOException
needAuthenticationback to summary
private boolean needAuthentication(final AuthExchange targetAuthExchange, final AuthExchange proxyAuthExchange, final HttpHost proxy, final HttpHost target, final String pathPrefix, final HttpResponse response, final HttpClientContext context)