Class ByteArrayAsyncResponseTransformer<ResponseT>
java.lang.Object
software.amazon.awssdk.core.internal.async.ByteArrayAsyncResponseTransformer<ResponseT>
- Type Parameters:
ResponseT- Pojo response type.
- All Implemented Interfaces:
AsyncResponseTransformer<ResponseT,ResponseBytes<ResponseT>>
public final class ByteArrayAsyncResponseTransformer<ResponseT>
extends Object
implements AsyncResponseTransformer<ResponseT,ResponseBytes<ResponseT>>
Implementation of
AsyncResponseTransformer that dumps content into a byte array and supports further
conversions into types, like strings.
This can be created with static methods on AsyncResponseTransformer.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface software.amazon.awssdk.core.async.AsyncResponseTransformer
AsyncResponseTransformer.SplitResult<ResponseT,ResultT>, AsyncResponseTransformer.TransformerType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexceptionOccurred(Throwable throwable) Called when an error is encountered while making the request or receiving the response.name()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.prepare()Initial call to enable any setup required before the response is handled.split(SplittingTransformerConfiguration splitConfig) Creates anAsyncResponseTransformer.SplitResultwhich contains anSplittingTransformerthat splits theAsyncResponseTransformerinto multiple ones, publishing them as aSdkPublisher.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.awssdk.core.async.AsyncResponseTransformer
split
-
Constructor Details
-
ByteArrayAsyncResponseTransformer
public ByteArrayAsyncResponseTransformer()
-
-
Method Details
-
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,ResponseBytes<ResponseT>> - Returns:
- The future holding the transformed response.
-
onResponse
Description copied from interface:AsyncResponseTransformerCalled when the unmarshalled response object is ready.- Specified by:
onResponsein interfaceAsyncResponseTransformer<ResponseT,ResponseBytes<ResponseT>> - Parameters:
response- The unmarshalled response.
-
onStream
Description copied from interface:AsyncResponseTransformerCalled when the response stream is ready.- Specified by:
onStreamin interfaceAsyncResponseTransformer<ResponseT,ResponseBytes<ResponseT>> - Parameters:
publisher- The publisher.
-
exceptionOccurred
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,ResponseBytes<ResponseT>> - Parameters:
throwable- Error that occurred.
-
split
public AsyncResponseTransformer.SplitResult<ResponseT,ResponseBytes<ResponseT>> split(SplittingTransformerConfiguration splitConfig) Description copied from interface:AsyncResponseTransformerCreates anAsyncResponseTransformer.SplitResultwhich contains anSplittingTransformerthat splits theAsyncResponseTransformerinto multiple ones, publishing them as aSdkPublisher.- Specified by:
splitin interfaceAsyncResponseTransformer<ResponseT,ResponseBytes<ResponseT>> - Parameters:
splitConfig- configuration for the split transformer- Returns:
- SplitAsyncResponseTransformer instance.
- See Also:
-
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,ResponseBytes<ResponseT>> - Returns:
- String containing the identifying name of this AsyncRequestTransformer.
-