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(software.amazon.awssdk.http.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(org.reactivestreams.Publisher<ByteBuffer> 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)
onHeaders in interface SdkAsyncHttpResponseHandlerpublic void onStream(org.reactivestreams.Publisher<ByteBuffer> publisher)
onStream in interface SdkAsyncHttpResponseHandlerpublic void onError(Throwable err)
onError in interface SdkAsyncHttpResponseHandlerpublic 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 © 2023. All rights reserved.