com.amazonaws.services.s3control.model.ReplicationRule Maven / Gradle / Ivy
Show all versions of aws-java-sdk-s3control Show documentation
/*
* Copyright 2019-2024 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.s3control.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* Specifies which S3 on Outposts objects to replicate and where to store the replicas.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ReplicationRule implements Serializable, Cloneable {
/**
*
* A unique identifier for the rule. The maximum value is 255 characters.
*
*/
private String iD;
/**
*
* The priority indicates which rule has precedence whenever two or more replication rules conflict. S3 on Outposts
* attempts to replicate objects according to all replication rules. However, if there are two or more rules with
* the same destination Outposts bucket, then objects will be replicated according to the rule with the highest
* priority. The higher the number, the higher the priority.
*
*
* For more information, see Creating
* replication rules on Outposts in the Amazon S3 User Guide.
*
*/
private Integer priority;
/**
*
* An object key name prefix that identifies the object or objects to which the rule applies. The maximum prefix
* length is 1,024 characters. To include all objects in an Outposts bucket, specify an empty string.
*
*
*
* When you're using XML requests, you must replace special characters (such as carriage returns) in object keys
* with their equivalent XML entity codes. For more information, see
* XML-related object key constraints in the Amazon S3 User Guide.
*
*
*/
@Deprecated
private String prefix;
/**
*
* A filter that identifies the subset of objects to which the replication rule applies. A Filter
* element must specify exactly one Prefix
, Tag
, or And
child element.
*
*/
private ReplicationRuleFilter filter;
/**
*
* Specifies whether the rule is enabled.
*
*/
private String status;
/**
*
* A container that describes additional filters for identifying the source Outposts objects that you want to
* replicate. You can choose to enable or disable the replication of these objects.
*
*/
private SourceSelectionCriteria sourceSelectionCriteria;
/**
*
* An optional configuration to replicate existing source bucket objects.
*
*
*
* This is not supported by Amazon S3 on Outposts buckets.
*
*
*/
private ExistingObjectReplication existingObjectReplication;
/**
*
* A container for information about the replication destination and its configurations.
*
*/
private Destination destination;
/**
*
* Specifies whether S3 on Outposts replicates delete markers. If you specify a Filter
element in your
* replication configuration, you must also include a DeleteMarkerReplication
element. If your
* Filter
includes a Tag
element, the DeleteMarkerReplication
element's
* Status
child element must be set to Disabled
, because S3 on Outposts doesn't support
* replicating delete markers for tag-based rules.
*
*
* For more information about delete marker replication, see How delete operations affect replication in the Amazon S3 User Guide.
*
*/
private DeleteMarkerReplication deleteMarkerReplication;
/**
*
* The Amazon Resource Name (ARN) of the access point for the source Outposts bucket that you want S3 on Outposts to
* replicate the objects from.
*
*/
private String bucket;
/**
*
* A unique identifier for the rule. The maximum value is 255 characters.
*
*
* @param iD
* A unique identifier for the rule. The maximum value is 255 characters.
*/
public void setID(String iD) {
this.iD = iD;
}
/**
*
* A unique identifier for the rule. The maximum value is 255 characters.
*
*
* @return A unique identifier for the rule. The maximum value is 255 characters.
*/
public String getID() {
return this.iD;
}
/**
*
* A unique identifier for the rule. The maximum value is 255 characters.
*
*
* @param iD
* A unique identifier for the rule. The maximum value is 255 characters.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReplicationRule withID(String iD) {
setID(iD);
return this;
}
/**
*
* The priority indicates which rule has precedence whenever two or more replication rules conflict. S3 on Outposts
* attempts to replicate objects according to all replication rules. However, if there are two or more rules with
* the same destination Outposts bucket, then objects will be replicated according to the rule with the highest
* priority. The higher the number, the higher the priority.
*
*
* For more information, see Creating
* replication rules on Outposts in the Amazon S3 User Guide.
*
*
* @param priority
* The priority indicates which rule has precedence whenever two or more replication rules conflict. S3 on
* Outposts attempts to replicate objects according to all replication rules. However, if there are two or
* more rules with the same destination Outposts bucket, then objects will be replicated according to the
* rule with the highest priority. The higher the number, the higher the priority.
*
* For more information, see Creating
* replication rules on Outposts in the Amazon S3 User Guide.
*/
public void setPriority(Integer priority) {
this.priority = priority;
}
/**
*
* The priority indicates which rule has precedence whenever two or more replication rules conflict. S3 on Outposts
* attempts to replicate objects according to all replication rules. However, if there are two or more rules with
* the same destination Outposts bucket, then objects will be replicated according to the rule with the highest
* priority. The higher the number, the higher the priority.
*
*
* For more information, see Creating
* replication rules on Outposts in the Amazon S3 User Guide.
*
*
* @return The priority indicates which rule has precedence whenever two or more replication rules conflict. S3 on
* Outposts attempts to replicate objects according to all replication rules. However, if there are two or
* more rules with the same destination Outposts bucket, then objects will be replicated according to the
* rule with the highest priority. The higher the number, the higher the priority.
*
* For more information, see Creating
* replication rules on Outposts in the Amazon S3 User Guide.
*/
public Integer getPriority() {
return this.priority;
}
/**
*
* The priority indicates which rule has precedence whenever two or more replication rules conflict. S3 on Outposts
* attempts to replicate objects according to all replication rules. However, if there are two or more rules with
* the same destination Outposts bucket, then objects will be replicated according to the rule with the highest
* priority. The higher the number, the higher the priority.
*
*
* For more information, see Creating
* replication rules on Outposts in the Amazon S3 User Guide.
*
*
* @param priority
* The priority indicates which rule has precedence whenever two or more replication rules conflict. S3 on
* Outposts attempts to replicate objects according to all replication rules. However, if there are two or
* more rules with the same destination Outposts bucket, then objects will be replicated according to the
* rule with the highest priority. The higher the number, the higher the priority.
*
* For more information, see Creating
* replication rules on Outposts in the Amazon S3 User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReplicationRule withPriority(Integer priority) {
setPriority(priority);
return this;
}
/**
*
* An object key name prefix that identifies the object or objects to which the rule applies. The maximum prefix
* length is 1,024 characters. To include all objects in an Outposts bucket, specify an empty string.
*
*
*
* When you're using XML requests, you must replace special characters (such as carriage returns) in object keys
* with their equivalent XML entity codes. For more information, see
* XML-related object key constraints in the Amazon S3 User Guide.
*
*
*
* @param prefix
* An object key name prefix that identifies the object or objects to which the rule applies. The maximum
* prefix length is 1,024 characters. To include all objects in an Outposts bucket, specify an empty
* string.
*
* When you're using XML requests, you must replace special characters (such as carriage returns) in object
* keys with their equivalent XML entity codes. For more information, see XML-related object key constraints in the Amazon S3 User Guide.
*
*/
@Deprecated
public void setPrefix(String prefix) {
this.prefix = prefix;
}
/**
*
* An object key name prefix that identifies the object or objects to which the rule applies. The maximum prefix
* length is 1,024 characters. To include all objects in an Outposts bucket, specify an empty string.
*
*
*
* When you're using XML requests, you must replace special characters (such as carriage returns) in object keys
* with their equivalent XML entity codes. For more information, see
* XML-related object key constraints in the Amazon S3 User Guide.
*
*
*
* @return An object key name prefix that identifies the object or objects to which the rule applies. The maximum
* prefix length is 1,024 characters. To include all objects in an Outposts bucket, specify an empty
* string.
*
* When you're using XML requests, you must replace special characters (such as carriage returns) in object
* keys with their equivalent XML entity codes. For more information, see XML-related object key constraints in the Amazon S3 User Guide.
*
*/
@Deprecated
public String getPrefix() {
return this.prefix;
}
/**
*
* An object key name prefix that identifies the object or objects to which the rule applies. The maximum prefix
* length is 1,024 characters. To include all objects in an Outposts bucket, specify an empty string.
*
*
*
* When you're using XML requests, you must replace special characters (such as carriage returns) in object keys
* with their equivalent XML entity codes. For more information, see
* XML-related object key constraints in the Amazon S3 User Guide.
*
*
*
* @param prefix
* An object key name prefix that identifies the object or objects to which the rule applies. The maximum
* prefix length is 1,024 characters. To include all objects in an Outposts bucket, specify an empty
* string.
*
* When you're using XML requests, you must replace special characters (such as carriage returns) in object
* keys with their equivalent XML entity codes. For more information, see XML-related object key constraints in the Amazon S3 User Guide.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
@Deprecated
public ReplicationRule withPrefix(String prefix) {
setPrefix(prefix);
return this;
}
/**
*
* A filter that identifies the subset of objects to which the replication rule applies. A Filter
* element must specify exactly one Prefix
, Tag
, or And
child element.
*
*
* @param filter
* A filter that identifies the subset of objects to which the replication rule applies. A
* Filter
element must specify exactly one Prefix
, Tag
, or
* And
child element.
*/
public void setFilter(ReplicationRuleFilter filter) {
this.filter = filter;
}
/**
*
* A filter that identifies the subset of objects to which the replication rule applies. A Filter
* element must specify exactly one Prefix
, Tag
, or And
child element.
*
*
* @return A filter that identifies the subset of objects to which the replication rule applies. A
* Filter
element must specify exactly one Prefix
, Tag
, or
* And
child element.
*/
public ReplicationRuleFilter getFilter() {
return this.filter;
}
/**
*
* A filter that identifies the subset of objects to which the replication rule applies. A Filter
* element must specify exactly one Prefix
, Tag
, or And
child element.
*
*
* @param filter
* A filter that identifies the subset of objects to which the replication rule applies. A
* Filter
element must specify exactly one Prefix
, Tag
, or
* And
child element.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReplicationRule withFilter(ReplicationRuleFilter filter) {
setFilter(filter);
return this;
}
/**
*
* Specifies whether the rule is enabled.
*
*
* @param status
* Specifies whether the rule is enabled.
* @see ReplicationRuleStatus
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* Specifies whether the rule is enabled.
*
*
* @return Specifies whether the rule is enabled.
* @see ReplicationRuleStatus
*/
public String getStatus() {
return this.status;
}
/**
*
* Specifies whether the rule is enabled.
*
*
* @param status
* Specifies whether the rule is enabled.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ReplicationRuleStatus
*/
public ReplicationRule withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* Specifies whether the rule is enabled.
*
*
* @param status
* Specifies whether the rule is enabled.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ReplicationRuleStatus
*/
public ReplicationRule withStatus(ReplicationRuleStatus status) {
this.status = status.toString();
return this;
}
/**
*
* A container that describes additional filters for identifying the source Outposts objects that you want to
* replicate. You can choose to enable or disable the replication of these objects.
*
*
* @param sourceSelectionCriteria
* A container that describes additional filters for identifying the source Outposts objects that you want to
* replicate. You can choose to enable or disable the replication of these objects.
*/
public void setSourceSelectionCriteria(SourceSelectionCriteria sourceSelectionCriteria) {
this.sourceSelectionCriteria = sourceSelectionCriteria;
}
/**
*
* A container that describes additional filters for identifying the source Outposts objects that you want to
* replicate. You can choose to enable or disable the replication of these objects.
*
*
* @return A container that describes additional filters for identifying the source Outposts objects that you want
* to replicate. You can choose to enable or disable the replication of these objects.
*/
public SourceSelectionCriteria getSourceSelectionCriteria() {
return this.sourceSelectionCriteria;
}
/**
*
* A container that describes additional filters for identifying the source Outposts objects that you want to
* replicate. You can choose to enable or disable the replication of these objects.
*
*
* @param sourceSelectionCriteria
* A container that describes additional filters for identifying the source Outposts objects that you want to
* replicate. You can choose to enable or disable the replication of these objects.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReplicationRule withSourceSelectionCriteria(SourceSelectionCriteria sourceSelectionCriteria) {
setSourceSelectionCriteria(sourceSelectionCriteria);
return this;
}
/**
*
* An optional configuration to replicate existing source bucket objects.
*
*
*
* This is not supported by Amazon S3 on Outposts buckets.
*
*
*
* @param existingObjectReplication
* An optional configuration to replicate existing source bucket objects.
*
* This is not supported by Amazon S3 on Outposts buckets.
*
*/
public void setExistingObjectReplication(ExistingObjectReplication existingObjectReplication) {
this.existingObjectReplication = existingObjectReplication;
}
/**
*
* An optional configuration to replicate existing source bucket objects.
*
*
*
* This is not supported by Amazon S3 on Outposts buckets.
*
*
*
* @return An optional configuration to replicate existing source bucket objects.
*
* This is not supported by Amazon S3 on Outposts buckets.
*
*/
public ExistingObjectReplication getExistingObjectReplication() {
return this.existingObjectReplication;
}
/**
*
* An optional configuration to replicate existing source bucket objects.
*
*
*
* This is not supported by Amazon S3 on Outposts buckets.
*
*
*
* @param existingObjectReplication
* An optional configuration to replicate existing source bucket objects.
*
* This is not supported by Amazon S3 on Outposts buckets.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReplicationRule withExistingObjectReplication(ExistingObjectReplication existingObjectReplication) {
setExistingObjectReplication(existingObjectReplication);
return this;
}
/**
*
* A container for information about the replication destination and its configurations.
*
*
* @param destination
* A container for information about the replication destination and its configurations.
*/
public void setDestination(Destination destination) {
this.destination = destination;
}
/**
*
* A container for information about the replication destination and its configurations.
*
*
* @return A container for information about the replication destination and its configurations.
*/
public Destination getDestination() {
return this.destination;
}
/**
*
* A container for information about the replication destination and its configurations.
*
*
* @param destination
* A container for information about the replication destination and its configurations.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReplicationRule withDestination(Destination destination) {
setDestination(destination);
return this;
}
/**
*
* Specifies whether S3 on Outposts replicates delete markers. If you specify a Filter
element in your
* replication configuration, you must also include a DeleteMarkerReplication
element. If your
* Filter
includes a Tag
element, the DeleteMarkerReplication
element's
* Status
child element must be set to Disabled
, because S3 on Outposts doesn't support
* replicating delete markers for tag-based rules.
*
*
* For more information about delete marker replication, see How delete operations affect replication in the Amazon S3 User Guide.
*
*
* @param deleteMarkerReplication
* Specifies whether S3 on Outposts replicates delete markers. If you specify a Filter
element
* in your replication configuration, you must also include a DeleteMarkerReplication
element.
* If your Filter
includes a Tag
element, the DeleteMarkerReplication
* element's Status
child element must be set to Disabled
, because S3 on Outposts
* doesn't support replicating delete markers for tag-based rules.
*
* For more information about delete marker replication, see How delete operations affect replication in the Amazon S3 User Guide.
*/
public void setDeleteMarkerReplication(DeleteMarkerReplication deleteMarkerReplication) {
this.deleteMarkerReplication = deleteMarkerReplication;
}
/**
*
* Specifies whether S3 on Outposts replicates delete markers. If you specify a Filter
element in your
* replication configuration, you must also include a DeleteMarkerReplication
element. If your
* Filter
includes a Tag
element, the DeleteMarkerReplication
element's
* Status
child element must be set to Disabled
, because S3 on Outposts doesn't support
* replicating delete markers for tag-based rules.
*
*
* For more information about delete marker replication, see How delete operations affect replication in the Amazon S3 User Guide.
*
*
* @return Specifies whether S3 on Outposts replicates delete markers. If you specify a Filter
element
* in your replication configuration, you must also include a DeleteMarkerReplication
element.
* If your Filter
includes a Tag
element, the DeleteMarkerReplication
* element's Status
child element must be set to Disabled
, because S3 on Outposts
* doesn't support replicating delete markers for tag-based rules.
*
* For more information about delete marker replication, see How delete operations affect replication in the Amazon S3 User Guide.
*/
public DeleteMarkerReplication getDeleteMarkerReplication() {
return this.deleteMarkerReplication;
}
/**
*
* Specifies whether S3 on Outposts replicates delete markers. If you specify a Filter
element in your
* replication configuration, you must also include a DeleteMarkerReplication
element. If your
* Filter
includes a Tag
element, the DeleteMarkerReplication
element's
* Status
child element must be set to Disabled
, because S3 on Outposts doesn't support
* replicating delete markers for tag-based rules.
*
*
* For more information about delete marker replication, see How delete operations affect replication in the Amazon S3 User Guide.
*
*
* @param deleteMarkerReplication
* Specifies whether S3 on Outposts replicates delete markers. If you specify a Filter
element
* in your replication configuration, you must also include a DeleteMarkerReplication
element.
* If your Filter
includes a Tag
element, the DeleteMarkerReplication
* element's Status
child element must be set to Disabled
, because S3 on Outposts
* doesn't support replicating delete markers for tag-based rules.
*
* For more information about delete marker replication, see How delete operations affect replication in the Amazon S3 User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReplicationRule withDeleteMarkerReplication(DeleteMarkerReplication deleteMarkerReplication) {
setDeleteMarkerReplication(deleteMarkerReplication);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the access point for the source Outposts bucket that you want S3 on Outposts to
* replicate the objects from.
*
*
* @param bucket
* The Amazon Resource Name (ARN) of the access point for the source Outposts bucket that you want S3 on
* Outposts to replicate the objects from.
*/
public void setBucket(String bucket) {
this.bucket = bucket;
}
/**
*
* The Amazon Resource Name (ARN) of the access point for the source Outposts bucket that you want S3 on Outposts to
* replicate the objects from.
*
*
* @return The Amazon Resource Name (ARN) of the access point for the source Outposts bucket that you want S3 on
* Outposts to replicate the objects from.
*/
public String getBucket() {
return this.bucket;
}
/**
*
* The Amazon Resource Name (ARN) of the access point for the source Outposts bucket that you want S3 on Outposts to
* replicate the objects from.
*
*
* @param bucket
* The Amazon Resource Name (ARN) of the access point for the source Outposts bucket that you want S3 on
* Outposts to replicate the objects from.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReplicationRule withBucket(String bucket) {
setBucket(bucket);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getID() != null)
sb.append("ID: ").append(getID()).append(",");
if (getPriority() != null)
sb.append("Priority: ").append(getPriority()).append(",");
if (getPrefix() != null)
sb.append("Prefix: ").append(getPrefix()).append(",");
if (getFilter() != null)
sb.append("Filter: ").append(getFilter()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus()).append(",");
if (getSourceSelectionCriteria() != null)
sb.append("SourceSelectionCriteria: ").append(getSourceSelectionCriteria()).append(",");
if (getExistingObjectReplication() != null)
sb.append("ExistingObjectReplication: ").append(getExistingObjectReplication()).append(",");
if (getDestination() != null)
sb.append("Destination: ").append(getDestination()).append(",");
if (getDeleteMarkerReplication() != null)
sb.append("DeleteMarkerReplication: ").append(getDeleteMarkerReplication()).append(",");
if (getBucket() != null)
sb.append("Bucket: ").append(getBucket());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ReplicationRule == false)
return false;
ReplicationRule other = (ReplicationRule) obj;
if (other.getID() == null ^ this.getID() == null)
return false;
if (other.getID() != null && other.getID().equals(this.getID()) == false)
return false;
if (other.getPriority() == null ^ this.getPriority() == null)
return false;
if (other.getPriority() != null && other.getPriority().equals(this.getPriority()) == false)
return false;
if (other.getPrefix() == null ^ this.getPrefix() == null)
return false;
if (other.getPrefix() != null && other.getPrefix().equals(this.getPrefix()) == false)
return false;
if (other.getFilter() == null ^ this.getFilter() == null)
return false;
if (other.getFilter() != null && other.getFilter().equals(this.getFilter()) == false)
return false;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
if (other.getSourceSelectionCriteria() == null ^ this.getSourceSelectionCriteria() == null)
return false;
if (other.getSourceSelectionCriteria() != null && other.getSourceSelectionCriteria().equals(this.getSourceSelectionCriteria()) == false)
return false;
if (other.getExistingObjectReplication() == null ^ this.getExistingObjectReplication() == null)
return false;
if (other.getExistingObjectReplication() != null && other.getExistingObjectReplication().equals(this.getExistingObjectReplication()) == false)
return false;
if (other.getDestination() == null ^ this.getDestination() == null)
return false;
if (other.getDestination() != null && other.getDestination().equals(this.getDestination()) == false)
return false;
if (other.getDeleteMarkerReplication() == null ^ this.getDeleteMarkerReplication() == null)
return false;
if (other.getDeleteMarkerReplication() != null && other.getDeleteMarkerReplication().equals(this.getDeleteMarkerReplication()) == false)
return false;
if (other.getBucket() == null ^ this.getBucket() == null)
return false;
if (other.getBucket() != null && other.getBucket().equals(this.getBucket()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getID() == null) ? 0 : getID().hashCode());
hashCode = prime * hashCode + ((getPriority() == null) ? 0 : getPriority().hashCode());
hashCode = prime * hashCode + ((getPrefix() == null) ? 0 : getPrefix().hashCode());
hashCode = prime * hashCode + ((getFilter() == null) ? 0 : getFilter().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getSourceSelectionCriteria() == null) ? 0 : getSourceSelectionCriteria().hashCode());
hashCode = prime * hashCode + ((getExistingObjectReplication() == null) ? 0 : getExistingObjectReplication().hashCode());
hashCode = prime * hashCode + ((getDestination() == null) ? 0 : getDestination().hashCode());
hashCode = prime * hashCode + ((getDeleteMarkerReplication() == null) ? 0 : getDeleteMarkerReplication().hashCode());
hashCode = prime * hashCode + ((getBucket() == null) ? 0 : getBucket().hashCode());
return hashCode;
}
@Override
public ReplicationRule clone() {
try {
return (ReplicationRule) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}