Class EarlyHintsAsyncExec
- java.lang.Object
-
- org.apache.hc.client5.http.impl.async.EarlyHintsAsyncExec
-
- All Implemented Interfaces:
AsyncExecChainHandler
public final class EarlyHintsAsyncExec extends java.lang.Object implements AsyncExecChainHandler
Execution chain handler that delivers103 Early Hintsinformational responses to a user-providedEarlyHintsListenerwithout affecting processing of the final (non-1xx) response.This handler forwards each
103informational response to the listener. All other responses (including the final response) are delegated unchanged.For security and interoperability, applications typically act only on headers considered safe in Early Hints (for example,
Linkwithrel=preloadorrel=preconnect).- Since:
- 5.6
- See Also:
EarlyHintsListener,HttpStatus.SC_EARLY_HINTS,ResponseChannel.sendInformation(org.apache.hc.core5.http.HttpResponse, org.apache.hc.core5.http.protocol.HttpContext)
-
-
Field Summary
Fields Modifier and Type Field Description private EarlyHintsListenerlistener
-
Constructor Summary
Constructors Constructor Description EarlyHintsAsyncExec(EarlyHintsListener listener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.nio.AsyncEntityProducer entityProducer, AsyncExecChain.Scope scope, AsyncExecChain chain, AsyncExecCallback callback)Executes the actual HTTP request.
-
-
-
Field Detail
-
listener
private final EarlyHintsListener listener
-
-
Constructor Detail
-
EarlyHintsAsyncExec
public EarlyHintsAsyncExec(EarlyHintsListener listener)
-
-
Method Detail
-
execute
public void execute(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.nio.AsyncEntityProducer entityProducer, AsyncExecChain.Scope scope, AsyncExecChain chain, AsyncExecCallback callback) throws org.apache.hc.core5.http.HttpException, java.io.IOExceptionDescription copied from interface:AsyncExecChainHandlerExecutes 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.- Specified by:
executein interfaceAsyncExecChainHandler- Parameters:
request- the actual request.entityProducer- the request entity producer ornullif the request does not enclose an entity.scope- the execution scope .chain- the next element in the request execution chain.callback- the execution callback.- Throws:
org.apache.hc.core5.http.HttpException- If a protocol error occurs.java.io.IOException- If an I/O error occurs.
-
-