T
- Indicates the type being unmarshalled by this response handler.public final class StaxResponseHandler<T> extends Object implements HttpResponseHandler<T>
X_AMZN_REQUEST_ID_HEADER
Constructor and 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 and Description |
---|---|
static <ResponseT extends SdkResponse> |
createStreamingResponseHandler(Unmarshaller<ResponseT,StaxUnmarshallerContext> unmarshaller)
Creates an synchronous
HttpResponseHandler that unmarshalls into the response POJO while leaving the
connection open for further processing (by a ResponseTransformer or AsyncResponseTransformer
for example). |
T |
handle(HttpResponse response,
ExecutionAttributes executionAttributes)
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, ExecutionAttributes executionAttributes) throws Exception
HttpResponseHandler
handle
in interface HttpResponseHandler<T>
response
- The HTTP response to handle, as received from an AWS service.executionAttributes
- The attributes attached to this particular execution.Exception
- If any problems are encountered handling the response.HttpResponseHandler.handle(HttpResponse, ExecutionAttributes)
public boolean needsConnectionLeftOpen()
needsConnectionLeftOpen
in interface HttpResponseHandler<T>
HttpResponseHandler.needsConnectionLeftOpen()
public static <ResponseT extends SdkResponse> HttpResponseHandler<ResponseT> createStreamingResponseHandler(Unmarshaller<ResponseT,StaxUnmarshallerContext> unmarshaller)
HttpResponseHandler
that unmarshalls into the response POJO while leaving the
connection open for further processing (by a ResponseTransformer
or AsyncResponseTransformer
for example).ResponseT
- Response POJO type.unmarshaller
- Unmarshaller for response POJO.Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.