com.amazonaws.services.s3.model
Class BucketNotificationConfiguration

java.lang.Object
  extended by com.amazonaws.services.s3.model.BucketNotificationConfiguration

public class BucketNotificationConfiguration
extends Object

Represents a bucket's notification configuration. The notification configuration is used to control reception of notifications for specific events for Amazon S3 buckets.

Using SNS as the delivery service, the notification configuration of an Amazon S3 bucket provides near real-time notifications of events the user is interested in. Notification is turned on by enabling configuration on a bucket, specifying the events and the SNS topic. This configuration can only be turned on by the bucket owner.

If a notification configuration already exists for the specified bucket, the new notification configuration will replace the existing notification configuration. To remove a notification configuration, pass an an empty configuration directly to AmazonS3.setBucketNotificationConfiguration(String,BucketNotificationConfiguration).

Note: Currently buckets may only have a single event and topic configuration.

See Also:
AmazonS3.getBucketNotificationConfiguration(String), AmazonS3.setBucketNotificationConfiguration(String, BucketNotificationConfiguration)

Nested Class Summary
static class BucketNotificationConfiguration.TopicConfiguration
           Represents the SNS topic to publish event notification to.
 
Constructor Summary
BucketNotificationConfiguration()
           Creates a new bucket notification configuration.
BucketNotificationConfiguration(Collection<BucketNotificationConfiguration.TopicConfiguration> topicConfigurations)
           Creates a new bucket notification configuration containing the specified TopicConfigurations.
 
Method Summary
 List<BucketNotificationConfiguration.TopicConfiguration> getTopicConfigurations()
           Gets the list of BucketNotificationConfiguration.TopicConfiguration objects contained in this object.
 void setTopicConfigurations(Collection<BucketNotificationConfiguration.TopicConfiguration> topicConfigurations)
           Sets the BucketNotificationConfiguration.TopicConfiguration.
 String toString()
           
 BucketNotificationConfiguration withTopicConfigurations(BucketNotificationConfiguration.TopicConfiguration... topicConfigurations)
           Sets the BucketNotificationConfiguration.TopicConfiguration TopicConfigurations and returns this object, enabling additional method calls to be chained together.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BucketNotificationConfiguration

public BucketNotificationConfiguration()

Creates a new bucket notification configuration. By default, the newly created configuration is empty.

Passing the new configuration directly to AmazonS3.setBucketNotificationConfiguration(String,BucketNotificationConfiguration) will remove any existing bucket notification configuration.

See Also:
BucketNotificationConfiguration(Collection)

BucketNotificationConfiguration

public BucketNotificationConfiguration(Collection<BucketNotificationConfiguration.TopicConfiguration> topicConfigurations)

Creates a new bucket notification configuration containing the specified TopicConfigurations.

Passing the new configuration directly to AmazonS3.setBucketNotificationConfiguration(String,BucketNotificationConfiguration) will set the bucket's notification configuration and overwrite any existing configuration.

See Also:
BucketNotificationConfiguration()
Method Detail

withTopicConfigurations

public BucketNotificationConfiguration withTopicConfigurations(BucketNotificationConfiguration.TopicConfiguration... topicConfigurations)

Sets the BucketNotificationConfiguration.TopicConfiguration TopicConfigurations and returns this object, enabling additional method calls to be chained together.

Calling this method will overwrite any previously set TopicConfigurations for this object.

Parameters:
topicConfigurations - A set of topic configurations.
Returns:
The updated BucketNotificationConfiguration object, enabling additional method calls to be chained together.
See Also:
setTopicConfigurations(Collection)

setTopicConfigurations

public void setTopicConfigurations(Collection<BucketNotificationConfiguration.TopicConfiguration> topicConfigurations)

Sets the BucketNotificationConfiguration.TopicConfiguration.

Calling this method will overwrite any previously set TopicConfigurations for this object.

Parameters:
topicConfigurations - A collection of topic configurations.
See Also:
BucketNotificationConfiguration#withTopicConfigurations(TopicConfiguration)

getTopicConfigurations

public List<BucketNotificationConfiguration.TopicConfiguration> getTopicConfigurations()

Gets the list of BucketNotificationConfiguration.TopicConfiguration objects contained in this object. This method may return an empty list if no TopicConfiguration objects are present.

Returns:
The list of TopicConfiguration objects contained in this object. May return an empty list.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.