T
- Type that the response handler produces.public final class AsyncResponseHandler<T> extends Object implements TransformingAsyncResponseHandler<T>
Adapts an HttpResponseHandler
to the asynchronous TransformingAsyncResponseHandler
. Buffers
all content into a ByteArrayInputStream
then invokes the HttpResponseHandler.handle(SdkHttpFullResponse, software.amazon.awssdk.core.interceptor.ExecutionAttributes)
method.
Constructor and Description |
---|
AsyncResponseHandler(HttpResponseHandler<T> responseHandler,
Function<SdkHttpFullResponse,SdkHttpFullResponse> crc32Validator,
ExecutionAttributes executionAttributes) |
Modifier and Type | Method and Description |
---|---|
void |
onError(Throwable err) |
void |
onHeaders(SdkHttpResponse response) |
void |
onStream(<any> publisher) |
CompletableFuture<T> |
prepare()
Return the future holding the transformed response.
|
public AsyncResponseHandler(HttpResponseHandler<T> responseHandler, Function<SdkHttpFullResponse,SdkHttpFullResponse> crc32Validator, ExecutionAttributes executionAttributes)
public void onHeaders(SdkHttpResponse response)
public void onStream(<any> publisher)
public void onError(Throwable err)
public CompletableFuture<T> prepare()
TransformingAsyncResponseHandler
This method is guaranteed to be called before the request is executed, and before SdkAsyncHttpResponseHandler#onHeaders(software.amazon.awssdk.http.SdkHttpResponse)
is signaled.
prepare
in interface TransformingAsyncResponseHandler<T>
Copyright © 2022. All rights reserved.