Skip to content

Commit 6c5b8d4

Browse files
authored
Merge pull request #408 from aws/staging/e7276e5a-6291-4641-8a9f-065f5b4a5a13
Pull request: release <- staging/e7276e5a-6291-4641-8a9f-065f5b4a5a13
2 parents 50746d0 + 2787040 commit 6c5b8d4

File tree

240 files changed

+1123
-428
lines changed

Some content is hidden

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

240 files changed

+1123
-428
lines changed

.changes/2.4.5.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"date": "2019-02-11",
3+
"version": "2.4.5",
4+
"entries": [
5+
{
6+
"category": "AWS Elemental MediaPackage",
7+
"type": "feature",
8+
"description": "Adds optional configuration for DASH to compact the manifest by combining duplicate SegmentTemplate tags. Adds optional configuration for DASH SegmentTemplate format to refer to segments by \"Number\" (default) or by \"Time\"."
9+
},
10+
{
11+
"category": "Amazon CloudWatch Logs",
12+
"type": "bugfix",
13+
"description": "Fix infinite pagination bug in CloudWatchLogsClient.getLogEventsPaginator API. See https://github.com/aws/aws-sdk-java-v2/issues/1045"
14+
},
15+
{
16+
"category": "AWS CodeBuild",
17+
"type": "feature",
18+
"description": "Add customized webhook filter support"
19+
},
20+
{
21+
"category": "Amazon AppStream",
22+
"type": "feature",
23+
"description": "This update enables customers to find the start time, max expiration time, and connection status associated with AppStream streaming session."
24+
}
25+
]
26+
}

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# __2.4.5__ __2019-02-11__
2+
## __AWS CodeBuild__
3+
- ### Features
4+
- Add customized webhook filter support
5+
6+
## __AWS Elemental MediaPackage__
7+
- ### Features
8+
- Adds optional configuration for DASH to compact the manifest by combining duplicate SegmentTemplate tags. Adds optional configuration for DASH SegmentTemplate format to refer to segments by "Number" (default) or by "Time".
9+
10+
## __Amazon AppStream__
11+
- ### Features
12+
- This update enables customers to find the start time, max expiration time, and connection status associated with AppStream streaming session.
13+
14+
## __Amazon CloudWatch Logs__
15+
- ### Bugfixes
16+
- Fix infinite pagination bug in CloudWatchLogsClient.getLogEventsPaginator API. See https://github.com/aws/aws-sdk-java-v2/issues/1045
17+
118
# __2.4.4__ __2019-02-08__
219
## __AWS Application Discovery Service__
320
- ### Features

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ You can import the whole SDK into your project (includes all services) as follow
4444
<dependency>
4545
<groupId>software.amazon.awssdk</groupId>
4646
<artifactId>aws-sdk-java</artifactId>
47-
<version>2.4.4</version>
47+
<version>2.4.5</version>
4848
</dependency>
4949
```
5050

@@ -56,12 +56,12 @@ Alternatively you can add dependencies for the specific services you use only:
5656
<dependency>
5757
<groupId>software.amazon.awssdk</groupId>
5858
<artifactId>ec2</artifactId>
59-
<version>2.4.4</version>
59+
<version>2.4.5</version>
6060
</dependency>
6161
<dependency>
6262
<groupId>software.amazon.awssdk</groupId>
6363
<artifactId>s3</artifactId>
64-
<version>2.4.4</version>
64+
<version>2.4.5</version>
6565
</dependency>
6666
```
6767

@@ -75,7 +75,7 @@ To automatically manage module versions (currently all modules have the same ver
7575
<dependency>
7676
<groupId>software.amazon.awssdk</groupId>
7777
<artifactId>bom</artifactId>
78-
<version>2.4.4</version>
78+
<version>2.4.5</version>
7979
<type>pom</type>
8080
<scope>import</scope>
8181
</dependency>

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.4.4</version>
7+
<version>2.4.5</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.4.4</version>
8+
<version>2.4.5</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.4.4</version>
7+
<version>2.4.5</version>
88
<relativePath>../pom.xml</relativePath>
99
</parent>
1010
<artifactId>bom</artifactId>

build-tools/pom.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,22 @@
3838
</configuration>
3939
</plugin>
4040

41+
<plugin>
42+
<groupId>org.apache.maven.plugins</groupId>
43+
<artifactId>maven-javadoc-plugin</artifactId>
44+
<version>3.0.1</version>
45+
</plugin>
46+
4147
<plugin>
4248
<groupId>org.codehaus.mojo</groupId>
4349
<artifactId>build-helper-maven-plugin</artifactId>
50+
<version>3.0.0</version>
4451
</plugin>
4552

4653
<plugin>
4754
<groupId>org.apache.maven.plugins</groupId>
4855
<artifactId>maven-deploy-plugin</artifactId>
49-
<version>3.1.1</version>
56+
<version>2.8.2</version>
5057
<configuration>
5158
<skip>true</skip>
5259
</configuration>

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.4.4</version>
24+
<version>2.4.5</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.4.4</version>
10+
<version>2.4.5</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.4.4</version>
9+
<version>2.4.5</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.4.4</version>
25+
<version>2.4.5</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.4.4</version>
24+
<version>2.4.5</version>
2525
</parent>
2626
<artifactId>codegen</artifactId>
2727
<name>AWS Java SDK :: Code Generator</name>

codegen/src/main/java/software/amazon/awssdk/codegen/emitters/tasks/PaginatorsGeneratorTasks.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,20 @@
2929
import software.amazon.awssdk.codegen.poet.ClassSpec;
3030
import software.amazon.awssdk.codegen.poet.paginators.AsyncResponseClassSpec;
3131
import software.amazon.awssdk.codegen.poet.paginators.SyncResponseClassSpec;
32+
import software.amazon.awssdk.codegen.poet.paginators.customizations.SameTokenAsyncResponseClassSpec;
33+
import software.amazon.awssdk.codegen.poet.paginators.customizations.SameTokenSyncResponseClassSpec;
3234

3335
public class PaginatorsGeneratorTasks extends BaseGeneratorTasks {
3436

37+
private static final String SAME_TOKEN_CUSTOMIZATION = "LastPageHasPreviousToken";
38+
3539
private final String paginatorsClassDir;
40+
private final Map<String, String> customization;
3641

3742
public PaginatorsGeneratorTasks(GeneratorTaskParams dependencies) {
3843
super(dependencies);
3944
this.paginatorsClassDir = dependencies.getPathProvider().getPaginatorsDirectory();
45+
this.customization = dependencies.getModel().getCustomizationConfig().getPaginationCustomization();
4046
}
4147

4248
@Override
@@ -62,12 +68,24 @@ private Stream<GeneratorTask> createSyncAndAsyncTasks(Map.Entry<String, Paginato
6268
private GeneratorTask createSyncTask(Map.Entry<String, PaginatorDefinition> entry) throws IOException {
6369
ClassSpec classSpec = new SyncResponseClassSpec(model, entry.getKey(), entry.getValue());
6470

71+
if (customization != null && customization.containsKey(entry.getKey())) {
72+
if (SAME_TOKEN_CUSTOMIZATION.equals(customization.get(entry.getKey()))) {
73+
classSpec = new SameTokenSyncResponseClassSpec(model, entry.getKey(), entry.getValue());
74+
}
75+
}
76+
6577
return new PoetGeneratorTask(paginatorsClassDir, model.getFileHeader(), classSpec);
6678
}
6779

6880
private GeneratorTask createAsyncTask(Map.Entry<String, PaginatorDefinition> entry) throws IOException {
6981
ClassSpec classSpec = new AsyncResponseClassSpec(model, entry.getKey(), entry.getValue());
7082

83+
if (customization != null && customization.containsKey(entry.getKey())) {
84+
if (SAME_TOKEN_CUSTOMIZATION.equals(customization.get(entry.getKey()))) {
85+
classSpec = new SameTokenAsyncResponseClassSpec(model, entry.getKey(), entry.getValue());
86+
}
87+
}
88+
7189
return new PoetGeneratorTask(paginatorsClassDir, model.getFileHeader(), classSpec);
7290
}
7391

codegen/src/main/java/software/amazon/awssdk/codegen/model/config/customization/CustomizationConfig.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ public class CustomizationConfig {
147147
*/
148148
private String customProtocolFactoryFqcn;
149149

150+
/**
151+
* Map of paginated operations that use custom class generation.
152+
* Key - c2j operation name
153+
* Value - indicates the type of pagination strategy to use
154+
*/
155+
private Map<String, String> paginationCustomization;
156+
150157
private CustomizationConfig() {
151158
}
152159

@@ -378,4 +385,12 @@ public String getCustomProtocolFactoryFqcn() {
378385
public void setCustomProtocolFactoryFqcn(String customProtocolFactoryFqcn) {
379386
this.customProtocolFactoryFqcn = customProtocolFactoryFqcn;
380387
}
388+
389+
public Map<String, String> getPaginationCustomization() {
390+
return paginationCustomization;
391+
}
392+
393+
public void setPaginationCustomization(Map<String, String> paginationCustomization) {
394+
this.paginationCustomization = paginationCustomization;
395+
}
381396
}

codegen/src/main/java/software/amazon/awssdk/codegen/poet/paginators/AsyncResponseClassSpec.java

Lines changed: 24 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
import software.amazon.awssdk.codegen.poet.PoetUtils;
4141
import software.amazon.awssdk.core.async.SdkPublisher;
4242
import software.amazon.awssdk.core.pagination.async.AsyncPageFetcher;
43-
import software.amazon.awssdk.core.pagination.async.EmptySubscription;
4443
import software.amazon.awssdk.core.pagination.async.PaginatedItemsPublisher;
4544
import software.amazon.awssdk.core.pagination.async.ResponsesSubscription;
4645

@@ -49,9 +48,9 @@
4948
*/
5049
public class AsyncResponseClassSpec extends PaginatorsClassSpec {
5150

51+
protected static final String LAST_PAGE_FIELD = "isLastPage";
5252
private static final String SUBSCRIBER = "subscriber";
5353
private static final String SUBSCRIBE_METHOD = "subscribe";
54-
private static final String LAST_PAGE_FIELD = "isLastPage";
5554

5655
public AsyncResponseClassSpec(IntermediateModel model, String c2jOperationName, PaginatorDefinition paginatorDefinition) {
5756
super(model, c2jOperationName, paginatorDefinition);
@@ -63,19 +62,14 @@ public TypeSpec poetSpec() {
6362
.addModifiers(Modifier.PUBLIC)
6463
.addAnnotation(PoetUtils.generatedAnnotation())
6564
.addSuperinterface(getAsyncResponseInterface())
66-
.addFields(Stream.of(asyncClientInterfaceField(),
67-
requestClassField(),
68-
asyncPageFetcherField(),
69-
lastPageField())
70-
.collect(Collectors.toList()))
65+
.addFields(fields().collect(Collectors.toList()))
7166
.addMethod(publicConstructor())
7267
.addMethod(privateConstructor())
7368
.addMethod(subscribeMethod())
7469
.addMethods(getMethodSpecsForResultKeyList())
75-
.addMethod(resumeMethod())
7670
.addJavadoc(paginationDocs.getDocsForAsyncResponseClass(
7771
getAsyncClientInterfaceName()))
78-
.addType(nextPageFetcherClass());
72+
.addType(nextPageFetcherClass().build());
7973

8074
return specBuilder.build();
8175
}
@@ -95,23 +89,30 @@ private TypeName getAsyncResponseInterface() {
9589
/**
9690
* @return A Poet {@link ClassName} for the async client interface
9791
*/
98-
private ClassName getAsyncClientInterfaceName() {
92+
protected ClassName getAsyncClientInterfaceName() {
9993
return poetExtensions.getClientClass(model.getMetadata().getAsyncInterface());
10094
}
10195

102-
private FieldSpec asyncClientInterfaceField() {
96+
protected Stream<FieldSpec> fields() {
97+
return Stream.of(asyncClientInterfaceField(),
98+
requestClassField(),
99+
asyncPageFetcherField(),
100+
lastPageField());
101+
}
102+
103+
protected FieldSpec asyncClientInterfaceField() {
103104
return FieldSpec.builder(getAsyncClientInterfaceName(), CLIENT_MEMBER, Modifier.PRIVATE, Modifier.FINAL).build();
104105
}
105106

106107
private FieldSpec asyncPageFetcherField() {
107108
return FieldSpec.builder(AsyncPageFetcher.class, NEXT_PAGE_FETCHER_MEMBER, Modifier.PRIVATE, Modifier.FINAL).build();
108109
}
109110

110-
private FieldSpec lastPageField() {
111+
protected FieldSpec lastPageField() {
111112
return FieldSpec.builder(boolean.class, LAST_PAGE_FIELD, Modifier.PRIVATE).build();
112113
}
113114

114-
private MethodSpec publicConstructor() {
115+
protected MethodSpec publicConstructor() {
115116
return MethodSpec.constructorBuilder()
116117
.addModifiers(Modifier.PUBLIC)
117118
.addParameter(getAsyncClientInterfaceName(), CLIENT_MEMBER)
@@ -120,7 +121,7 @@ private MethodSpec publicConstructor() {
120121
.build();
121122
}
122123

123-
private MethodSpec privateConstructor() {
124+
protected MethodSpec privateConstructor() {
124125
return MethodSpec.constructorBuilder()
125126
.addModifiers(Modifier.PRIVATE)
126127
.addParameter(getAsyncClientInterfaceName(), CLIENT_MEMBER)
@@ -143,11 +144,16 @@ private MethodSpec subscribeMethod() {
143144
.addParameter(ParameterizedTypeName.get(ClassName.get(Subscriber.class),
144145
WildcardTypeName.supertypeOf(responseType())),
145146
SUBSCRIBER)
146-
.addStatement("$1L.onSubscribe($2T.builder().$1L($1L).$3L($3L).build())",
147-
SUBSCRIBER, ResponsesSubscription.class, NEXT_PAGE_FETCHER_MEMBER)
147+
.addStatement("$1L.onSubscribe($2T.builder().$1L($1L).$3L($4L).build())",
148+
SUBSCRIBER, ResponsesSubscription.class,
149+
NEXT_PAGE_FETCHER_MEMBER, nextPageFetcherArgument())
148150
.build();
149151
}
150152

153+
protected String nextPageFetcherArgument() {
154+
return NEXT_PAGE_FETCHER_MEMBER;
155+
}
156+
151157
/**
152158
* Returns iterable of {@link MethodSpec} to generate helper methods for all members
153159
* in {@link PaginatorDefinition#getResultKey()}.
@@ -220,7 +226,7 @@ PaginatedItemsPublisher.class, NEXT_PAGE_FETCHER_MEMBER, nextPageFetcherClassNam
220226
* Generates a inner class that implements {@link AsyncPageFetcher}. This is a helper class that can be used
221227
* to find if there are more pages in the response and to get the next page if exists.
222228
*/
223-
private TypeSpec nextPageFetcherClass() {
229+
protected TypeSpec.Builder nextPageFetcherClass() {
224230
return TypeSpec.classBuilder(nextPageFetcherClassName())
225231
.addModifiers(Modifier.PRIVATE)
226232
.addSuperinterface(ParameterizedTypeName.get(ClassName.get(AsyncPageFetcher.class), responseType()))
@@ -238,29 +244,6 @@ private TypeSpec nextPageFetcherClass() {
238244
.returns(ParameterizedTypeName.get(ClassName.get(CompletableFuture.class),
239245
responseType()))
240246
.addCode(nextPageMethodBody())
241-
.build())
242-
.build();
243-
}
244-
245-
private MethodSpec resumeMethod() {
246-
return resumeMethodBuilder().addCode(CodeBlock.builder()
247-
.addStatement("return $L", anonymousClassWithEmptySubscription())
248-
.build())
249-
.build();
250-
}
251-
252-
private TypeSpec anonymousClassWithEmptySubscription() {
253-
return TypeSpec.anonymousClassBuilder("$L, $L, true", CLIENT_MEMBER, REQUEST_MEMBER)
254-
.addSuperinterface(className())
255-
.addMethod(MethodSpec.methodBuilder(SUBSCRIBE_METHOD)
256-
.addAnnotation(Override.class)
257-
.addModifiers(Modifier.PUBLIC)
258-
.addParameter(ParameterizedTypeName.get(ClassName.get(Subscriber.class),
259-
WildcardTypeName.supertypeOf(responseType())),
260-
SUBSCRIBER)
261-
.addStatement("$L.onSubscribe(new $T($L))", SUBSCRIBER,
262-
TypeName.get(EmptySubscription.class), SUBSCRIBER)
263-
.build())
264-
.build();
247+
.build());
265248
}
266249
}

0 commit comments

Comments
 (0)