T
- Indicates the type being unmarshalled by this response handler.public class StaxResponseHandler<T> extends Object implements HttpResponseHandler<AmazonWebServiceResponse<T>>
X_AMZ_REQUEST_ID_ALTERNATIVE_HEADER, X_AMZN_EXTENDED_REQUEST_ID_HEADER, X_AMZN_QUERY_ERROR, X_AMZN_REQUEST_ID_HEADER
Constructor and Description |
---|
StaxResponseHandler(com.ibm.cloud.objectstorage.transform.Unmarshaller<T,com.ibm.cloud.objectstorage.transform.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.
|
StaxResponseHandler(com.ibm.cloud.objectstorage.transform.Unmarshaller<T,com.ibm.cloud.objectstorage.transform.StaxUnmarshallerContext> responseUnmarshaller,
boolean needsConnectionLeftOpen,
boolean isPayloadXML) |
Modifier and Type | Method and Description |
---|---|
protected ResponseMetadata |
getResponseMetadata(Map<String,String> metadata)
Create the default
ResponseMetadata . |
AmazonWebServiceResponse<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 in most of the cases.
|
protected void |
registerAdditionalMetadataExpressions(com.ibm.cloud.objectstorage.transform.StaxUnmarshallerContext unmarshallerContext)
Hook for subclasses to override in order to collect additional metadata
from service responses.
|
public StaxResponseHandler(com.ibm.cloud.objectstorage.transform.Unmarshaller<T,com.ibm.cloud.objectstorage.transform.StaxUnmarshallerContext> responseUnmarshaller, boolean needsConnectionLeftOpen, boolean isPayloadXML)
public StaxResponseHandler(com.ibm.cloud.objectstorage.transform.Unmarshaller<T,com.ibm.cloud.objectstorage.transform.StaxUnmarshallerContext> responseUnmarshaller)
responseUnmarshaller
- The StAX unmarshaller to use on the response.public AmazonWebServiceResponse<T> handle(HttpResponse response) throws Exception
HttpResponseHandler
handle
in interface HttpResponseHandler<AmazonWebServiceResponse<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)
protected ResponseMetadata getResponseMetadata(Map<String,String> metadata)
ResponseMetadata
. Subclasses may override this to create a
subclass of ResponseMetadata
. Currently only SimpleDB does this.protected void registerAdditionalMetadataExpressions(com.ibm.cloud.objectstorage.transform.StaxUnmarshallerContext unmarshallerContext)
unmarshallerContext
- The unmarshaller context used to configure a service's response
data.public boolean needsConnectionLeftOpen()
needsConnectionLeftOpen
in interface HttpResponseHandler<AmazonWebServiceResponse<T>>
HttpResponseHandler.needsConnectionLeftOpen()
Copyright © 2024. All rights reserved.