Skip to content

Commit

Permalink
AWS SDK for Java 1.7.13
Browse files Browse the repository at this point in the history
  • Loading branch information
AWS committed Jun 12, 2014
1 parent 86932db commit 4194afb
Show file tree
Hide file tree
Showing 2,238 changed files with 14,677 additions and 12,148 deletions.
2 changes: 1 addition & 1 deletion META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: AWS SDK for Java
Bundle-SymbolicName: com.amazonaws.sdk;singleton:=true
Bundle-Version: 1.7.12
Bundle-Version: 1.7.13
Bundle-Vendor: Amazon Technologies, Inc
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.apache.commons.codec;bundle-version="1.3.0",
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>aws-java-sdk</artifactId>
<packaging>jar</packaging>
<name>AWS SDK for Java</name>
<version>1.7.12</version>
<version>1.7.13</version>
<description>The Amazon Web Services SDK for Java provides Java APIs for building software on AWS' cost-effective, scalable, and reliable infrastructure products. The AWS Java SDK allows developers to code against APIs for all of Amazon's infrastructure web services (Amazon S3, Amazon EC2, Amazon SQS, Amazon Relational Database Service, Amazon AutoScaling, etc).</description>
<url>https://aws.amazon.com/sdkforjava</url>

Expand Down
47 changes: 47 additions & 0 deletions src/main/java/com/amazonaws/AbortedException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright 2013-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws;

/**
* SDK operation aborted exception.
*/
public class AbortedException extends AmazonClientException {
private static final long serialVersionUID = 1L;

public AbortedException(String message, Throwable t) {
super(message, t);
}

public AbortedException(Throwable t) {
super("", t);
}

public AbortedException(String message) {
super(message);
}

public AbortedException() {
super("");
}

/**
* {@inheritDoc}
* An aborted exception is not intended to be retried.
*/
@Override
public boolean isRetryable() {
return false;
}
}
7 changes: 7 additions & 0 deletions src/main/java/com/amazonaws/AmazonClientException.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,11 @@ public AmazonClientException(String message) {
super(message);
}

/**
* Returns a hint as to whether it makes sense to retry upon this exception.
* Default is true, but subclass may override.
*/
public boolean isRetryable() {
return true;
}
}
56 changes: 30 additions & 26 deletions src/main/java/com/amazonaws/AmazonWebServiceClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public abstract class AmazonWebServiceClient {

/** Optional request handlers for additional request processing. */
protected final List<RequestHandler2> requestHandler2s;

/** Optional offset (in seconds) to use when signing requests */
protected int timeOffset;

Expand All @@ -106,7 +106,7 @@ public AmazonWebServiceClient(ClientConfiguration clientConfiguration) {
/**
* Constructs a new AmazonWebServiceClient object using the specified
* configuration and request metric collector.
*
*
* @param clientConfiguration
* The client configuration for this client.
* @param requestMetricCollector
Expand Down Expand Up @@ -143,10 +143,10 @@ public AmazonWebServiceClient(ClientConfiguration clientConfiguration,
* {@link ClientConfiguration} will be used, which by default is HTTPS.
* <p>
* For more information on using AWS regions with the AWS SDK for Java, and
* a complete list of all available endpoints for all AWS services, see:
* a complete list of all available endpoints for all AWS services, see:
* <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=3912">
* http://developer.amazonwebservices.com/connect/entry.jspa?externalID=3912</a>
*
*
* @param endpoint
* The endpoint (ex: "ec2.amazonaws.com") or a full URL,
* including the protocol (ex: "https://ec2.amazonaws.com") of
Expand All @@ -158,9 +158,9 @@ public AmazonWebServiceClient(ClientConfiguration clientConfiguration,
public void setEndpoint(String endpoint) throws IllegalArgumentException {
URI uri = toURI(endpoint);
Signer signer = computeSignerByURI(uri, signerRegionOverride, false);
synchronized(this) {
synchronized(this) {
this.endpoint = uri;
this.signer = signer;
this.signer = signer;
}
}

Expand Down Expand Up @@ -205,7 +205,7 @@ private URI toURI(String endpoint) throws IllegalArgumentException {
* "http://developer.amazonwebservices.com/connect/entry.jspa?externalID=3912"
* > http://developer.amazonwebservices.com/connect/entry.jspa?externalID=
* 3912</a>
*
*
* @param endpoint
* The endpoint (ex: "dynamodb.us-east-1.amazonaws.com/") or a
* full URL, including the protocol (ex:
Expand All @@ -226,13 +226,13 @@ public void setEndpoint(String endpoint, String serviceName, String regionId) {
URI uri = toURI(endpoint);
Signer signer = computeSignerByServiceRegion(serviceName, regionId,
regionId, true);
synchronized(this) {
synchronized(this) {
this.signer = signer;
this.endpoint = uri;
this.signerRegionOverride = regionId;
}
}

/**
* @deprecated this method is now a no-op, as overriding the signer from
* sublcass is no longer supported.
Expand Down Expand Up @@ -263,7 +263,7 @@ public Signer getSignerByURI(URI uri) {
* <p>
* Note, however, the signer returned for S3 is incomplete at this stage as
* the information on the S3 bucket and key is not yet known.
*
*
* @param signerRegionOverride
* the overriding signer region; or null if there is none.
* @param isRegionIdAsSignerParam
Expand All @@ -275,6 +275,10 @@ public Signer getSignerByURI(URI uri) {
*/
private Signer computeSignerByURI(URI uri, String signerRegionOverride,
boolean isRegionIdAsSignerParam) {
if (uri == null) {
throw new IllegalArgumentException(
"Endpoint is not set. Use setEndpoint to set an endpoint before performing any request.");
}
String service = getServiceNameIntern();
String region = AwsHostNameUtils.parseRegionName(uri.getHost(), service);
return computeSignerByServiceRegion(
Expand All @@ -287,7 +291,7 @@ private Signer computeSignerByURI(URI uri, String signerRegionOverride,
* <p>
* Note, however, the signer returned for S3 is incomplete at this stage as
* the information on the S3 bucket and key is not yet known.
*
*
* @param regionId
* the region for sending AWS requests
* @param signerRegionOverride
Expand All @@ -305,14 +309,14 @@ private Signer computeSignerByServiceRegion(
boolean isRegionIdAsSignerParam) {
String signerType = clientConfiguration.getSignerOverride();
Signer signer = signerType == null
? SignerFactory.getSigner(serviceName, regionId)
? SignerFactory.getSigner(serviceName, regionId)
: SignerFactory.getSignerByTypeAndService(signerType, serviceName)
;
if (signer instanceof RegionAwareSigner) {
// Overrides the default region computed
RegionAwareSigner regionAwareSigner = (RegionAwareSigner)signer;
// (signerRegionOverride != null) means that it is likely to be AWS
// internal dev work, as "signerRegionOverride" is typically null
// internal dev work, as "signerRegionOverride" is typically null
// when used in the external release
if (signerRegionOverride != null)
regionAwareSigner.setRegionName(signerRegionOverride);
Expand All @@ -335,7 +339,7 @@ else if (regionId != null && isRegionIdAsSignerParam)
* By default, all service endpoints in all regions use the https protocol.
* To use http instead, specify it in the {@link ClientConfiguration}
* supplied at construction.
*
*
* @param region
* The region this client will communicate with. See
* {@link Region#getRegion(com.amazonaws.regions.Regions)} for
Expand Down Expand Up @@ -383,9 +387,9 @@ public void setRegion(Region region) throws IllegalArgumentException {
URI uri = toURI(serviceEndpoint);
Signer signer = computeSignerByServiceRegion(serviceName,
region.getName(), signerRegionOverride, false);
synchronized(this) {
synchronized(this) {
this.endpoint = uri;
this.signer = signer;
this.signer = signer;
}
}

Expand Down Expand Up @@ -450,7 +454,7 @@ protected <T> HttpRequest convertToHttpRequest(Request<T> request, HttpMethodNam

/**
* @deprecated by {@link #addRequestHandler(RequestHandler2)}.
*
*
* Appends a request handler to the list of registered handlers that are run
* as part of a request's lifecycle.
*
Expand All @@ -460,7 +464,7 @@ protected <T> HttpRequest convertToHttpRequest(Request<T> request, HttpMethodNam
*/
@Deprecated
public void addRequestHandler(RequestHandler requestHandler) {
requestHandler2s.add(RequestHandler2.adapt(requestHandler));
requestHandler2s.add(RequestHandler2.adapt(requestHandler));
}

/**
Expand Down Expand Up @@ -502,7 +506,7 @@ protected final ExecutionContext createExecutionContext(Request<?> req) {

/**
* @deprecated by {@link #createExecutionContext(AmazonWebServiceRequest)}.
*
*
* This method exists only for backward compatiblity reason, so
* that clients compiled against the older version of this class
* won't get {@link NoSuchMethodError} at runtime. However,
Expand All @@ -521,7 +525,7 @@ protected final ExecutionContext createExecutionContext() {
protected static boolean isProfilingEnabled() {
return System.getProperty(PROFILING_SYSTEM_PROPERTY) != null;
}

/**
* Returns true if request metric collection is applicable to the given
* request; false otherwise.
Expand All @@ -542,7 +546,7 @@ private boolean isRMCEnabledAtClientOrSdkLevel() {
RequestMetricCollector c = requestMetricCollector();
return c != null && c.isEnabled();
}

/**
* Sets the optional value for time offset for this client. This
* value will be applied to all requests processed through this client.
Expand All @@ -555,7 +559,7 @@ private boolean isRMCEnabledAtClientOrSdkLevel() {
public void setTimeOffset(int timeOffset) {
this.timeOffset = timeOffset;
}

/**
* Sets the optional value for time offset for this client. This
* value will be applied to all requests processed through this client.
Expand All @@ -564,14 +568,14 @@ public void setTimeOffset(int timeOffset) {
*
* @param timeOffset
* The optional value for time offset (in seconds) for this client.
*
*
* @return the updated web service client
*/
public AmazonWebServiceClient withTimeOffset(int timeOffset) {
setTimeOffset(timeOffset);
return this;
}

/**
* Returns the optional value for time offset for this client. This
* value will be applied to all requests processed through this client.
Expand Down Expand Up @@ -737,7 +741,7 @@ private String computeServiceName() {

/**
* Returns the signer region override.
*
*
* @see #setSignerRegionOverride(String).
*/
public final String getSignerRegionOverride() {
Expand All @@ -751,7 +755,7 @@ public final String getSignerRegionOverride() {
*/
public final void setSignerRegionOverride(String signerRegionOverride) {
Signer signer = computeSignerByURI(endpoint, signerRegionOverride, true);
synchronized(this) {
synchronized(this) {
this.signer = signer;
this.signerRegionOverride = signerRegionOverride;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/amazonaws/HttpMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
*/
public enum HttpMethod {

GET, POST, PUT, DELETE, HEAD;
GET, POST, PUT, DELETE, HEAD, PATCH;

}
4 changes: 2 additions & 2 deletions src/main/java/com/amazonaws/auth/AWS4Signer.java
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ protected final String getDateStamp(long dateMilli) {
}

protected final long getDateFromRequest(Request<?> request) {
int timeOffset = getTimeOffset(request);
int timeOffset = getTimeOffset(request);
Date date = getSignatureDate(timeOffset);
if (overriddenDate != null) date = overriddenDate;
return date.getTime();
Expand Down Expand Up @@ -422,7 +422,7 @@ public void presignRequest(Request<?> request, AWSCredentials credentials,
// For SigV4 pre-signing URL, we need to add "x-amz-security-token"
// as a query string parameter, before constructing the canonical
// request.
request.addParameter("x-amz-security-token",
request.addParameter("X-Amz-Security-Token",
((AWSSessionCredentials) sanitizedCredentials)
.getSessionToken());
}
Expand Down
Loading

0 comments on commit 4194afb

Please sign in to comment.