List of usage examples for com.amazonaws.http ExecutionContext setSigner
@Deprecated public void setSigner(Signer signer)
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);// ww w. j av a 2 s . co 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; }