public class DefaultErrorResponseHandler extends Object implements HttpResponseHandler<AmazonServiceException>
X_AMZ_REQUEST_ID_ALTERNATIVE_HEADER, X_AMZN_EXTENDED_REQUEST_ID_HEADER, X_AMZN_QUERY_ERROR, X_AMZN_REQUEST_ID_HEADER
Constructor and Description |
---|
DefaultErrorResponseHandler(List<Unmarshaller<AmazonServiceException,Node>> unmarshallerList)
Constructs a new DefaultErrorResponseHandler that will handle error responses from Amazon
services using the specified list of unmarshallers.
|
DefaultErrorResponseHandler(Map<String,Unmarshaller<AmazonServiceException,Node>> unmarshallerMap,
Unmarshaller<AmazonServiceException,Node> defaultUnmarshaller)
Constructs a new DefaultErrorResponseHandler that will handle error responses from Amazon
services using the specified map of unmarshallers.
|
Modifier and Type | Method and Description |
---|---|
AmazonServiceException |
handle(HttpResponse errorResponse)
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 DefaultErrorResponseHandler(Map<String,Unmarshaller<AmazonServiceException,Node>> unmarshallerMap, Unmarshaller<AmazonServiceException,Node> defaultUnmarshaller)
unmarshallerMap
- The map of unmarshallers where key is errorCode
and Value is unmarshaller for that errorCode.defaultUnmarshaller
- Default or standard Unmarshaller defined for the Service.public DefaultErrorResponseHandler(List<Unmarshaller<AmazonServiceException,Node>> unmarshallerList)
unmarshallerList
- The list of unmarshallers to try using when handling an error
response.public AmazonServiceException handle(HttpResponse errorResponse) throws Exception
HttpResponseHandler
handle
in interface HttpResponseHandler<AmazonServiceException>
errorResponse
- The HTTP response to handle, as received from an AWS service.Exception
- If any problems are encountered handling the response.public boolean needsConnectionLeftOpen()
needsConnectionLeftOpen
in interface HttpResponseHandler<AmazonServiceException>
HttpResponseHandler.needsConnectionLeftOpen()
Copyright © 2023. All rights reserved.