Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2015-2015 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.
  */
 package com.amazonaws.services.s3.model;
 
 import java.util.Map;
 
Replication configuration for an Amazon S3 bucket.
 
 public class BucketReplicationConfiguration {

    
The ARN of the IAM role that Amazon S3 assumes while replication.
 
     private String roleARN;

    
Collection of replication rules associated with the Amazon S3 bucket.
 
     private Map<StringReplicationRulerules = new HashMap<StringReplicationRule>();

    
Returns the IAM role associated with this replication configuration.
 
     public String getRoleARN() {
         return ;
     }

    
Sets the IAM role that will be used by Amazon S3 while replication.

Parameters:
role The IAM role for this configuration.
 
     public void setRoleARN(String roleARN) {
         this. = roleARN;
     }

    
Sets the IAM role that will be used by Amazon S3 while replication. Returns the updated object.

Parameters:
roleARN The IAM role for this configuration.
Returns:
The updated BucketReplicationConfiguration object.
 
     public BucketReplicationConfiguration withRoleARN(String roleARN) {
         setRoleARN(roleARN);
         return this;
     }

    
Returns the replication rules associated with this Amazon S3 bucket.

Returns:
the replication rules associated with this Amazon S3 bucket.
 
     public Map<StringReplicationRulegetRules() {
         return ;
     }

    
Returns the replication rule for the given rule id.

Parameters:
id the unique identifier representing a rule in the replication configuration.
Returns:
the replication rule for the given rule id.
 
     public ReplicationRule getRule(String id) {
         return .get(id);
     }

    
Sets the replication rules for the Amazon S3 bucket.

Parameters:
rules the replication rules for the Amazon S3 bucket.
Throws:
java.lang.IllegalArgumentException if the rules are null.
 
     public void setRules(Map<StringReplicationRulerules) {
         if (rules == null) {
             throw new IllegalArgumentException(
                     "Replication rules cannot be null");
         }
         this. = new HashMap<StringReplicationRule>(rules);
     }

    
Sets the replication rules for the Amazon S3 bucket. Returns the updated object.

Parameters:
rules the replication rules for the Amazon S3 bucket.
Returns:
the updated BucketReplicationConfiguration object.
Throws:
java.lang.IllegalArgumentException if the rules are null.
            Map<StringReplicationRulerules) {
        setRules(rules);
        return this;
    }

    
Adds a new rule to the replication configuration associated with this Amazon S3 bucket. Returns the updated object.

Parameters:
id the id for the rule.
rule the replication rule for the Amazon S3 bucket.
Returns:
the updated BucketReplicationConfiguration object.
Throws:
java.lang.IllegalArgumentException if the given id or rule is null.
            ReplicationRule rule) {
        if (id == null || id.trim().isEmpty()) {
            throw new IllegalArgumentException(
                    "Rule id cannot be null or empty.");
        }
        if (rule == null) {
            throw new IllegalArgumentException(
                    "Replication rule cannot be null");
        }
        .put(idrule);
        return this;
    }

    
Removes the replication rule with the given id from the replication configuration associated with Amazon S3 bucket. Returns the updated object.

Parameters:
id the id of the replication rule to be removed.
Returns:
the updated BucketReplicationConfiguration object.
        .remove(id);
        return this;
    }
    @Override
    public String toString() {
        return Jackson.toJsonString(this);
    }
New to GrepCode? Check out our FAQ X