Class EventStreamAsyncResponseTransformer<ResponseT,EventT>
java.lang.Object
software.amazon.awssdk.awscore.eventstream.EventStreamAsyncResponseTransformer<ResponseT,EventT>
- Type Parameters:
ResponseT
- Initial response type of event stream operation.EventT
- Base type of event stream message frames.
- All Implemented Interfaces:
AsyncResponseTransformer<SdkResponse,
Void>
public final class EventStreamAsyncResponseTransformer<ResponseT,EventT>
extends Object
implements AsyncResponseTransformer<SdkResponse,Void>
Unmarshalling layer on top of the
AsyncResponseTransformer
to decode event stream messages and deliver them to the
subscriber.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builder forEventStreamAsyncResponseTransformer
.Nested classes/interfaces inherited from interface software.amazon.awssdk.core.async.AsyncResponseTransformer
AsyncResponseTransformer.SplitResult<ResponseT,
ResultT>, AsyncResponseTransformer.TransformerType -
Method Summary
Modifier and TypeMethodDescriptionstatic <ResponseT,
EventT>
EventStreamAsyncResponseTransformer.Builder<ResponseT, EventT> builder()
Creates aEventStreamAsyncResponseTransformer.Builder
used to createEventStreamAsyncResponseTransformer
.void
exceptionOccurred
(Throwable throwable) Called when an error is encountered while making the request or receiving the response.void
onResponse
(SdkResponse 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
-
Method Details
-
builder
public static <ResponseT,EventT> EventStreamAsyncResponseTransformer.Builder<ResponseT,EventT> builder()Creates aEventStreamAsyncResponseTransformer.Builder
used to createEventStreamAsyncResponseTransformer
.- Type Parameters:
ResponseT
- Initial response type.EventT
- Event type being delivered.- Returns:
- New
EventStreamAsyncResponseTransformer.Builder
instance.
-
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,
EventT> - 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,
EventT> - Parameters:
response
- The unmarshalled response.
-
onStream
Description copied from interface:AsyncResponseTransformer
Called when the response stream is ready.- Specified by:
onStream
in interfaceAsyncResponseTransformer<ResponseT,
EventT> - 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,
EventT> - Parameters:
throwable
- Error that occurred.
-