com.amazonaws.services.s3control.model.MultiRegionAccessPointRoute 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;
/**
*
* A structure for a Multi-Region Access Point that indicates where Amazon S3 traffic can be routed. Routes can be
* either active or passive. Active routes can process Amazon S3 requests through the Multi-Region Access Point, but
* passive routes are not eligible to process Amazon S3 requests.
*
*
* Each route contains the Amazon S3 bucket name and the Amazon Web Services Region that the bucket is located in. The
* route also includes the TrafficDialPercentage
value, which shows whether the bucket and Region are
* active (indicated by a value of 100
) or passive (indicated by a value of 0
).
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class MultiRegionAccessPointRoute implements Serializable, Cloneable {
/**
*
* The name of the Amazon S3 bucket for which you'll submit a routing configuration change. Either the
* Bucket
or the Region
value must be provided. If both are provided, the bucket must be
* in the specified Region.
*
*/
private String bucket;
/**
*
* The Amazon Web Services Region to which you'll be submitting a routing configuration change. Either the
* Bucket
or the Region
value must be provided. If both are provided, the bucket must be
* in the specified Region.
*
*/
private String region;
/**
*
* The traffic state for the specified bucket or Amazon Web Services Region.
*
*
* A value of 0
indicates a passive state, which means that no new traffic will be routed to the
* Region.
*
*
* A value of 100
indicates an active state, which means that traffic will be routed to the specified
* Region.
*
*
* When the routing configuration for a Region is changed from active to passive, any in-progress operations
* (uploads, copies, deletes, and so on) to the formerly active Region will continue to run to until a final success
* or failure status is reached.
*
*
* If all Regions in the routing configuration are designated as passive, you'll receive an
* InvalidRequest
error.
*
*/
private Integer trafficDialPercentage;
/**
*
* The name of the Amazon S3 bucket for which you'll submit a routing configuration change. Either the
* Bucket
or the Region
value must be provided. If both are provided, the bucket must be
* in the specified Region.
*
*
* @param bucket
* The name of the Amazon S3 bucket for which you'll submit a routing configuration change. Either the
* Bucket
or the Region
value must be provided. If both are provided, the bucket
* must be in the specified Region.
*/
public void setBucket(String bucket) {
this.bucket = bucket;
}
/**
*
* The name of the Amazon S3 bucket for which you'll submit a routing configuration change. Either the
* Bucket
or the Region
value must be provided. If both are provided, the bucket must be
* in the specified Region.
*
*
* @return The name of the Amazon S3 bucket for which you'll submit a routing configuration change. Either the
* Bucket
or the Region
value must be provided. If both are provided, the bucket
* must be in the specified Region.
*/
public String getBucket() {
return this.bucket;
}
/**
*
* The name of the Amazon S3 bucket for which you'll submit a routing configuration change. Either the
* Bucket
or the Region
value must be provided. If both are provided, the bucket must be
* in the specified Region.
*
*
* @param bucket
* The name of the Amazon S3 bucket for which you'll submit a routing configuration change. Either the
* Bucket
or the Region
value must be provided. If both are provided, the bucket
* must be in the specified Region.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MultiRegionAccessPointRoute withBucket(String bucket) {
setBucket(bucket);
return this;
}
/**
*
* The Amazon Web Services Region to which you'll be submitting a routing configuration change. Either the
* Bucket
or the Region
value must be provided. If both are provided, the bucket must be
* in the specified Region.
*
*
* @param region
* The Amazon Web Services Region to which you'll be submitting a routing configuration change. Either the
* Bucket
or the Region
value must be provided. If both are provided, the bucket
* must be in the specified Region.
*/
public void setRegion(String region) {
this.region = region;
}
/**
*
* The Amazon Web Services Region to which you'll be submitting a routing configuration change. Either the
* Bucket
or the Region
value must be provided. If both are provided, the bucket must be
* in the specified Region.
*
*
* @return The Amazon Web Services Region to which you'll be submitting a routing configuration change. Either the
* Bucket
or the Region
value must be provided. If both are provided, the bucket
* must be in the specified Region.
*/
public String getRegion() {
return this.region;
}
/**
*
* The Amazon Web Services Region to which you'll be submitting a routing configuration change. Either the
* Bucket
or the Region
value must be provided. If both are provided, the bucket must be
* in the specified Region.
*
*
* @param region
* The Amazon Web Services Region to which you'll be submitting a routing configuration change. Either the
* Bucket
or the Region
value must be provided. If both are provided, the bucket
* must be in the specified Region.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MultiRegionAccessPointRoute withRegion(String region) {
setRegion(region);
return this;
}
/**
*
* The traffic state for the specified bucket or Amazon Web Services Region.
*
*
* A value of 0
indicates a passive state, which means that no new traffic will be routed to the
* Region.
*
*
* A value of 100
indicates an active state, which means that traffic will be routed to the specified
* Region.
*
*
* When the routing configuration for a Region is changed from active to passive, any in-progress operations
* (uploads, copies, deletes, and so on) to the formerly active Region will continue to run to until a final success
* or failure status is reached.
*
*
* If all Regions in the routing configuration are designated as passive, you'll receive an
* InvalidRequest
error.
*
*
* @param trafficDialPercentage
* The traffic state for the specified bucket or Amazon Web Services Region.
*
* A value of 0
indicates a passive state, which means that no new traffic will be routed to the
* Region.
*
*
* A value of 100
indicates an active state, which means that traffic will be routed to the
* specified Region.
*
*
* When the routing configuration for a Region is changed from active to passive, any in-progress operations
* (uploads, copies, deletes, and so on) to the formerly active Region will continue to run to until a final
* success or failure status is reached.
*
*
* If all Regions in the routing configuration are designated as passive, you'll receive an
* InvalidRequest
error.
*/
public void setTrafficDialPercentage(Integer trafficDialPercentage) {
this.trafficDialPercentage = trafficDialPercentage;
}
/**
*
* The traffic state for the specified bucket or Amazon Web Services Region.
*
*
* A value of 0
indicates a passive state, which means that no new traffic will be routed to the
* Region.
*
*
* A value of 100
indicates an active state, which means that traffic will be routed to the specified
* Region.
*
*
* When the routing configuration for a Region is changed from active to passive, any in-progress operations
* (uploads, copies, deletes, and so on) to the formerly active Region will continue to run to until a final success
* or failure status is reached.
*
*
* If all Regions in the routing configuration are designated as passive, you'll receive an
* InvalidRequest
error.
*
*
* @return The traffic state for the specified bucket or Amazon Web Services Region.
*
* A value of 0
indicates a passive state, which means that no new traffic will be routed to
* the Region.
*
*
* A value of 100
indicates an active state, which means that traffic will be routed to the
* specified Region.
*
*
* When the routing configuration for a Region is changed from active to passive, any in-progress operations
* (uploads, copies, deletes, and so on) to the formerly active Region will continue to run to until a final
* success or failure status is reached.
*
*
* If all Regions in the routing configuration are designated as passive, you'll receive an
* InvalidRequest
error.
*/
public Integer getTrafficDialPercentage() {
return this.trafficDialPercentage;
}
/**
*
* The traffic state for the specified bucket or Amazon Web Services Region.
*
*
* A value of 0
indicates a passive state, which means that no new traffic will be routed to the
* Region.
*
*
* A value of 100
indicates an active state, which means that traffic will be routed to the specified
* Region.
*
*
* When the routing configuration for a Region is changed from active to passive, any in-progress operations
* (uploads, copies, deletes, and so on) to the formerly active Region will continue to run to until a final success
* or failure status is reached.
*
*
* If all Regions in the routing configuration are designated as passive, you'll receive an
* InvalidRequest
error.
*
*
* @param trafficDialPercentage
* The traffic state for the specified bucket or Amazon Web Services Region.
*
* A value of 0
indicates a passive state, which means that no new traffic will be routed to the
* Region.
*
*
* A value of 100
indicates an active state, which means that traffic will be routed to the
* specified Region.
*
*
* When the routing configuration for a Region is changed from active to passive, any in-progress operations
* (uploads, copies, deletes, and so on) to the formerly active Region will continue to run to until a final
* success or failure status is reached.
*
*
* If all Regions in the routing configuration are designated as passive, you'll receive an
* InvalidRequest
error.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MultiRegionAccessPointRoute withTrafficDialPercentage(Integer trafficDialPercentage) {
setTrafficDialPercentage(trafficDialPercentage);
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 (getBucket() != null)
sb.append("Bucket: ").append(getBucket()).append(",");
if (getRegion() != null)
sb.append("Region: ").append(getRegion()).append(",");
if (getTrafficDialPercentage() != null)
sb.append("TrafficDialPercentage: ").append(getTrafficDialPercentage());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof MultiRegionAccessPointRoute == false)
return false;
MultiRegionAccessPointRoute other = (MultiRegionAccessPointRoute) obj;
if (other.getBucket() == null ^ this.getBucket() == null)
return false;
if (other.getBucket() != null && other.getBucket().equals(this.getBucket()) == false)
return false;
if (other.getRegion() == null ^ this.getRegion() == null)
return false;
if (other.getRegion() != null && other.getRegion().equals(this.getRegion()) == false)
return false;
if (other.getTrafficDialPercentage() == null ^ this.getTrafficDialPercentage() == null)
return false;
if (other.getTrafficDialPercentage() != null && other.getTrafficDialPercentage().equals(this.getTrafficDialPercentage()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getBucket() == null) ? 0 : getBucket().hashCode());
hashCode = prime * hashCode + ((getRegion() == null) ? 0 : getRegion().hashCode());
hashCode = prime * hashCode + ((getTrafficDialPercentage() == null) ? 0 : getTrafficDialPercentage().hashCode());
return hashCode;
}
@Override
public MultiRegionAccessPointRoute clone() {
try {
return (MultiRegionAccessPointRoute) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}