Skip to content

Commit ab1cf9c

Browse files
Merge pull request #710 from aws/staging/f85951bd-1c3d-437b-aaa9-b7b2bd29f4f6
Pull request: release <- staging/f85951bd-1c3d-437b-aaa9-b7b2bd29f4f6
2 parents 5ec40bd + 636b4c8 commit ab1cf9c

File tree

353 files changed

+4428
-1244
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

353 files changed

+4428
-1244
lines changed

.changes/2.10.43.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"version": "2.10.43",
3+
"date": "2020-01-06",
4+
"entries": [
5+
{
6+
"type": "feature",
7+
"category": "AWS SDK for Java v2",
8+
"description": "Add `RequestBody.fromRemainingByteBuffer(ByteBuffer)` that copies only the remaining readable bytes of the buffer. See [#1534](https://github.com/aws/aws-sdk-java-v2/issues/1534)"
9+
},
10+
{
11+
"type": "feature",
12+
"category": "Amazon Elastic Compute Cloud",
13+
"description": "This release supports service providers configuring a private DNS name for services other than AWS services and services available in the AWS marketplace. This feature allows consumers to access the service using an existing DNS name without making changes to their applications."
14+
},
15+
{
16+
"type": "bugfix",
17+
"category": "AWS SDK for Java v2",
18+
"description": "Reduce ReadTimeout and ConnectTimeout for accessing EC2 metadata instance service"
19+
},
20+
{
21+
"type": "feature",
22+
"category": "AWS Elemental MediaPackage",
23+
"description": "You can now restrict direct access to AWS Elemental MediaPackage by securing requests for live content using CDN authorization. With CDN authorization, content requests require a specific HTTP header and authorization code."
24+
},
25+
{
26+
"type": "bugfix",
27+
"category": "Amazon S3",
28+
"description": "Requests that return an error response in the body of the HTTP response with a successful (200) status code will now correctly be handled as a failed request by the SDK."
29+
},
30+
{
31+
"type": "feature",
32+
"category": "Amazon Comprehend",
33+
"description": "Amazon Comprehend now supports Multilabel document classification"
34+
}
35+
]
36+
}

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
# __2.10.43__ __2020-01-06__
2+
## __AWS Elemental MediaPackage__
3+
- ### Features
4+
- You can now restrict direct access to AWS Elemental MediaPackage by securing requests for live content using CDN authorization. With CDN authorization, content requests require a specific HTTP header and authorization code.
5+
6+
## __AWS SDK for Java v2__
7+
- ### Features
8+
- Add `RequestBody.fromRemainingByteBuffer(ByteBuffer)` that copies only the remaining readable bytes of the buffer. See [#1534](https://github.com/aws/aws-sdk-java-v2/issues/1534)
9+
10+
- ### Bugfixes
11+
- Reduce ReadTimeout and ConnectTimeout for accessing EC2 metadata instance service
12+
13+
## __Amazon Comprehend__
14+
- ### Features
15+
- Amazon Comprehend now supports Multilabel document classification
16+
17+
## __Amazon Elastic Compute Cloud__
18+
- ### Features
19+
- This release supports service providers configuring a private DNS name for services other than AWS services and services available in the AWS marketplace. This feature allows consumers to access the service using an existing DNS name without making changes to their applications.
20+
21+
## __Amazon S3__
22+
- ### Bugfixes
23+
- Requests that return an error response in the body of the HTTP response with a successful (200) status code will now correctly be handled as a failed request by the SDK.
24+
125
# __2.10.42__ __2020-01-02__
226
## __AWS Cost Explorer Service__
327
- ### Features

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ To automatically manage module versions (currently all modules have the same ver
4848
<dependency>
4949
<groupId>software.amazon.awssdk</groupId>
5050
<artifactId>bom</artifactId>
51-
<version>2.10.42</version>
51+
<version>2.10.43</version>
5252
<type>pom</type>
5353
<scope>import</scope>
5454
</dependency>
@@ -82,12 +82,12 @@ Alternatively you can add dependencies for the specific services you use only:
8282
<dependency>
8383
<groupId>software.amazon.awssdk</groupId>
8484
<artifactId>ec2</artifactId>
85-
<version>2.10.42</version>
85+
<version>2.10.43</version>
8686
</dependency>
8787
<dependency>
8888
<groupId>software.amazon.awssdk</groupId>
8989
<artifactId>s3</artifactId>
90-
<version>2.10.42</version>
90+
<version>2.10.43</version>
9191
</dependency>
9292
```
9393

@@ -99,7 +99,7 @@ You can import the whole SDK into your project (includes *ALL* services). Please
9999
<dependency>
100100
<groupId>software.amazon.awssdk</groupId>
101101
<artifactId>aws-sdk-java</artifactId>
102-
<version>2.10.42</version>
102+
<version>2.10.43</version>
103103
</dependency>
104104
```
105105

aws-sdk-java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>software.amazon.awssdk</groupId>
66
<artifactId>aws-sdk-java-pom</artifactId>
7-
<version>2.10.42</version>
7+
<version>2.10.43</version>
88
<relativePath>../pom.xml</relativePath>
99
</parent>
1010
<artifactId>aws-sdk-java</artifactId>

bom-internal/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>aws-sdk-java-pom</artifactId>
77
<groupId>software.amazon.awssdk</groupId>
8-
<version>2.10.42</version>
8+
<version>2.10.43</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

bom/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>software.amazon.awssdk</groupId>
66
<artifactId>aws-sdk-java-pom</artifactId>
7-
<version>2.10.42</version>
7+
<version>2.10.43</version>
88
<relativePath>../pom.xml</relativePath>
99
</parent>
1010
<artifactId>bom</artifactId>

bundle/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>software.amazon.awssdk</groupId>
2323
<artifactId>aws-sdk-java-pom</artifactId>
24-
<version>2.10.42</version>
24+
<version>2.10.43</version>
2525
</parent>
2626
<artifactId>bundle</artifactId>
2727
<packaging>jar</packaging>

codegen-lite-maven-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>software.amazon.awssdk</groupId>
99
<artifactId>aws-sdk-java-pom</artifactId>
10-
<version>2.10.42</version>
10+
<version>2.10.43</version>
1111
<relativePath>../pom.xml</relativePath>
1212
</parent>
1313
<artifactId>codegen-lite-maven-plugin</artifactId>

codegen-lite/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>software.amazon.awssdk</groupId>
88
<artifactId>aws-sdk-java-pom</artifactId>
9-
<version>2.10.42</version>
9+
<version>2.10.43</version>
1010
</parent>
1111
<artifactId>codegen-lite</artifactId>
1212
<name>AWS Java SDK :: Code Generator Lite</name>

codegen-maven-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>software.amazon.awssdk</groupId>
2424
<artifactId>aws-sdk-java-pom</artifactId>
25-
<version>2.10.42</version>
25+
<version>2.10.43</version>
2626
<relativePath>../pom.xml</relativePath>
2727
</parent>
2828
<artifactId>codegen-maven-plugin</artifactId>

codegen/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>software.amazon.awssdk</groupId>
2323
<artifactId>aws-sdk-java-pom</artifactId>
24-
<version>2.10.42</version>
24+
<version>2.10.43</version>
2525
</parent>
2626
<artifactId>codegen</artifactId>
2727
<name>AWS Java SDK :: Code Generator</name>

codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/AsyncClientClass.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ protected MethodSpec.Builder operationBody(MethodSpec.Builder builder, Operation
194194
.beginControlFlow("try")
195195
.addCode(ClientClassUtils.callApplySignerOverrideMethod(opModel))
196196
.addCode(ClientClassUtils.addEndpointTraitCode(opModel))
197-
.addCode(protocolSpec.responseHandler(model, opModel))
198-
.addCode(protocolSpec.errorResponseHandler(opModel))
199-
.addCode(eventToByteBufferPublisher(opModel));
197+
.addCode(protocolSpec.responseHandler(model, opModel));
198+
protocolSpec.errorResponseHandler(opModel).ifPresent(builder::addCode);
199+
builder.addCode(eventToByteBufferPublisher(opModel));
200200

201201
if (opModel.getEndpointDiscovery() != null) {
202202
builder.addStatement("$T cachedEndpoint = null", URI.class);

codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/SyncClientClass.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,9 @@ private List<MethodSpec> operationMethodSpecs(OperationModel opModel) {
167167
.addAnnotation(Override.class)
168168
.addCode(ClientClassUtils.callApplySignerOverrideMethod(opModel))
169169
.addCode(ClientClassUtils.addEndpointTraitCode(opModel))
170-
.addCode(protocolSpec.responseHandler(model, opModel))
171-
.addCode(protocolSpec.errorResponseHandler(opModel));
170+
.addCode(protocolSpec.responseHandler(model, opModel));
171+
172+
protocolSpec.errorResponseHandler(opModel).ifPresent(method::addCode);
172173

173174
if (opModel.getEndpointDiscovery() != null) {
174175
method.addStatement("$T cachedEndpoint = null", URI.class);

codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/JsonProtocolSpec.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,14 @@ public CodeBlock responseHandler(IntermediateModel model, OperationModel opModel
143143
}
144144

145145
@Override
146-
public CodeBlock errorResponseHandler(OperationModel opModel) {
146+
public Optional<CodeBlock> errorResponseHandler(OperationModel opModel) {
147147
String protocolFactory = protocolFactoryLiteral(model, opModel);
148148

149-
return CodeBlock
150-
.builder()
151-
.add("\n\n$T<$T> errorResponseHandler = createErrorResponseHandler($L, operationMetadata);",
152-
HttpResponseHandler.class, AwsServiceException.class, protocolFactory)
153-
.build();
149+
return Optional.of(
150+
CodeBlock.builder()
151+
.add("\n\n$T<$T> errorResponseHandler = createErrorResponseHandler($L, operationMetadata);",
152+
HttpResponseHandler.class, AwsServiceException.class, protocolFactory)
153+
.build());
154154
}
155155

156156
@Override

codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/ProtocolSpec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public interface ProtocolSpec {
4646

4747
CodeBlock responseHandler(IntermediateModel model, OperationModel opModel);
4848

49-
CodeBlock errorResponseHandler(OperationModel opModel);
49+
Optional<CodeBlock> errorResponseHandler(OperationModel opModel);
5050

5151
CodeBlock executionHandler(OperationModel opModel);
5252

codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/QueryProtocolSpec.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
public class QueryProtocolSpec implements ProtocolSpec {
3636

3737
protected final PoetExtensions poetExtensions;
38-
private final IntermediateModel intermediateModel;
38+
protected final IntermediateModel intermediateModel;
3939

4040
public QueryProtocolSpec(IntermediateModel intermediateModel, PoetExtensions poetExtensions) {
4141
this.intermediateModel = intermediateModel;
@@ -84,10 +84,12 @@ public CodeBlock responseHandler(IntermediateModel model,
8484
}
8585

8686
@Override
87-
public CodeBlock errorResponseHandler(OperationModel opModel) {
88-
return CodeBlock.builder().add("\n\n$T errorResponseHandler = protocolFactory.createErrorResponseHandler();",
89-
ParameterizedTypeName.get(HttpResponseHandler.class, AwsServiceException.class))
90-
.build();
87+
public Optional<CodeBlock> errorResponseHandler(OperationModel opModel) {
88+
return Optional.of(
89+
CodeBlock.builder()
90+
.add("\n\n$T errorResponseHandler = protocolFactory.createErrorResponseHandler();",
91+
ParameterizedTypeName.get(HttpResponseHandler.class, AwsServiceException.class))
92+
.build());
9193
}
9294

9395
@Override

codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/XmlProtocolSpec.java

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717

1818
import com.squareup.javapoet.ClassName;
1919
import com.squareup.javapoet.CodeBlock;
20+
import com.squareup.javapoet.ParameterizedTypeName;
21+
import com.squareup.javapoet.TypeName;
22+
23+
import java.util.Optional;
24+
2025
import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel;
2126
import software.amazon.awssdk.codegen.model.intermediate.OperationModel;
2227
import software.amazon.awssdk.codegen.poet.PoetExtensions;
@@ -49,6 +54,29 @@ protected Class<?> protocolFactoryClass() {
4954
@Override
5055
public CodeBlock responseHandler(IntermediateModel model,
5156
OperationModel opModel) {
57+
58+
if (opModel.hasStreamingOutput()) {
59+
return streamingResponseHandler(opModel);
60+
}
61+
62+
ClassName responseType = poetExtensions.getModelClass(opModel.getReturnType().getReturnType());
63+
64+
TypeName handlerType = ParameterizedTypeName.get(
65+
ClassName.get(HttpResponseHandler.class),
66+
ParameterizedTypeName.get(ClassName.get(software.amazon.awssdk.core.Response.class), responseType));
67+
68+
return CodeBlock.builder()
69+
.addStatement("\n\n$T responseHandler = protocolFactory.createCombinedResponseHandler"
70+
+ "($T::builder,"
71+
+ "new $T().withHasStreamingSuccessResponse($L))",
72+
handlerType,
73+
responseType,
74+
XmlOperationMetadata.class,
75+
opModel.hasStreamingOutput())
76+
.build();
77+
}
78+
79+
private CodeBlock streamingResponseHandler(OperationModel opModel) {
5280
ClassName responseType = poetExtensions.getModelClass(opModel.getReturnType().getReturnType());
5381

5482
return CodeBlock.builder()
@@ -62,4 +90,92 @@ public CodeBlock responseHandler(IntermediateModel model,
6290
.build();
6391
}
6492

93+
@Override
94+
public Optional<CodeBlock> errorResponseHandler(OperationModel opModel) {
95+
return opModel.hasStreamingOutput() ? streamingErrorResponseHandler(opModel) : Optional.empty();
96+
}
97+
98+
private Optional<CodeBlock> streamingErrorResponseHandler(OperationModel opModel) {
99+
return super.errorResponseHandler(opModel);
100+
}
101+
102+
@Override
103+
public CodeBlock executionHandler(OperationModel opModel) {
104+
if (opModel.hasStreamingOutput()) {
105+
return streamingExecutionHandler(opModel);
106+
}
107+
108+
TypeName responseType = poetExtensions.getModelClass(opModel.getReturnType().getReturnType());
109+
ClassName requestType = poetExtensions.getModelClass(opModel.getInput().getVariableType());
110+
ClassName marshaller = poetExtensions.getTransformClass(opModel.getInputShape().getShapeName() + "Marshaller");
111+
CodeBlock.Builder codeBlock = CodeBlock
112+
.builder()
113+
.add("\n\nreturn clientHandler.execute(new $T<$T, $T>()" +
114+
".withOperationName(\"$N\")\n" +
115+
".withCombinedResponseHandler($N)" +
116+
hostPrefixExpression(opModel) +
117+
discoveredEndpoint(opModel) +
118+
".withInput($L)",
119+
software.amazon.awssdk.core.client.handler.ClientExecutionParams.class,
120+
requestType,
121+
responseType,
122+
opModel.getOperationName(),
123+
"responseHandler",
124+
opModel.getInput().getVariableName());
125+
if (opModel.hasStreamingInput()) {
126+
return codeBlock.add(".withRequestBody(requestBody)")
127+
.add(".withMarshaller($L));", syncStreamingMarshaller(intermediateModel, opModel, marshaller))
128+
.build();
129+
}
130+
return codeBlock.add(".withMarshaller(new $T(protocolFactory)) $L);", marshaller,
131+
opModel.hasStreamingOutput() ? ", responseTransformer" : "").build();
132+
}
133+
134+
private CodeBlock streamingExecutionHandler(OperationModel opModel) {
135+
return super.executionHandler(opModel);
136+
}
137+
138+
@Override
139+
public CodeBlock asyncExecutionHandler(IntermediateModel intermediateModel, OperationModel opModel) {
140+
if (opModel.hasStreamingOutput()) {
141+
return asyncStreamingExecutionHandler(intermediateModel, opModel);
142+
}
143+
144+
ClassName pojoResponseType = poetExtensions.getModelClass(opModel.getReturnType().getReturnType());
145+
ClassName requestType = poetExtensions.getModelClass(opModel.getInput().getVariableType());
146+
ClassName marshaller = poetExtensions.getRequestTransformClass(opModel.getInputShape().getShapeName() + "Marshaller");
147+
148+
String asyncRequestBody = opModel.hasStreamingInput() ? ".withAsyncRequestBody(requestBody)"
149+
: "";
150+
TypeName executeFutureValueType = executeFutureValueType(opModel, poetExtensions);
151+
CodeBlock.Builder builder =
152+
CodeBlock.builder().add("\n\n$T<$T> executeFuture = clientHandler.execute(new $T<$T, $T>()"
153+
+ "\n" +
154+
".withOperationName(\"$N\")\n" +
155+
".withMarshaller($L)" +
156+
".withCombinedResponseHandler($N)" +
157+
hostPrefixExpression(opModel) +
158+
asyncRequestBody +
159+
".withInput($L) $L);",
160+
java.util.concurrent.CompletableFuture.class,
161+
executeFutureValueType,
162+
software.amazon.awssdk.core.client.handler.ClientExecutionParams.class,
163+
requestType,
164+
pojoResponseType,
165+
opModel.getOperationName(),
166+
asyncMarshaller(intermediateModel, opModel, marshaller, "protocolFactory"),
167+
"responseHandler",
168+
opModel.getInput().getVariableName(),
169+
opModel.hasStreamingOutput() ? ", asyncResponseTransformer" : "");
170+
171+
if (opModel.hasStreamingOutput()) {
172+
builder.add("executeFuture$L;", streamingOutputWhenComplete("asyncResponseTransformer"));
173+
}
174+
builder.addStatement("return executeFuture");
175+
return builder.build();
176+
}
177+
178+
private CodeBlock asyncStreamingExecutionHandler(IntermediateModel intermediateModel, OperationModel opModel) {
179+
return super.asyncExecutionHandler(intermediateModel, opModel);
180+
}
65181
}

core/annotations/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>core</artifactId>
77
<groupId>software.amazon.awssdk</groupId>
8-
<version>2.10.42</version>
8+
<version>2.10.43</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

0 commit comments

Comments
 (0)