|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.amazonaws.http.DefaultErrorResponseHandler
public class DefaultErrorResponseHandler
Implementation of HttpResponseHandler that handles only error responses from Amazon Web Services. A list of unmarshallers is passed into the constructor, and while handling a response, each unmarshaller is tried, in order, until one is found that can successfully unmarshall the error response. If no unmarshaller is found that can unmarshall the error response, a generic AmazonServiceException is created and populated with the AWS error response information (error message, AWS error code, AWS request ID, etc).
Constructor Summary | |
---|---|
DefaultErrorResponseHandler(List<com.amazonaws.transform.Unmarshaller<AmazonServiceException,Node>> unmarshallerList)
Constructs a new DefaultErrorResponseHandler that will handle error responses from Amazon services using the specified list of unmarshallers. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultErrorResponseHandler(List<com.amazonaws.transform.Unmarshaller<AmazonServiceException,Node>> unmarshallerList)
unmarshallerList
- The list of unmarshallers to try using when handling an error
response.Method Detail |
---|
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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |