Class AsyncCachingExec.BackendResponseHandler
- java.lang.Object
-
- org.apache.hc.client5.http.impl.cache.AsyncCachingExec.BackendResponseHandler
-
- All Implemented Interfaces:
AsyncExecCallback
- Enclosing class:
- AsyncCachingExec
class AsyncCachingExec.BackendResponseHandler extends java.lang.Object implements AsyncExecCallback
-
-
Field Summary
Fields Modifier and Type Field Description private AsyncExecCallback
asyncExecCallback
private java.util.concurrent.atomic.AtomicReference<AsyncCachingExec.CachingAsyncDataConsumer>
cachingConsumerRef
private org.apache.hc.core5.http.HttpRequest
request
private java.time.Instant
requestDate
private java.time.Instant
responseDate
private AsyncExecChain.Scope
scope
private org.apache.hc.core5.http.HttpHost
target
-
Constructor Summary
Constructors Constructor Description BackendResponseHandler(org.apache.hc.core5.http.HttpHost target, org.apache.hc.core5.http.HttpRequest request, java.time.Instant requestDate, java.time.Instant responseDate, AsyncExecChain.Scope scope, AsyncExecCallback asyncExecCallback)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
completed()
Triggered to signal completion of the message exchange.void
failed(java.lang.Exception cause)
Triggered to signal a failure occurred during the message exchange.void
handleInformationResponse(org.apache.hc.core5.http.HttpResponse response)
Triggered to signal receipt of an intermediate response message.org.apache.hc.core5.http.nio.AsyncDataConsumer
handleResponse(org.apache.hc.core5.http.HttpResponse backendResponse, org.apache.hc.core5.http.EntityDetails entityDetails)
Triggered to signal receipt of a response message head sent by the server in response to the request being executed.(package private) void
triggerNewCacheEntryResponse(org.apache.hc.core5.http.HttpResponse backendResponse, java.time.Instant responseDate, org.apache.hc.core5.util.ByteArrayBuffer buffer)
-
-
-
Field Detail
-
target
private final org.apache.hc.core5.http.HttpHost target
-
request
private final org.apache.hc.core5.http.HttpRequest request
-
requestDate
private final java.time.Instant requestDate
-
responseDate
private final java.time.Instant responseDate
-
scope
private final AsyncExecChain.Scope scope
-
asyncExecCallback
private final AsyncExecCallback asyncExecCallback
-
cachingConsumerRef
private final java.util.concurrent.atomic.AtomicReference<AsyncCachingExec.CachingAsyncDataConsumer> cachingConsumerRef
-
-
Constructor Detail
-
BackendResponseHandler
BackendResponseHandler(org.apache.hc.core5.http.HttpHost target, org.apache.hc.core5.http.HttpRequest request, java.time.Instant requestDate, java.time.Instant responseDate, AsyncExecChain.Scope scope, AsyncExecCallback asyncExecCallback)
-
-
Method Detail
-
handleResponse
public org.apache.hc.core5.http.nio.AsyncDataConsumer handleResponse(org.apache.hc.core5.http.HttpResponse backendResponse, org.apache.hc.core5.http.EntityDetails entityDetails) throws org.apache.hc.core5.http.HttpException, java.io.IOException
Description copied from interface:AsyncExecCallback
Triggered to signal receipt of a response message head sent by the server in response to the request being executed.- Specified by:
handleResponse
in interfaceAsyncExecCallback
- Parameters:
backendResponse
- the response message head.entityDetails
- the response entity details ornull
if the response does not enclose an entity.- Returns:
- the data consumer to be used for processing of incoming response message body.
- Throws:
org.apache.hc.core5.http.HttpException
java.io.IOException
-
handleInformationResponse
public void handleInformationResponse(org.apache.hc.core5.http.HttpResponse response) throws org.apache.hc.core5.http.HttpException, java.io.IOException
Description copied from interface:AsyncExecCallback
Triggered to signal receipt of an intermediate response message.- Specified by:
handleInformationResponse
in interfaceAsyncExecCallback
- Parameters:
response
- the intermediate response message.- Throws:
org.apache.hc.core5.http.HttpException
java.io.IOException
-
triggerNewCacheEntryResponse
void triggerNewCacheEntryResponse(org.apache.hc.core5.http.HttpResponse backendResponse, java.time.Instant responseDate, org.apache.hc.core5.util.ByteArrayBuffer buffer)
-
completed
public void completed()
Description copied from interface:AsyncExecCallback
Triggered to signal completion of the message exchange.Implementations of this message are expected to perform resource deallocation allocated in the course of the request execution and response processing.
- Specified by:
completed
in interfaceAsyncExecCallback
-
failed
public void failed(java.lang.Exception cause)
Description copied from interface:AsyncExecCallback
Triggered to signal a failure occurred during the message exchange.Implementations of this message are expected to perform resource deallocation allocated in the course of the request execution and response processing.
- Specified by:
failed
in interfaceAsyncExecCallback
-
-