org.mongodb.awscdk.resources.mongodbatlas.AdvancedReplicationSpec Maven / Gradle / Ivy
Show all versions of awscdk-resources-mongodbatlas Show documentation
package org.mongodb.awscdk.resources.mongodbatlas;
/**
* List of settings that configure your cluster regions.
*
* For Global Clusters, each object in the array represents a zone where your clusters nodes deploy. For non-Global replica sets and sharded clusters, this array has one object representing where your clusters nodes deploy.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.101.0 (build b95fe5d)", date = "2024-07-30T09:54:28.852Z")
@software.amazon.jsii.Jsii(module = org.mongodb.awscdk.resources.mongodbatlas.$Module.class, fqn = "awscdk-resources-mongodbatlas.AdvancedReplicationSpec")
@software.amazon.jsii.Jsii.Proxy(AdvancedReplicationSpec.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface AdvancedReplicationSpec extends software.amazon.jsii.JsiiSerializable {
/**
* Hardware specifications for nodes set for a given region.
*
* Each regionConfigs object describes the region's priority in elections and the number and type of MongoDB nodes that MongoDB Cloud deploys to the region. Each regionConfigs object must have either an analyticsSpecs object, electableSpecs object, or readOnlySpecs object. Tenant clusters only require electableSpecs. Dedicated clusters can specify any of these specifications, but must have at least one electableSpecs object within a replicationSpec. Every hardware specification must use the same instanceSize.
*
* Example:
*
* If you set "replicationSpecs[n].regionConfigs[m].analyticsSpecs.instanceSize" : "M30", set "replicationSpecs[n].regionConfigs[m].electableSpecs.instanceSize" : "M30"if you have electable nodes and"replicationSpecs[n].regionConfigs[m].readOnlySpecs.instanceSize" : "M30" if you have read-only nodes.",
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.List getAdvancedRegionConfigs() {
return null;
}
/**
* Unique 24-hexadecimal digit string that identifies the replication object for a zone in a Multi-Cloud Cluster.
*
* If you include existing zones in the request, you must specify this parameter. If you add a new zone to an existing Multi-Cloud Cluster, you may specify this parameter. The request deletes any existing zones in the Multi-Cloud Cluster that you exclude from the request.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getId() {
return null;
}
/**
* Positive integer that specifies the number of shards to deploy in each specified zone.
*
* If you set this value to 1 and "clusterType" : "SHARDED", MongoDB Cloud deploys a single-shard sharded cluster. Don't create a sharded cluster with a single shard for production environments. Single-shard sharded clusters don't provide the same benefits as multi-shard configurations.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Number getNumShards() {
return null;
}
/**
* Human-readable label that identifies the zone in a Global Cluster.
*
* Provide this value only if "clusterType" : "GEOSHARDED".
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getZoneName() {
return null;
}
/**
* @return a {@link Builder} of {@link AdvancedReplicationSpec}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link AdvancedReplicationSpec}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.util.List advancedRegionConfigs;
java.lang.String id;
java.lang.Number numShards;
java.lang.String zoneName;
/**
* Sets the value of {@link AdvancedReplicationSpec#getAdvancedRegionConfigs}
* @param advancedRegionConfigs Hardware specifications for nodes set for a given region.
* Each regionConfigs object describes the region's priority in elections and the number and type of MongoDB nodes that MongoDB Cloud deploys to the region. Each regionConfigs object must have either an analyticsSpecs object, electableSpecs object, or readOnlySpecs object. Tenant clusters only require electableSpecs. Dedicated clusters can specify any of these specifications, but must have at least one electableSpecs object within a replicationSpec. Every hardware specification must use the same instanceSize.
*
* Example:
*
* If you set "replicationSpecs[n].regionConfigs[m].analyticsSpecs.instanceSize" : "M30", set "replicationSpecs[n].regionConfigs[m].electableSpecs.instanceSize" : "M30"if you have electable nodes and"replicationSpecs[n].regionConfigs[m].readOnlySpecs.instanceSize" : "M30" if you have read-only nodes.",
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@SuppressWarnings("unchecked")
public Builder advancedRegionConfigs(java.util.List extends org.mongodb.awscdk.resources.mongodbatlas.AdvancedRegionConfig> advancedRegionConfigs) {
this.advancedRegionConfigs = (java.util.List)advancedRegionConfigs;
return this;
}
/**
* Sets the value of {@link AdvancedReplicationSpec#getId}
* @param id Unique 24-hexadecimal digit string that identifies the replication object for a zone in a Multi-Cloud Cluster.
* If you include existing zones in the request, you must specify this parameter. If you add a new zone to an existing Multi-Cloud Cluster, you may specify this parameter. The request deletes any existing zones in the Multi-Cloud Cluster that you exclude from the request.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder id(java.lang.String id) {
this.id = id;
return this;
}
/**
* Sets the value of {@link AdvancedReplicationSpec#getNumShards}
* @param numShards Positive integer that specifies the number of shards to deploy in each specified zone.
* If you set this value to 1 and "clusterType" : "SHARDED", MongoDB Cloud deploys a single-shard sharded cluster. Don't create a sharded cluster with a single shard for production environments. Single-shard sharded clusters don't provide the same benefits as multi-shard configurations.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder numShards(java.lang.Number numShards) {
this.numShards = numShards;
return this;
}
/**
* Sets the value of {@link AdvancedReplicationSpec#getZoneName}
* @param zoneName Human-readable label that identifies the zone in a Global Cluster.
* Provide this value only if "clusterType" : "GEOSHARDED".
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder zoneName(java.lang.String zoneName) {
this.zoneName = zoneName;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link AdvancedReplicationSpec}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public AdvancedReplicationSpec build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link AdvancedReplicationSpec}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements AdvancedReplicationSpec {
private final java.util.List advancedRegionConfigs;
private final java.lang.String id;
private final java.lang.Number numShards;
private final java.lang.String zoneName;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.advancedRegionConfigs = software.amazon.jsii.Kernel.get(this, "advancedRegionConfigs", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(org.mongodb.awscdk.resources.mongodbatlas.AdvancedRegionConfig.class)));
this.id = software.amazon.jsii.Kernel.get(this, "id", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.numShards = software.amazon.jsii.Kernel.get(this, "numShards", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.zoneName = software.amazon.jsii.Kernel.get(this, "zoneName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
@SuppressWarnings("unchecked")
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.advancedRegionConfigs = (java.util.List)builder.advancedRegionConfigs;
this.id = builder.id;
this.numShards = builder.numShards;
this.zoneName = builder.zoneName;
}
@Override
public final java.util.List getAdvancedRegionConfigs() {
return this.advancedRegionConfigs;
}
@Override
public final java.lang.String getId() {
return this.id;
}
@Override
public final java.lang.Number getNumShards() {
return this.numShards;
}
@Override
public final java.lang.String getZoneName() {
return this.zoneName;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
if (this.getAdvancedRegionConfigs() != null) {
data.set("advancedRegionConfigs", om.valueToTree(this.getAdvancedRegionConfigs()));
}
if (this.getId() != null) {
data.set("id", om.valueToTree(this.getId()));
}
if (this.getNumShards() != null) {
data.set("numShards", om.valueToTree(this.getNumShards()));
}
if (this.getZoneName() != null) {
data.set("zoneName", om.valueToTree(this.getZoneName()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("awscdk-resources-mongodbatlas.AdvancedReplicationSpec"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AdvancedReplicationSpec.Jsii$Proxy that = (AdvancedReplicationSpec.Jsii$Proxy) o;
if (this.advancedRegionConfigs != null ? !this.advancedRegionConfigs.equals(that.advancedRegionConfigs) : that.advancedRegionConfigs != null) return false;
if (this.id != null ? !this.id.equals(that.id) : that.id != null) return false;
if (this.numShards != null ? !this.numShards.equals(that.numShards) : that.numShards != null) return false;
return this.zoneName != null ? this.zoneName.equals(that.zoneName) : that.zoneName == null;
}
@Override
public final int hashCode() {
int result = this.advancedRegionConfigs != null ? this.advancedRegionConfigs.hashCode() : 0;
result = 31 * result + (this.id != null ? this.id.hashCode() : 0);
result = 31 * result + (this.numShards != null ? this.numShards.hashCode() : 0);
result = 31 * result + (this.zoneName != null ? this.zoneName.hashCode() : 0);
return result;
}
}
}