ResponseT
- Initial response type of event stream operation.EventT
- Base type of event stream message frames.public class RestEventStreamAsyncResponseTransformer<ResponseT extends SdkResponse,EventT> extends Object implements AsyncResponseTransformer<ResponseT,Void>
AsyncResponseTransformer
to decode event stream messages for Rest services
and deliver them to the subscriber.Modifier and Type | Class and Description |
---|---|
static class |
RestEventStreamAsyncResponseTransformer.Builder<ResponseT extends SdkResponse,EventT>
Builder for
RestEventStreamAsyncResponseTransformer . |
Modifier and Type | Method and Description |
---|---|
static <ResponseT extends SdkResponse,EventT> |
builder() |
void |
exceptionOccurred(Throwable throwable)
Called when a 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.
|
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<ResponseT extends SdkResponse,Void>
public void onResponse(ResponseT response)
AsyncResponseTransformer
onResponse
in interface AsyncResponseTransformer<ResponseT extends SdkResponse,Void>
response
- The unmarshalled response.public void onStream(SdkPublisher<ByteBuffer> publisher)
AsyncResponseTransformer
onStream
in interface AsyncResponseTransformer<ResponseT extends SdkResponse,Void>
publisher
- The publisher.public void exceptionOccurred(Throwable throwable)
AsyncResponseTransformer
exceptionOccurred
in interface AsyncResponseTransformer<ResponseT extends SdkResponse,Void>
throwable
- Error that occurred.public static <ResponseT extends SdkResponse,EventT> RestEventStreamAsyncResponseTransformer.Builder<ResponseT,EventT> builder()
Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.