Class PublisherAsyncResponseTransformer<ResponseT extends SdkResponse>
- java.lang.Object
-
- software.amazon.awssdk.core.internal.async.PublisherAsyncResponseTransformer<ResponseT>
-
- Type Parameters:
ResponseT- Pojo response type.
- All Implemented Interfaces:
AsyncResponseTransformer<ResponseT,ResponsePublisher<ResponseT>>
@SdkInternalApi public final class PublisherAsyncResponseTransformer<ResponseT extends SdkResponse> extends Object implements AsyncResponseTransformer<ResponseT,ResponsePublisher<ResponseT>>
Transforms aPublisherAsyncResponseTransformerandByteBufferSdkPublisherinto aResponsePublisher.- See Also:
AsyncResponseTransformer.toPublisher()
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface software.amazon.awssdk.core.async.AsyncResponseTransformer
AsyncResponseTransformer.SplitResult<ResponseT,ResultT>, AsyncResponseTransformer.TransformerType
-
-
Constructor Summary
Constructors Constructor Description PublisherAsyncResponseTransformer()PublisherAsyncResponseTransformer(Duration timeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexceptionOccurred(Throwable error)Called when an error is encountered while making the request or receiving the response.Stringname()Each AsyncResponseTransformer should return a well-formed name that can be used to identify the implementation.voidonResponse(ResponseT response)Called when the unmarshalled response object is ready.voidonStream(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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.core.async.AsyncResponseTransformer
split, split
-
-
-
-
Constructor Detail
-
PublisherAsyncResponseTransformer
public PublisherAsyncResponseTransformer()
-
PublisherAsyncResponseTransformer
public PublisherAsyncResponseTransformer(Duration timeout)
-
-
Method Detail
-
prepare
public CompletableFuture<ResponsePublisher<ResponseT>> prepare()
Description copied from interface:AsyncResponseTransformerInitial call to enable any setup required before the response is handled.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.- Specified by:
preparein interfaceAsyncResponseTransformer<ResponseT extends SdkResponse,ResponsePublisher<ResponseT extends SdkResponse>>- Returns:
- The future holding the transformed response.
-
onResponse
public void onResponse(ResponseT response)
Description copied from interface:AsyncResponseTransformerCalled when the unmarshalled response object is ready.- Specified by:
onResponsein interfaceAsyncResponseTransformer<ResponseT extends SdkResponse,ResponsePublisher<ResponseT extends SdkResponse>>- Parameters:
response- The unmarshalled response.
-
onStream
public void onStream(SdkPublisher<ByteBuffer> publisher)
Description copied from interface:AsyncResponseTransformerCalled when the response stream is ready.- Specified by:
onStreamin interfaceAsyncResponseTransformer<ResponseT extends SdkResponse,ResponsePublisher<ResponseT extends SdkResponse>>- Parameters:
publisher- The publisher.
-
exceptionOccurred
public void exceptionOccurred(Throwable error)
Description copied from interface:AsyncResponseTransformerCalled when an error is encountered while making the request or receiving the response. Implementations should free up any resources in this method. This method may be called multiple times during the lifecycle of a request if automatic retries are enabled.- Specified by:
exceptionOccurredin interfaceAsyncResponseTransformer<ResponseT extends SdkResponse,ResponsePublisher<ResponseT extends SdkResponse>>- Parameters:
error- Error that occurred.
-
name
public String name()
Description copied from interface:AsyncResponseTransformerEach AsyncResponseTransformer should return a well-formed name that can be used to identify the implementation. The Transformer name should only include alphanumeric characters.- Specified by:
namein interfaceAsyncResponseTransformer<ResponseT extends SdkResponse,ResponsePublisher<ResponseT extends SdkResponse>>- Returns:
- String containing the identifying name of this AsyncRequestTransformer.
-
-