Example usage for com.amazonaws.services.s3.model BucketNotificationConfiguration setTopicConfigurations

List of usage examples for com.amazonaws.services.s3.model BucketNotificationConfiguration setTopicConfigurations

Introduction

In this page you can find the example usage for com.amazonaws.services.s3.model BucketNotificationConfiguration setTopicConfigurations.

Prototype

public void setTopicConfigurations(Collection<TopicConfiguration> topicConfigurations) 

Source Link

Document

Sets the BucketNotificationConfiguration.TopicConfiguration .

Usage

From source file:com.eucalyptus.cloudformation.resources.standard.actions.AWSS3BucketResourceAction.java

License:Open Source License

private BucketNotificationConfiguration convertNotificationConfiguration(
        S3NotificationConfiguration notificationConfiguration) {
    BucketNotificationConfiguration bucketNotificationConfiguration = new BucketNotificationConfiguration();
    if (notificationConfiguration.getTopicConfigurations() != null) {
        Collection<BucketNotificationConfiguration.TopicConfiguration> topicConfigurations = Lists
                .newArrayList();//from  w  ww . j  ava 2 s . c o  m
        for (S3NotificationTopicConfiguration s3NotificationTopicConfiguration : notificationConfiguration
                .getTopicConfigurations()) {
            topicConfigurations.add(new BucketNotificationConfiguration.TopicConfiguration(
                    s3NotificationTopicConfiguration.getTopic(), s3NotificationTopicConfiguration.getEvent()));
        }
        bucketNotificationConfiguration.setTopicConfigurations(topicConfigurations);
    }
    return bucketNotificationConfiguration;
}