Changes in the S3 Event Notifications API from version 1 to version 2
This topic details the changes in the S3 Event Notifications API from version 1.x (v1) to version 2 .x (v2) of the AWS SDK for Java.
High-level changes
Structural changes
V1 uses static inner classes for EventNotificationRecord
types and their
attributes, whereas v2 uses separate public classes for
EventNotificationRecord
types.
Naming convention changes
In v1, attribute class names include the suffix Entity, whereas v2 omits this suffix for simpler naming: for example, eventData instead of eventDataEntity.
Changes in dependencies, packages and class names
In v1, S3 Event Notification API classes are transitively imported with along with the
S3 module (artifactId aws-java-sdk-s3
). However, in v2, you need to add a
dependency on the s3-event-notifications
artifact.
Change | v1 | v2 |
---|---|---|
Maven dependencies |
|
|
Package name | com.amazonaws.services.s3.event |
software.amazon.awssdk.eventnotifications.s3.model |
Class names |
S3EventNotification.S3EventNotificationRecord S3EventNotification.GlacierEventDataEntity S3EventNotification.IntelligentTieringEventDataEntity S3EventNotification.LifecycleEventDataEntity S3EventNotification.ReplicationEventDataEntity S3EventNotification.RequestParametersEntity S3EventNotification.ResponseElementsEntity S3EventNotification.RestoreEventDataEntity S3EventNotification.S3BucketEntity S3EventNotification.S3ObjectEntity |
API changes
JSON to
S3EventNotification
and reverse
Use case | v1 | v2 |
---|---|---|
Create S3EventNotification from JSON String |
|
|
Convert S3EventNotification to JSON String |
|
|
Access attributes of
S3EventNotification
Use case | v1 | v2 |
---|---|---|
Retrieve records from a notification |
|
|
Retrieve a record from a list of records |
|
|
Retrieve Glacier event data |
|
|
Retrieve restore event data from a Glacier event |
|
|
Retrieve request parameters |
|
|
Retrieve Intelligent Tiering event data |
|
|
Retrieve lifecyle event data |
|
|
Retrieve event name as enum |
|
|
Retrieve replication event data |
|
|
Retrieve S3 bucket and object information |
|
|
Retrieve user identity information |
|
|
Retrieve response elements |
|
|
Migrate
S3EventNotification
using the aws-lambda-java-events
library.
If you use aws-lambda-java-events