Example usage for com.amazonaws.util CredentialUtils getCredentialsProvider

List of usage examples for com.amazonaws.util CredentialUtils getCredentialsProvider

Introduction

In this page you can find the example usage for com.amazonaws.util CredentialUtils getCredentialsProvider.

Prototype

public static AWSCredentialsProvider getCredentialsProvider(RequestConfig requestConfig,
            AWSCredentialsProvider base) 

Source Link

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   w  w w.j a  v  a 2 s  . c o 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);
}