Class CombinedResponseAsyncHttpResponseHandler<OutputT>
- java.lang.Object
-
- software.amazon.awssdk.core.internal.http.async.CombinedResponseAsyncHttpResponseHandler<OutputT>
-
- All Implemented Interfaces:
TransformingAsyncResponseHandler<Response<OutputT>>,SdkAsyncHttpResponseHandler
public final class CombinedResponseAsyncHttpResponseHandler<OutputT> extends Object implements TransformingAsyncResponseHandler<Response<OutputT>>
Detects whether the response succeeded or failed by just checking the HTTP status and delegates to appropriate async response handler. Can be used with streaming or non-streaming requests.
-
-
Constructor Summary
Constructors Constructor Description CombinedResponseAsyncHttpResponseHandler(TransformingAsyncResponseHandler<OutputT> successResponseHandler, TransformingAsyncResponseHandler<? extends SdkException> errorResponseHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonError(Throwable error)voidonHeaders(SdkHttpResponse response)voidonStream(org.reactivestreams.Publisher<ByteBuffer> publisher)CompletableFuture<Response<OutputT>>prepare()Return the future holding the transformed response.
-
-
-
Constructor Detail
-
CombinedResponseAsyncHttpResponseHandler
public CombinedResponseAsyncHttpResponseHandler(TransformingAsyncResponseHandler<OutputT> successResponseHandler, TransformingAsyncResponseHandler<? extends SdkException> errorResponseHandler)
-
-
Method Detail
-
onHeaders
public void onHeaders(SdkHttpResponse response)
- Specified by:
onHeadersin interfaceSdkAsyncHttpResponseHandler
-
onError
public void onError(Throwable error)
- Specified by:
onErrorin interfaceSdkAsyncHttpResponseHandler
-
onStream
public void onStream(org.reactivestreams.Publisher<ByteBuffer> publisher)
- Specified by:
onStreamin interfaceSdkAsyncHttpResponseHandler
-
prepare
public CompletableFuture<Response<OutputT>> prepare()
Description copied from interface:TransformingAsyncResponseHandlerReturn the future holding the transformed response.This method is guaranteed to be called before the request is executed, and before
SdkAsyncHttpResponseHandler.onHeaders(software.amazon.awssdk.http.SdkHttpResponse)is signaled.- Specified by:
preparein interfaceTransformingAsyncResponseHandler<OutputT>- Returns:
- The future holding the transformed response.
-
-