ResponseT
- Initial response type of event stream operation.EventT
- Base type of event stream message frames.public class EventStreamAsyncResponseTransformer<ResponseT,EventT> extends Object implements AsyncResponseTransformer<SdkResponse,Void>
AsyncResponseTransformer
to decode event stream messages and deliver them to the
subscriber.Modifier and Type | Class and Description |
---|---|
static class |
EventStreamAsyncResponseTransformer.Builder<ResponseT,EventT>
Builder for
EventStreamAsyncResponseTransformer . |
Modifier and Type | Method and Description |
---|---|
static <ResponseT,EventT> |
builder()
Creates a
EventStreamAsyncResponseTransformer.Builder used to create EventStreamAsyncResponseTransformer . |
void |
exceptionOccurred(Throwable throwable)
Called when a 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.
|
CompletableFuture<Void> |
prepare()
Initial call to enable any setup required before the response is handled.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
toBytes, toFile, toFile
public CompletableFuture<Void> 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<SdkResponse,Void>
public void onResponse(SdkResponse response)
AsyncResponseTransformer
onResponse
in interface AsyncResponseTransformer<SdkResponse,Void>
response
- The unmarshalled response.public void onStream(SdkPublisher<ByteBuffer> publisher)
AsyncResponseTransformer
onStream
in interface AsyncResponseTransformer<SdkResponse,Void>
publisher
- The publisher.public void exceptionOccurred(Throwable throwable)
AsyncResponseTransformer
exceptionOccurred
in interface AsyncResponseTransformer<SdkResponse,Void>
throwable
- Error that occurred.public static <ResponseT,EventT> EventStreamAsyncResponseTransformer.Builder<ResponseT,EventT> builder()
EventStreamAsyncResponseTransformer.Builder
used to create EventStreamAsyncResponseTransformer
.ResponseT
- Initial response type.EventT
- Event type being delivered.EventStreamAsyncResponseTransformer.Builder
instance.Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.