T
- Indicates the type being unmarshalled by this response handler.HttpResponseHandler<T>
SimpleDbStaxResponseHandler
public class StaxResponseHandler<T> extends Object implements HttpResponseHandler<T>
X_AMZN_REQUEST_ID_HEADER
Constructor | Description |
---|---|
StaxResponseHandler(Unmarshaller<T,StaxUnmarshallerContext> responseUnmarshaller) |
Constructs a new response handler that will use the specified StAX
unmarshaller to unmarshall the service response and uses the specified
response element path to find the root of the business data in the
service's response.
|
Modifier and Type | Method | Description |
---|---|---|
static <ResponseT,ReturnT> |
createStreamingAsyncResponseHandler(Unmarshaller<ResponseT,StaxUnmarshallerContext> unmarshaller,
AsyncResponseHandler<ResponseT,ReturnT> asyncResponseHandler) |
Creates an async
SdkHttpResponseHandler from the given unmarshaller and customer provided AsyncResponseHandler . |
static <ResponseT,ReturnT> |
createStreamingResponseHandler(Unmarshaller<ResponseT,StaxUnmarshallerContext> unmarshaller,
StreamingResponseHandler<ResponseT,ReturnT> streamingHandler) |
Creates an synchronous
HttpResponseHandler that unmarshalls the resposne POJO thne passes the HTTP content to the
given StreamingResponseHandler . |
T |
handle(HttpResponse response) |
Accepts an HTTP response object, and returns an object of type T.
|
boolean |
needsConnectionLeftOpen() |
Since this response handler completely consumes all the data from the
underlying HTTP connection during the handle method, we don't need to
keep the HTTP connection open.
|
public StaxResponseHandler(Unmarshaller<T,StaxUnmarshallerContext> responseUnmarshaller)
responseUnmarshaller
- The StAX unmarshaller to use on the response.public T handle(HttpResponse response) throws Exception
HttpResponseHandler
handle
in interface HttpResponseHandler<T>
response
- The HTTP response to handle, as received from an AWS service.Exception
- If any problems are encountered handling the response.HttpResponseHandler.handle(HttpResponse)
public boolean needsConnectionLeftOpen()
needsConnectionLeftOpen
in interface HttpResponseHandler<T>
HttpResponseHandler.needsConnectionLeftOpen()
public static <ResponseT,ReturnT> HttpResponseHandler<ReturnT> createStreamingResponseHandler(Unmarshaller<ResponseT,StaxUnmarshallerContext> unmarshaller, StreamingResponseHandler<ResponseT,ReturnT> streamingHandler)
HttpResponseHandler
that unmarshalls the resposne POJO thne passes the HTTP content to the
given StreamingResponseHandler
.ResponseT
- Response POJO type.ReturnT
- Return type of customer provided response handler.unmarshaller
- Unmarshaller for response POJO.streamingHandler
- Customer provided response handler.public static <ResponseT,ReturnT> SdkHttpResponseHandler<ReturnT> createStreamingAsyncResponseHandler(Unmarshaller<ResponseT,StaxUnmarshallerContext> unmarshaller, AsyncResponseHandler<ResponseT,ReturnT> asyncResponseHandler)
SdkHttpResponseHandler
from the given unmarshaller and customer provided AsyncResponseHandler
.ResponseT
- Response POJO type.ReturnT
- Return type of customer provided response handler.unmarshaller
- Unmarshaller for POJO response type.asyncResponseHandler
- Customer provided response handler to consume HTTP content.Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.