public final class CombinedResponseAsyncHttpResponseHandler<OutputT> extends Object implements TransformingAsyncResponseHandler<Response<OutputT>>
| Constructor and Description |
|---|
CombinedResponseAsyncHttpResponseHandler(TransformingAsyncResponseHandler<OutputT> successResponseHandler,
TransformingAsyncResponseHandler<? extends SdkException> errorResponseHandler) |
| Modifier and Type | Method and Description |
|---|---|
void |
onError(Throwable error)
Called when there is an error making the request or receiving the response.
|
void |
onHeaders(SdkHttpResponse response)
Called when the headers have been received.
|
void |
onStream(org.reactivestreams.Publisher<ByteBuffer> publisher)
Called when the streaming body is ready.
|
CompletableFuture<Response<OutputT>> |
prepare()
Return the future holding the transformed response.
|
public CombinedResponseAsyncHttpResponseHandler(TransformingAsyncResponseHandler<OutputT> successResponseHandler, TransformingAsyncResponseHandler<? extends SdkException> errorResponseHandler)
public void onHeaders(SdkHttpResponse response)
SdkAsyncHttpResponseHandleronHeaders in interface SdkAsyncHttpResponseHandlerresponse - The headers.public void onError(Throwable error)
SdkAsyncHttpResponseHandlerSubscriber.onError in interface SdkAsyncHttpResponseHandlererror - The error.public void onStream(org.reactivestreams.Publisher<ByteBuffer> publisher)
SdkAsyncHttpResponseHandlerThis method is always called. If the response does not have a body, then the publisher will complete the subscription without signalling any elements.
onStream in interface SdkAsyncHttpResponseHandlerpublisher - The streaming body.public CompletableFuture<Response<OutputT>> prepare()
TransformingAsyncResponseHandler
This method is guaranteed to be called before the request is executed, and before SdkAsyncHttpResponseHandler.onHeaders(com.ibm.cos.v2.http.SdkHttpResponse) is signaled.
prepare in interface TransformingAsyncResponseHandler<Response<OutputT>>Copyright © 2026. All rights reserved.