List of usage examples for com.amazonaws AmazonWebServiceRequest getRequestCredentials
@Deprecated
public AWSCredentials getRequestCredentials()
From source file:com.ivona.services.tts.IvonaSpeechCloudClient.java
License:Open Source License
private <Y> Request<Y> prepareRequest(Request<Y> request, ExecutionContext executionContext, boolean signRequest) { request.setEndpoint(endpoint);/*from w ww. j av a2 s.c o m*/ request.setTimeOffset(timeOffset); AWSCredentials credentials = awsCredentialsProvider.getCredentials(); AmazonWebServiceRequest originalRequest = request.getOriginalRequest(); if (originalRequest != null && originalRequest.getRequestCredentials() != null) { credentials = originalRequest.getRequestCredentials(); } if (signRequest) { // expiration date is not currently supported on service side, but presignRequest method requires // this argument so one with default value is provided. Date expirationDate = DateTime.now(DateTimeZone.UTC).plusMinutes(DEFAULT_GET_REQUEST_EXPIRATION_MINUTES) .toDate(); signer.presignRequest(request, credentials, expirationDate); } else { executionContext.setSigner(signer); executionContext.setCredentials(credentials); } return request; }