ResponseT - Pojo response type.public final class PublisherAsyncResponseTransformer<ResponseT extends SdkResponse> extends Object implements AsyncResponseTransformer<ResponseT,ResponsePublisher<ResponseT>>
AsyncResponseTransformer.toPublisher()| Constructor and Description |
|---|
PublisherAsyncResponseTransformer() |
| Modifier and Type | Method and Description |
|---|---|
void |
exceptionOccurred(Throwable error)
Called when an error is encountered while making the request or receiving the response.
|
void |
onResponse(ResponseT response)
Called when the unmarshalled response object is ready.
|
void |
onStream(SdkPublisher<ByteBuffer> publisher)
Called when the response stream is ready.
|
CompletableFuture<ResponsePublisher<ResponseT>> |
prepare()
Initial call to enable any setup required before the response is handled.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoBytes, toFile, toFile, toPublisherpublic CompletableFuture<ResponsePublisher<ResponseT>> prepare()
AsyncResponseTransformer
Note that this will be called for each request attempt, up to the number of retries allowed by the configured RetryPolicy.
This method is guaranteed to be called before the request is executed, and before AsyncResponseTransformer.onResponse(Object) is
signaled.
prepare in interface AsyncResponseTransformer<ResponseT extends SdkResponse,ResponsePublisher<ResponseT extends SdkResponse>>public void onResponse(ResponseT response)
AsyncResponseTransformeronResponse in interface AsyncResponseTransformer<ResponseT extends SdkResponse,ResponsePublisher<ResponseT extends SdkResponse>>response - The unmarshalled response.public void onStream(SdkPublisher<ByteBuffer> publisher)
AsyncResponseTransformeronStream in interface AsyncResponseTransformer<ResponseT extends SdkResponse,ResponsePublisher<ResponseT extends SdkResponse>>publisher - The publisher.public void exceptionOccurred(Throwable error)
AsyncResponseTransformerexceptionOccurred in interface AsyncResponseTransformer<ResponseT extends SdkResponse,ResponsePublisher<ResponseT extends SdkResponse>>error - Error that occurred.Copyright © 2022. All rights reserved.