com.amazonaws.services.s3.model
Class BucketNotificationConfiguration

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

public class BucketNotificationConfiguration
extends Object

Represents bucket notification configuration used to control receiving notifications for specific events for Amazon S3 buckets.

The notification configuration of a bucket provides near realtime notifications of events the user is interested in, using SNS as the delivery service. 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 the notification configuration pass in an empty request. 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, which by default is empty.
BucketNotificationConfiguration(Collection<BucketNotificationConfiguration.TopicConfiguration> topicConfigurations)
          Creates a new bucket notification configuration with the specified TopicConfigurations.
 
Method Summary
 List<BucketNotificationConfiguration.TopicConfiguration> getTopicConfigurations()
           
 void setTopicConfigurations(Collection<BucketNotificationConfiguration.TopicConfiguration> topicConfigurations)
          Sets the TopicConfigurations for this object.
 String toString()
           
 BucketNotificationConfiguration withTopicConfigurations(BucketNotificationConfiguration.TopicConfiguration... topicConfigurations)
          Sets the TopicConfigurations for this object, and returns this object so that additional method calls may 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, which by default is empty.

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


BucketNotificationConfiguration

public BucketNotificationConfiguration(Collection<BucketNotificationConfiguration.TopicConfiguration> topicConfigurations)
Creates a new bucket notification configuration with the specified TopicConfigurations.

Passing this new object directly to AmazonS3.setBucketNotificationConfiguration(String,BucketNotificationConfiguration) will set the bucket's notification configuration.

Method Detail

withTopicConfigurations

public BucketNotificationConfiguration withTopicConfigurations(BucketNotificationConfiguration.TopicConfiguration... topicConfigurations)
Sets the TopicConfigurations for this object, and returns this object so that additional method calls may be chained together.

This method will clear out any previously set TopicConfigurations set for this object.

Parameters:
topicConfigurations - A set of topic configurations.
Returns:
The updated BucketNotificationConfiguration object so that additional method calls may be chained together.

setTopicConfigurations

public void setTopicConfigurations(Collection<BucketNotificationConfiguration.TopicConfiguration> topicConfigurations)
Sets the TopicConfigurations for this object.

This method will clear out any previously set TopicConfigurations set for this object.

Parameters:
topicConfigurations - A collection of topic configurations.

getTopicConfigurations

public List<BucketNotificationConfiguration.TopicConfiguration> getTopicConfigurations()
Returns:
Returns a List of TopicConfigurations present 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.