-
Notifications
You must be signed in to change notification settings - Fork 916
S3 Event Notifications parsers #4994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
2788880
s3-event-notifications new module
L-Applin 0ebbd61
fix pom.xml
L-Applin 58fdfbd
Equals, hashcode, tostring. More tests. Remove Entity suffix.
L-Applin cafd7db
handle null fields
L-Applin 40c0dc5
Checkstyle
L-Applin 7279f14
changelog
L-Applin 966b54a
new module checklist
L-Applin bcf053a
readme, extra fields, cleanup
L-Applin 084c26f
Merge branch 'master' into olapplin/s3-event-notifications
L-Applin e675f43
remove duplicate dependency
L-Applin 8ddc4a7
Merge branch 'master' into olapplin/s3-event-notifications
L-Applin 1817363
update pom version
L-Applin ab0772c
Merge remote-tracking branch 'origin/olapplin/s3-event-notifications'…
L-Applin b857f39
update pom version, for real this time
L-Applin 6b09103
fix pom
L-Applin 2833c78
cleanup
L-Applin bba4278
documentation
L-Applin 832cd86
PR comments
L-Applin 639a429
Merge branch 'master' into olapplin/s3-event-notifications
L-Applin 8c7bc7c
update pom, again
L-Applin 41ef25b
Merge remote-tracking branch 'origin/olapplin/s3-event-notifications'…
L-Applin d67ef05
PR comment:
L-Applin 0677e9a
Suppress non-final fields in EqualsVerifier test.
L-Applin 2a9e585
Merge branch 'master' into olapplin/s3-event-notifications
L-Applin 1726d40
update pom to 2.25.7-SNAPSHOT
L-Applin 5c10d19
make S3EventNotificationRecord test constructor package-protected
L-Applin 3813c10
Merge branch 'master' into olapplin/s3-event-notifications
L-Applin d2bf9f9
Merge branch 'master' into olapplin/s3-event-notifications
L-Applin 19a0c97
maven version
L-Applin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"type": "feature", | ||
"category": "AWS SDK for Java v2", | ||
"contributor": "", | ||
"description": "Add the model for S3 Event Notifications and json parsers for them" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# S3 Event Notifications | ||
|
||
## Overview | ||
|
||
This module contains the classes used to represent Amazon S3 Event Notifications. | ||
|
||
|
||
## Deserialization | ||
|
||
To convert a json notification to java classes, use the static methods | ||
available on `S3EventNotification`: | ||
|
||
```java | ||
String json = "..."; // the notification as json | ||
S3EventNotification event = S3EventNotification.fromJson(json); | ||
event.getRecords().forEach(rec -> println(rec.toString())); | ||
``` | ||
|
||
Any missing fields of the json will be null in the resulting object. | ||
Any extra fields will be ignored. | ||
|
||
|
||
## Serialization | ||
|
||
To convert an instance of `S3EventNotification` to json, use the `.toJson()` | ||
or `toJsonPretty()` method: | ||
|
||
```java | ||
S3EventNotification event = new S3EventNotification(...); | ||
String json = event.toJson(); | ||
String jsonPretty = event.toJsonPretty(); | ||
``` | ||
|
||
`GlacierEventData`, `ReplicationEventData`, `IntelligentTieringEventData` and `LifecycleEventData` | ||
will be excluded from the json if null. Any other null fields of the object will be | ||
serialized in the json as `null`. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright 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 | ||
~ permissions and limitations under the License. | ||
--> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>software.amazon.awssdk</groupId> | ||
<artifactId>aws-sdk-java-pom</artifactId> | ||
<version>2.25.7-SNAPSHOT</version> | ||
<relativePath>../../pom.xml</relativePath> | ||
</parent> | ||
<artifactId>s3-event-notifications</artifactId> | ||
<name>AWS Java SDK :: S3 :: Event Notification</name> | ||
<description> | ||
The AWS SDK for Java - S3 Even Notification contains POJO classes and utils method to help serialize and | ||
deserialize Amazon S3 Event Notifications. | ||
</description> | ||
|
||
<properties> | ||
<jre.version>1.8</jre.version> | ||
<awsjavasdk.version>${project.parent.version}</awsjavasdk.version> | ||
</properties> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>software.amazon.awssdk</groupId> | ||
<artifactId>bom-internal</artifactId> | ||
<version>${awsjavasdk.version}</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>software.amazon.awssdk</groupId> | ||
<artifactId>third-party-jackson-core</artifactId> | ||
<version>${awsjavasdk.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>software.amazon.awssdk</groupId> | ||
<artifactId>json-utils</artifactId> | ||
<version>${awsjavasdk.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>software.amazon.awssdk</groupId> | ||
<artifactId>annotations</artifactId> | ||
<version>${awsjavasdk.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>software.amazon.awssdk</groupId> | ||
<artifactId>utils</artifactId> | ||
<version>${awsjavasdk.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-engine</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>nl.jqno.equalsverifier</groupId> | ||
<artifactId>equalsverifier</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<configuration> | ||
<archive> | ||
<manifestEntries> | ||
<Automatic-Module-Name>software.amazon.awssdk.eventnotifications.s3</Automatic-Module-Name> | ||
</manifestEntries> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.