Example usage for com.amazonaws.http StaxResponseHandler StaxResponseHandler

List of usage examples for com.amazonaws.http StaxResponseHandler StaxResponseHandler

Introduction

In this page you can find the example usage for com.amazonaws.http StaxResponseHandler StaxResponseHandler.

Prototype

public StaxResponseHandler(Unmarshaller<T, StaxUnmarshallerContext> responseUnmarshaller) 

Source Link

Document

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.

Usage

From source file:com.github.sjones4.youcan.youare.YouAreClient.java

License:Open Source License

private <X, Y extends AmazonWebServiceRequest> Response<X> invoke(final Request<Y> request,
        final Unmarshaller<X, StaxUnmarshallerContext> unmarshaller, final ExecutionContext executionContext) {
    request.setEndpoint(endpoint);//from ww w .  j  a  v  a 2s  .co  m
    request.setTimeOffset(timeOffset);

    executionContext.setCredentialsProvider(
            CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider));

    StaxResponseHandler<X> responseHandler = new StaxResponseHandler<X>(unmarshaller);
    DefaultErrorResponseHandler errorResponseHandler = new DefaultErrorResponseHandler(exceptionUnmarshallers);
    return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}