Skip to content

Commit

Permalink
AWS SDK for Java 1.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
AWS committed Jul 10, 2014
1 parent aef1849 commit e6bb994
Show file tree
Hide file tree
Showing 405 changed files with 34,443 additions and 547 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.8.3
Bundle-Version: 1.8.4
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.8.4-SNAPSHOT</version>
<version>1.8.4</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
5 changes: 3 additions & 2 deletions src/main/java/com/amazonaws/event/ProgressEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ public long getBytes() {

/**
* Convenient method to returns the number of bytes transferred in this
* event, or the number of bytes reset if negative. In particular, bytes of
* a content-length event is excluded.
* event, or the number of bytes reset (or discarded) if negative. In
* particular, bytes of a content-length event is excluded.
*/
public long getBytesTransferred() {
switch(eventType) {
Expand All @@ -94,6 +94,7 @@ public long getBytesTransferred() {
return bytes;
case HTTP_RESPONSE_CONTENT_RESET_EVENT:
case HTTP_REQUEST_CONTENT_RESET_EVENT:
case RESPONSE_BYTE_DISCARD_EVENT:
return 0 - bytes;
default:
return 0;
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/com/amazonaws/event/ProgressEventType.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,27 @@ public enum ProgressEventType {
*/
@Deprecated
BYTE_TRANSFER_EVENT,
/**
* Event of the content length to be sent in a request.
*/
REQUEST_CONTENT_LENGTH_EVENT,
/**
* Event of the content length received in a response.
*/
RESPONSE_CONTENT_LENGTH_EVENT,

/**
* Used to indicate the number of bytes to be sent to AWS.
*/
REQUEST_BYTE_TRANSFER_EVENT,
/**
* Used to indicate the number of bytes received from AWS.
*/
RESPONSE_BYTE_TRANSFER_EVENT,
/**
* Used to indicate the number of bytes discarded after being received from AWS.
*/
RESPONSE_BYTE_DISCARD_EVENT,

/* Generic request progress events */

Expand Down Expand Up @@ -150,8 +166,14 @@ public boolean isRequestCycleEvent() {
public boolean isByteCountEvent() {
switch (this) {
case BYTE_TRANSFER_EVENT:
case HTTP_REQUEST_CONTENT_RESET_EVENT:
case HTTP_RESPONSE_CONTENT_RESET_EVENT:

case REQUEST_BYTE_TRANSFER_EVENT:
case RESPONSE_BYTE_TRANSFER_EVENT:

case RESPONSE_BYTE_DISCARD_EVENT:

case REQUEST_CONTENT_LENGTH_EVENT:
case RESPONSE_CONTENT_LENGTH_EVENT:
return true;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/amazonaws/event/ProgressTracker.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public void progressChanged(ProgressEvent progressEvent) {
progress.addRequestBytesTransferred(0-bytes);
break;
case HTTP_RESPONSE_CONTENT_RESET_EVENT:
case RESPONSE_BYTE_DISCARD_EVENT:
progress.addResponseBytesTransferred(0-bytes);
break;
default:
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/amazonaws/event/SDKProgressPublisher.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,16 @@ public static Future<?> publishResponseReset(
return publishResetEvent(listener, HTTP_RESPONSE_CONTENT_RESET_EVENT, bytesReset);
}

/**
* Convenient method to publish a response bytes discard event to the given listener.
*/
public static Future<?> publishResponseBytesDiscarded(
final ProgressListener listener,
final long bytesDiscarded) {
return publishResetEvent(listener,
ProgressEventType.RESPONSE_BYTE_DISCARD_EVENT, bytesDiscarded);
}

/**
* @param listener
* must not be null or else the publication will be skipped
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/com/amazonaws/http/AmazonHttpClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ public class AmazonHttpClient {
// Customers have reported XML parsing issues with the following
// JVM versions, which don't occur with more recent versions, so
// if we detect any of these, give customers a heads up.
// https://bugs.openjdk.java.net/browse/JDK-8028111
List<String> problematicJvmVersions = Arrays.asList(
"1.6.0_06", "1.6.0_13", "1.6.0_17");
"1.6.0_06", "1.6.0_13", "1.6.0_17", "1.6.0_65", "1.7.0_45");
String jvmVersion = System.getProperty("java.version");
if (problematicJvmVersions.contains(jvmVersion)) {
log.warn("Detected a possible problem with the current JVM version (" + jvmVersion + "). " +
Expand Down Expand Up @@ -818,6 +819,8 @@ private <T> T handleResponse(Request<?> request,
throw e;
} catch (IOException e) {
throw e;
} catch (AmazonClientException e) {
throw e; // simply rethrow rather than further wrapping it
} catch (Exception e) {
String errorMessage = "Unable to unmarshall response (" + e.getMessage() + "). Response Code: " +
httpResponse.getStatusCode() + ", Response Text: " + httpResponse.getStatusText();
Expand Down
Loading

0 comments on commit e6bb994

Please sign in to comment.