Skip to content

Commit

Permalink
AWS SDK for Java 1.11.40
Browse files Browse the repository at this point in the history
  • Loading branch information
AWS committed Oct 5, 2016
1 parent 67aff58 commit 3aadef0
Show file tree
Hide file tree
Showing 96 changed files with 489 additions and 272 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencies.
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-bom</artifactId>
<version>1.11.39</version>
<version>1.11.40</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion aws-java-sdk-acm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-pom</artifactId>
<version>1.11.40-SNAPSHOT</version>
<version>1.11.40</version>
</parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-acm</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-java-sdk-api-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-pom</artifactId>
<version>1.11.40-SNAPSHOT</version>
<version>1.11.40</version>
</parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-api-gateway</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-java-sdk-applicationautoscaling/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-pom</artifactId>
<version>1.11.40-SNAPSHOT</version>
<version>1.11.40</version>
</parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-applicationautoscaling</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-java-sdk-autoscaling/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-pom</artifactId>
<version>1.11.40-SNAPSHOT</version>
<version>1.11.40</version>
</parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-autoscaling</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-java-sdk-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-pom</artifactId>
<version>1.11.40-SNAPSHOT</version>
<version>1.11.40</version>
</parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-bom</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-java-sdk-cloudformation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-pom</artifactId>
<version>1.11.40-SNAPSHOT</version>
<version>1.11.40</version>
</parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-cloudformation</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-java-sdk-cloudfront/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-pom</artifactId>
<version>1.11.40-SNAPSHOT</version>
<version>1.11.40</version>
</parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-cloudfront</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-java-sdk-cloudhsm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-pom</artifactId>
<version>1.11.40-SNAPSHOT</version>
<version>1.11.40</version>
</parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-cloudhsm</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-java-sdk-cloudsearch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-pom</artifactId>
<version>1.11.40-SNAPSHOT</version>
<version>1.11.40</version>
</parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-cloudsearch</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-java-sdk-cloudtrail/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-pom</artifactId>
<version>1.11.40-SNAPSHOT</version>
<version>1.11.40</version>
</parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-cloudtrail</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-java-sdk-cloudwatch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-pom</artifactId>
<version>1.11.40-SNAPSHOT</version>
<version>1.11.40</version>
</parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-cloudwatch</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-java-sdk-cloudwatchmetrics/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-pom</artifactId>
<version>1.11.40-SNAPSHOT</version>
<version>1.11.40</version>
</parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-cloudwatchmetrics</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions aws-java-sdk-code-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-pom</artifactId>
<version>1.11.40-SNAPSHOT</version>
<version>1.11.40</version>
</parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-code-generator</artifactId>
Expand All @@ -22,7 +22,7 @@
<artifactId>aws-java-sdk-core</artifactId>
<groupId>com.amazonaws</groupId>
<optional>false</optional>
<version>1.11.40-SNAPSHOT</version>
<version>1.11.40</version>
</dependency>
<dependency>
<artifactId>org.eclipse.jdt.core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ public class JavaCodeFormatter {
static {
DEFAULT_FORMATTER_OPTIONS = DefaultCodeFormatterConstants.getEclipseDefaultSettings();

DEFAULT_FORMATTER_OPTIONS.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_6);
DEFAULT_FORMATTER_OPTIONS.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM,
JavaCore.VERSION_1_6);
DEFAULT_FORMATTER_OPTIONS.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_6);
DEFAULT_FORMATTER_OPTIONS.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_8);
DEFAULT_FORMATTER_OPTIONS.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_8);
DEFAULT_FORMATTER_OPTIONS.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_8);
DEFAULT_FORMATTER_OPTIONS.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR,
JavaCore.SPACE);
DEFAULT_FORMATTER_OPTIONS.put(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import com.amazonaws.codegen.model.service.ServiceModel;
import com.amazonaws.util.StringUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.HashSet;
import java.util.Set;

import static com.amazonaws.codegen.internal.Constants.EXCEPTION_CLASS_SUFFIX;
import static com.amazonaws.codegen.internal.Constants.FAULT_CLASS_SUFFIX;
Expand All @@ -37,14 +37,13 @@
*/
public class DefaultNamingStrategy implements NamingStrategy {

private final static List<String> reservedKeywords = new ArrayList<String>() {{
private final static Set<String> reservedKeywords = new HashSet<String>() {{
add("return");
add("public");
add("private");
add("class");
add("static");
add("protected");
add("return");
add("string");
add("boolean");
add("integer");
Expand Down
2 changes: 1 addition & 1 deletion aws-java-sdk-codecommit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-pom</artifactId>
<version>1.11.40-SNAPSHOT</version>
<version>1.11.40</version>
</parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-codecommit</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-java-sdk-codedeploy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-pom</artifactId>
<version>1.11.40-SNAPSHOT</version>
<version>1.11.40</version>
</parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-codedeploy</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-java-sdk-codegen-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-pom</artifactId>
<version>1.11.40-SNAPSHOT</version>
<version>1.11.40</version>
</parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-codegen-maven-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-java-sdk-codepipeline/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-pom</artifactId>
<version>1.11.40-SNAPSHOT</version>
<version>1.11.40</version>
</parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-codepipeline</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-java-sdk-cognitoidentity/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-pom</artifactId>
<version>1.11.40-SNAPSHOT</version>
<version>1.11.40</version>
</parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-cognitoidentity</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-java-sdk-cognitoidp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-pom</artifactId>
<version>1.11.40-SNAPSHOT</version>
<version>1.11.40</version>
</parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-cognitoidp</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-java-sdk-cognitosync/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-pom</artifactId>
<version>1.11.40-SNAPSHOT</version>
<version>1.11.40</version>
</parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-cognitosync</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-java-sdk-config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-pom</artifactId>
<version>1.11.40-SNAPSHOT</version>
<version>1.11.40</version>
</parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-config</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-java-sdk-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-pom</artifactId>
<version>1.11.40-SNAPSHOT</version>
<version>1.11.40</version>
</parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,18 @@ public class SDKGlobalConfiguration {
*/
public static final String AWS_CBOR_DISABLE_SYSTEM_PROPERTY = "com.amazonaws.sdk.disableCbor";

/**
* Environment variable to disable Ion binary protocol. This forces the request
* to be sent over the wire as Ion text.
*/
public static final String AWS_ION_BINARY_DISABLE_ENV_VAR = "AWS_ION_BINARY_DISABLE";

/**
* System property to disable Ion binary protocol. This forces the request to be sent over the wire
* as Ion text
*/
public static final String AWS_ION_BINARY_DISABLE_SYSTEM_PROPERTY = "com.amazonaws.sdk.disableIonBinary";

/**
* @deprecated by {@link SDKGlobalTime#setGlobalTimeOffset(int)}
*/
Expand Down Expand Up @@ -240,6 +252,11 @@ public static boolean isCborDisabled() {
isPropertyEnabled(System.getenv(AWS_CBOR_DISABLE_ENV_VAR));
}

public static boolean isIonBinaryDisabled() {
return isPropertyEnabled(System.getProperty(AWS_ION_BINARY_DISABLE_SYSTEM_PROPERTY)) ||
isPropertyEnabled(System.getenv(AWS_ION_BINARY_DISABLE_ENV_VAR));
}

private static boolean isPropertyEnabled(final String property) {
if (property == null || property.equalsIgnoreCase("false")) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@
interface JsonContentTypeResolver {

/**
* Content type resolver implementation for Ion enabled services.
* Content type resolver implementation for Ion-enabled services.
*/
JsonContentTypeResolver ION = new JsonContentTypeResolverImpl("application/x-amz-ion-");
JsonContentTypeResolver ION_BINARY = new JsonContentTypeResolverImpl("application/x-amz-ion-");

/**
* Content type resolver implementation for debugging Ion-enabled services.
*/
JsonContentTypeResolver ION_TEXT = new JsonContentTypeResolverImpl("text/x-amz-ion-");

/**
* Content type resolver implementation for CBOR enabled services.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@
import java.util.Date;

import com.amazonaws.AmazonClientException;
import com.amazonaws.annotation.SdkInternalApi;
import com.amazonaws.util.BinaryUtils;
import software.amazon.ion.IonType;
import software.amazon.ion.IonWriter;
import software.amazon.ion.Timestamp;
import software.amazon.ion.system.IonBinaryWriterBuilder;
import software.amazon.ion.system.IonWriterBuilder;

class SdkIonGenerator implements StructuredJsonGenerator {
@SdkInternalApi
abstract class SdkIonGenerator implements StructuredJsonGenerator {
private final String contentType;
private final ByteArrayOutputStream bytes;
private final IonWriter writer;
protected final IonWriter writer;

public SdkIonGenerator(IonBinaryWriterBuilder writerBuilder, String contentType) {
private SdkIonGenerator(IonWriter writer, String contentType) {
this.writer = writer;
this.contentType = contentType;
this.bytes = new ByteArrayOutputStream();
this.writer = writerBuilder.build(bytes);
}

@Override
Expand Down Expand Up @@ -196,17 +196,35 @@ public StructuredJsonGenerator writeValue(BigInteger value) {
}

@Override
public byte[] getBytes() {
try {
writer.finish();
} catch (IOException e) {
throw new AmazonClientException(e);
}
return bytes.toByteArray();
}
public abstract byte[] getBytes();

@Override
public String getContentType() {
return contentType;
}

public static SdkIonGenerator create(IonWriterBuilder builder, String contentType) {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
IonWriter writer = builder.build(bytes);
return new ByteArraySdkIonGenerator(bytes, writer, contentType);
}

private static class ByteArraySdkIonGenerator extends SdkIonGenerator {
private final ByteArrayOutputStream bytes;

public ByteArraySdkIonGenerator(ByteArrayOutputStream bytes, IonWriter writer, String contentType) {
super(writer, contentType);
this.bytes = bytes;
}

@Override
public byte[] getBytes() {
try {
writer.finish();
} catch (IOException e) {
throw new AmazonClientException(e);
}
return bytes.toByteArray();
}
}
}
Loading

0 comments on commit 3aadef0

Please sign in to comment.