Skip to content

Commit

Permalink
Version 1.3.0 of the AWS Java SDK
Browse files Browse the repository at this point in the history
This release adds support for working with the new Amazon DynamoDB
service, including a high-level API for annotating Java classes with
instructions on mapping them to Amazon DynamoDB tables, API updates
for the Amazon SNS client, and general SDK improvements such as
.equals and .hashCode implementations for model objects.

Full release notes:

http://aws.amazon.com/releasenotes/Java/5581335213116164
  • Loading branch information
amazonwebservices committed Jan 18, 2012
1 parent e95f184 commit e621352
Show file tree
Hide file tree
Showing 2,709 changed files with 58,000 additions and 8,888 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.2.15
Bundle-Version: 1.3.0
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.2.15</version>
<version>1.3.0</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>http://aws.amazon.com/sdkforjava</url>

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/amazonaws/AmazonClientException.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2012 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.
Expand Down
49 changes: 25 additions & 24 deletions src/main/java/com/amazonaws/AmazonServiceException.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2012 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
Expand All @@ -32,7 +32,7 @@ public class AmazonServiceException extends AmazonClientException {

/**
* Indicates who is responsible (if known) for a failed request.
*
*
* <p>For example, if a client is using an invalid AWS access key,
* the returned exception will indicate that there is an error in the
* request the caller is sending. Retrying that same request will *not*
Expand All @@ -50,7 +50,7 @@ public class AmazonServiceException extends AmazonClientException {
* problem occurred while processing the request on the service side.
* Service errors will be accompanied by an HTTP error code in the 5xx
* range.
*
*
* <p>Finally, if there isn't enough information to determine who's
* fault the error response is, an Unknown ErrorType will be set.
*/
Expand All @@ -66,17 +66,17 @@ public enum ErrorType {
* reporting an error to AWS support team.
*/
private String requestId;

/**
* The AWS error code represented by this exception (ex:
* InvalidParameterValue).
* InvalidParameterValue).
*/
private String errorCode;

/**
* Indicates (if known) whether this exception was the fault of the caller
* or the service.
*
*
* @see ErrorType
*/
private ErrorType errorType = ErrorType.Unknown;
Expand All @@ -91,7 +91,7 @@ public enum ErrorType {

/**
* Constructs a new AmazonServiceException with the specified message.
*
*
* @param message
* An error message describing what went wrong.
*/
Expand All @@ -102,7 +102,7 @@ public AmazonServiceException(String message) {
/**
* Constructs a new AmazonServiceException with the specified message and
* exception indicating the root cause.
*
*
* @param message
* An error message describing what went wrong.
* @param cause
Expand All @@ -111,10 +111,10 @@ public AmazonServiceException(String message) {
public AmazonServiceException(String message, Exception cause) {
super(message, cause);
}

/**
* Sets the AWS requestId for this exception.
*
*
* @param requestId
* The unique identifier for the service request the caller made.
*/
Expand All @@ -125,7 +125,7 @@ public void setRequestId(String requestId) {
/**
* Returns the AWS request ID that uniquely identifies the service request
* the caller made.
*
*
* @return The AWS request ID that uniquely identifies the service request
* the caller made.
*/
Expand All @@ -135,7 +135,7 @@ public String getRequestId() {

/**
* Sets the name of the service that sent this error response.
*
*
* @param serviceName
* The name of the service that sent this error response.
*/
Expand All @@ -145,16 +145,16 @@ public void setServiceName(String serviceName) {

/**
* Returns the name of the service that sent this error response.
*
*
* @return The name of the service that sent this error response.
*/
public String getServiceName() {
return serviceName;
}

/**
* Sets the AWS error code represented by this exception.
*
*
* @param errorCode
* The AWS error code represented by this exception.
*/
Expand All @@ -164,7 +164,7 @@ public void setErrorCode(String errorCode) {

/**
* Returns the AWS error code represented by this exception.
*
*
* @return The AWS error code represented by this exception.
*/
public String getErrorCode() {
Expand All @@ -175,7 +175,7 @@ public String getErrorCode() {
* Sets the type of error represented by this exception (sender, receiver,
* or unknown), indicating if this exception was the caller's fault, or the
* service's fault.
*
*
* @param errorType
* The type of error represented by this exception (sender or
* receiver), indicating if this exception was the caller's fault
Expand All @@ -188,7 +188,7 @@ public void setErrorType(ErrorType errorType) {
/**
* Indicates who is responsible for this exception (caller, service,
* or unknown).
*
*
* @return A value indicating who is responsible for this exception (caller, service, or unknown).
*/
public ErrorType getErrorType() {
Expand All @@ -197,7 +197,7 @@ public ErrorType getErrorType() {

/**
* Sets the HTTP status code that was returned with this service exception.
*
*
* @param statusCode
* The HTTP status code that was returned with this service
* exception.
Expand All @@ -209,7 +209,7 @@ public void setStatusCode(int statusCode) {
/**
* Returns the HTTP status code that was returned with this service
* exception.
*
*
* @return The HTTP status code that was returned with this service
* exception.
*/
Expand All @@ -220,12 +220,13 @@ public int getStatusCode() {
/**
* Returns a string summary of the details of this exception including the
* HTTP status code, AWS request ID, AWS error code and error message.
*
*
* @see java.lang.Throwable#toString()
*/
@Override
public String toString() {
return "Status Code: " + getStatusCode() + ", "
return "Status Code: " + getStatusCode() + ", "
+ "AWS Service: " + getServiceName() + ", "
+ "AWS Request ID: " + getRequestId() + ", "
+ "AWS Error Code: " + getErrorCode() + ", "
+ "AWS Error Message: " + getMessage();
Expand Down
16 changes: 11 additions & 5 deletions src/main/java/com/amazonaws/AmazonWebServiceClient.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2012 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.
Expand Down Expand Up @@ -39,14 +39,15 @@ public abstract class AmazonWebServiceClient {
protected URI endpoint;

/** The client configuration */
protected final ClientConfiguration clientConfiguration;
protected ClientConfiguration clientConfiguration;

/** Low level client for sending requests to AWS services. */
protected final AmazonHttpClient client;
protected AmazonHttpClient client;

/** Optional request handlers for additional request processing. */
protected final List<RequestHandler> requestHandlers;


/**
* Constructs a new AmazonWebServiceClient object using the specified
* configuration.
Expand Down Expand Up @@ -100,6 +101,11 @@ public void setEndpoint(String endpoint) throws IllegalArgumentException {
}
}

public void setConfiguration(ClientConfiguration clientConfiguration) {
this.clientConfiguration = clientConfiguration;
client = new AmazonHttpClient(clientConfiguration);
}

/**
* Shuts down this client object, releasing any resources that might be held
* open. This is an optional method, and callers are not expected to call
Expand Down Expand Up @@ -154,7 +160,7 @@ protected <T> HttpRequest convertToHttpRequest(Request<T> request, HttpMethodNam
public void addRequestHandler(RequestHandler requestHandler) {
requestHandlers.add(requestHandler);
}

/**
* Removes a request handler from the list of registered handlers that are run
* as part of a request's lifecycle.
Expand All @@ -171,5 +177,5 @@ protected ExecutionContext createExecutionContext() {
ExecutionContext executionContext = new ExecutionContext(requestHandlers);
return executionContext;
}

}
2 changes: 1 addition & 1 deletion src/main/java/com/amazonaws/AmazonWebServiceRequest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2012 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.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/amazonaws/AmazonWebServiceResponse.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2012 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.
Expand Down
38 changes: 34 additions & 4 deletions src/main/java/com/amazonaws/ClientConfiguration.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2012 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.
Expand All @@ -21,17 +21,26 @@
*/
public class ClientConfiguration {

/** The default timeout for a connected socket. */
public static final int DEFAULT_SOCKET_TIMEOUT = 50 * 1000;

/** The default max connection pool size. */
public static final int DEFAULT_MAX_CONNECTIONS = 50;

/** The default HTTP user agent header for AWS Java SDK clients. */
public static final String DEFAULT_USER_AGENT = VersionInfoUtils.getUserAgent();

/** The default maximum number of retries for error responses. */
public static final int DEFAULT_MAX_RETRIES = 3;

/** The HTTP user agent header passed with all HTTP requests. */
private String userAgent = DEFAULT_USER_AGENT;

/**
* The maximum number of times that a retryable failed request (ex: a 5xx
* response from a service) will be retried.
*/
private int maxErrorRetry = 3;
private int maxErrorRetry = DEFAULT_MAX_RETRIES;

/**
* The protocol to use when connecting to Amazon Web Services.
Expand Down Expand Up @@ -60,14 +69,14 @@ public class ClientConfiguration {
private String proxyWorkstation = null;

/** The maximum number of open HTTP connections. */
private int maxConnections = 50;
private int maxConnections = DEFAULT_MAX_CONNECTIONS;

/**
* The amount of time to wait (in milliseconds) for data to be transfered
* over an established, open connection before the connection is timed out.
* A value of 0 means infinity, and is not recommended.
*/
private int socketTimeout = 50 * 1000;
private int socketTimeout = DEFAULT_SOCKET_TIMEOUT;

/**
* The amount of time to wait (in milliseconds) when initially establishing
Expand All @@ -90,6 +99,27 @@ public class ClientConfiguration {
*/
private int socketReceiveBufferSizeHint = 0;


public ClientConfiguration() {}

public ClientConfiguration(ClientConfiguration other) {
this.connectionTimeout = other.connectionTimeout;
this.maxConnections = other.maxConnections;
this.maxErrorRetry = other.maxErrorRetry;
this.protocol = other.protocol;
this.proxyDomain = other.proxyDomain;
this.proxyHost = other.proxyHost;
this.proxyPassword = other.proxyPassword;
this.proxyPort = other.proxyPort;
this.proxyUsername = other.proxyUsername;
this.proxyWorkstation = other.proxyWorkstation;
this.socketTimeout = other.socketTimeout;
this.userAgent = other.userAgent;

this.socketReceiveBufferSizeHint = other.socketReceiveBufferSizeHint;
this.socketSendBufferSizeHint = other.socketSendBufferSizeHint;
}

/**
* Returns the protocol (i.e. HTTP or HTTPS) to use when connecting to
* Amazon Web Services.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/amazonaws/DefaultRequest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2012 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.
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
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2012 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.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/amazonaws/Protocol.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2012 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.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/amazonaws/Request.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2012 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.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/amazonaws/RequestClientOptions.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011 Amazon Technologies, Inc.
* Copyright 2011-2012 Amazon Technologies, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/amazonaws/ResponseMetadata.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2012 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.
Expand Down
Loading

0 comments on commit e621352

Please sign in to comment.