Class CrtResponseFileResponseTransformer<ResponseT>
java.lang.Object
software.amazon.awssdk.services.s3.internal.crt.CrtResponseFileResponseTransformer<ResponseT>
- Type Parameters:
ResponseT
- Pojo response type.
- All Implemented Interfaces:
AsyncResponseTransformer<ResponseT,
ResponseT>
public final class CrtResponseFileResponseTransformer<ResponseT>
extends Object
implements AsyncResponseTransformer<ResponseT,ResponseT>
When the CRT Response File option is used in a request, the body is streamed directly to the file.
The S3CrtResponseHandlerAdapter in this case will never receive a response body but will call onStream
when the request is complete with a publisher that will complete immediately.
This transformer is effectively a no-op transformer that waits for the stream to complete and then
completes the future with the response.
-
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 TypeMethodDescriptionvoid
exceptionOccurred
(Throwable throwable) 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.prepare()
Initial call to enable any setup required before the response is handled.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.awssdk.core.async.AsyncResponseTransformer
name, split, split
-
Constructor Details
-
CrtResponseFileResponseTransformer
public CrtResponseFileResponseTransformer()
-
-
Method Details
-
prepare
Description copied from interface:AsyncResponseTransformer
Initial 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:
prepare
in interfaceAsyncResponseTransformer<ResponseT,
ResponseT> - Returns:
- The future holding the transformed response.
-
onResponse
Description copied from interface:AsyncResponseTransformer
Called when the unmarshalled response object is ready.- Specified by:
onResponse
in interfaceAsyncResponseTransformer<ResponseT,
ResponseT> - Parameters:
response
- The unmarshalled response.
-
onStream
Description copied from interface:AsyncResponseTransformer
Called when the response stream is ready.- Specified by:
onStream
in interfaceAsyncResponseTransformer<ResponseT,
ResponseT> - Parameters:
publisher
- The publisher.
-
exceptionOccurred
Description copied from interface:AsyncResponseTransformer
Called 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:
exceptionOccurred
in interfaceAsyncResponseTransformer<ResponseT,
ResponseT> - Parameters:
throwable
- Error that occurred.
-