-
Notifications
You must be signed in to change notification settings - Fork 863
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
S3 Event Notifications parsers (#4994)
* s3-event-notifications new module * fix pom.xml * Equals, hashcode, tostring. More tests. Remove Entity suffix. * handle null fields * Checkstyle * changelog * new module checklist * readme, extra fields, cleanup * remove duplicate dependency * update pom version * update pom version, for real this time * fix pom * cleanup * documentation * PR comments - refactor expectStringOrNull - Added GlacierEventData documentation - removed some explicit version in pom * update pom, again * PR comment: - make S3EventNotificationRecord SdkTestInternalApi only and use getters instead * Suppress non-final fields in EqualsVerifier test. * update pom to 2.25.7-SNAPSHOT * make S3EventNotificationRecord test constructor package-protected * maven version
- Loading branch information
Showing
34 changed files
with
3,070 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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.11-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.