T - Type that the response handler produces.SdkHttpResponseHandler<T>public class SyncResponseHandlerAdapter<T> extends Object implements SdkHttpResponseHandler<T>
HttpResponseHandler to the asynchronous SdkHttpResponseHandler. Buffers
all content into a ByteArrayInputStream then invokes the HttpResponseHandler.handle(HttpResponse)
method.| Constructor | Description |
|---|---|
SyncResponseHandlerAdapter(HttpResponseHandler<T> responseHandler,
Function<SdkHttpFullResponse,HttpResponse> httpResponseAdapter) |
| Modifier and Type | Method | Description |
|---|---|---|
T |
complete() |
Called when all parts of the response have been received.
|
void |
exceptionOccurred(Throwable throwable) |
Called when an exception occurs during the request/response.
|
void |
headersReceived(SdkHttpResponse response) |
Called when the initial response with headers is received.
|
void |
onStream(org.reactivestreams.Publisher<ByteBuffer> publisher) |
Called when the HTTP client is ready to start sending data to the response handler.
|
public SyncResponseHandlerAdapter(HttpResponseHandler<T> responseHandler, Function<SdkHttpFullResponse,HttpResponse> httpResponseAdapter)
public void headersReceived(SdkHttpResponse response)
SdkHttpResponseHandlerheadersReceived in interface SdkHttpResponseHandler<T>response - the SdkHttpResponsepublic void onStream(org.reactivestreams.Publisher<ByteBuffer> publisher)
SdkHttpResponseHandlerPublisher and request data via a Subscription as
they can handle it.
If at any time the subscriber wishes to stop receiving data, it may call Subscription.cancel(). This
will be treated as a failure of the response and the SdkHttpResponseHandler.exceptionOccurred(Throwable) callback will be invoked.
onStream in interface SdkHttpResponseHandler<T>public void exceptionOccurred(Throwable throwable)
SdkHttpResponseHandlerexceptionOccurred in interface SdkHttpResponseHandler<T>throwable - the exception that occurred.public T complete()
SdkHttpResponseHandlercomplete in interface SdkHttpResponseHandler<T>Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.