All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.elasticache.model.ReplicationGroup Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon ElastiCache module holds the client classes that are used for communicating with Amazon ElastiCache Service

There is a newer version: 2.29.39
Show newest version
/*
 * Copyright 2014-2019 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 software.amazon.awssdk.services.elasticache.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Contains all of the attributes of a specific Redis replication group. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ReplicationGroup implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField REPLICATION_GROUP_ID_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ReplicationGroup::replicationGroupId)).setter(setter(Builder::replicationGroupId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicationGroupId").build()) .build(); private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ReplicationGroup::description)).setter(setter(Builder::description)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ReplicationGroup::status)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build(); private static final SdkField PENDING_MODIFIED_VALUES_FIELD = SdkField . builder(MarshallingType.SDK_POJO) .getter(getter(ReplicationGroup::pendingModifiedValues)).setter(setter(Builder::pendingModifiedValues)) .constructor(ReplicationGroupPendingModifiedValues::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PendingModifiedValues").build()) .build(); private static final SdkField> MEMBER_CLUSTERS_FIELD = SdkField .> builder(MarshallingType.LIST) .getter(getter(ReplicationGroup::memberClusters)) .setter(setter(Builder::memberClusters)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MemberClusters").build(), ListTrait .builder() .memberLocationName("ClusterId") .memberFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("ClusterId").build()).build()).build()).build(); private static final SdkField> NODE_GROUPS_FIELD = SdkField .> builder(MarshallingType.LIST) .getter(getter(ReplicationGroup::nodeGroups)) .setter(setter(Builder::nodeGroups)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NodeGroups").build(), ListTrait .builder() .memberLocationName("NodeGroup") .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(NodeGroup::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("NodeGroup").build()).build()).build()).build(); private static final SdkField SNAPSHOTTING_CLUSTER_ID_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ReplicationGroup::snapshottingClusterId)).setter(setter(Builder::snapshottingClusterId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SnapshottingClusterId").build()) .build(); private static final SdkField AUTOMATIC_FAILOVER_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ReplicationGroup::automaticFailoverAsString)).setter(setter(Builder::automaticFailover)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AutomaticFailover").build()).build(); private static final SdkField CONFIGURATION_ENDPOINT_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .getter(getter(ReplicationGroup::configurationEndpoint)).setter(setter(Builder::configurationEndpoint)) .constructor(Endpoint::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ConfigurationEndpoint").build()) .build(); private static final SdkField SNAPSHOT_RETENTION_LIMIT_FIELD = SdkField. builder(MarshallingType.INTEGER) .getter(getter(ReplicationGroup::snapshotRetentionLimit)).setter(setter(Builder::snapshotRetentionLimit)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SnapshotRetentionLimit").build()) .build(); private static final SdkField SNAPSHOT_WINDOW_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ReplicationGroup::snapshotWindow)).setter(setter(Builder::snapshotWindow)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SnapshotWindow").build()).build(); private static final SdkField CLUSTER_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .getter(getter(ReplicationGroup::clusterEnabled)).setter(setter(Builder::clusterEnabled)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClusterEnabled").build()).build(); private static final SdkField CACHE_NODE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ReplicationGroup::cacheNodeType)).setter(setter(Builder::cacheNodeType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CacheNodeType").build()).build(); private static final SdkField AUTH_TOKEN_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .getter(getter(ReplicationGroup::authTokenEnabled)).setter(setter(Builder::authTokenEnabled)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AuthTokenEnabled").build()).build(); private static final SdkField TRANSIT_ENCRYPTION_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .getter(getter(ReplicationGroup::transitEncryptionEnabled)).setter(setter(Builder::transitEncryptionEnabled)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TransitEncryptionEnabled").build()) .build(); private static final SdkField AT_REST_ENCRYPTION_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .getter(getter(ReplicationGroup::atRestEncryptionEnabled)).setter(setter(Builder::atRestEncryptionEnabled)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AtRestEncryptionEnabled").build()) .build(); private static final SdkField KMS_KEY_ID_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ReplicationGroup::kmsKeyId)).setter(setter(Builder::kmsKeyId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KmsKeyId").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(REPLICATION_GROUP_ID_FIELD, DESCRIPTION_FIELD, STATUS_FIELD, PENDING_MODIFIED_VALUES_FIELD, MEMBER_CLUSTERS_FIELD, NODE_GROUPS_FIELD, SNAPSHOTTING_CLUSTER_ID_FIELD, AUTOMATIC_FAILOVER_FIELD, CONFIGURATION_ENDPOINT_FIELD, SNAPSHOT_RETENTION_LIMIT_FIELD, SNAPSHOT_WINDOW_FIELD, CLUSTER_ENABLED_FIELD, CACHE_NODE_TYPE_FIELD, AUTH_TOKEN_ENABLED_FIELD, TRANSIT_ENCRYPTION_ENABLED_FIELD, AT_REST_ENCRYPTION_ENABLED_FIELD, KMS_KEY_ID_FIELD)); private static final long serialVersionUID = 1L; private final String replicationGroupId; private final String description; private final String status; private final ReplicationGroupPendingModifiedValues pendingModifiedValues; private final List memberClusters; private final List nodeGroups; private final String snapshottingClusterId; private final String automaticFailover; private final Endpoint configurationEndpoint; private final Integer snapshotRetentionLimit; private final String snapshotWindow; private final Boolean clusterEnabled; private final String cacheNodeType; private final Boolean authTokenEnabled; private final Boolean transitEncryptionEnabled; private final Boolean atRestEncryptionEnabled; private final String kmsKeyId; private ReplicationGroup(BuilderImpl builder) { this.replicationGroupId = builder.replicationGroupId; this.description = builder.description; this.status = builder.status; this.pendingModifiedValues = builder.pendingModifiedValues; this.memberClusters = builder.memberClusters; this.nodeGroups = builder.nodeGroups; this.snapshottingClusterId = builder.snapshottingClusterId; this.automaticFailover = builder.automaticFailover; this.configurationEndpoint = builder.configurationEndpoint; this.snapshotRetentionLimit = builder.snapshotRetentionLimit; this.snapshotWindow = builder.snapshotWindow; this.clusterEnabled = builder.clusterEnabled; this.cacheNodeType = builder.cacheNodeType; this.authTokenEnabled = builder.authTokenEnabled; this.transitEncryptionEnabled = builder.transitEncryptionEnabled; this.atRestEncryptionEnabled = builder.atRestEncryptionEnabled; this.kmsKeyId = builder.kmsKeyId; } /** *

* The identifier for the replication group. *

* * @return The identifier for the replication group. */ public String replicationGroupId() { return replicationGroupId; } /** *

* The user supplied description of the replication group. *

* * @return The user supplied description of the replication group. */ public String description() { return description; } /** *

* The current state of this replication group - creating, available, * modifying, deleting, create-failed, snapshotting. *

* * @return The current state of this replication group - creating, available, * modifying, deleting, create-failed, snapshotting. */ public String status() { return status; } /** *

* A group of settings to be applied to the replication group, either immediately or during the next maintenance * window. *

* * @return A group of settings to be applied to the replication group, either immediately or during the next * maintenance window. */ public ReplicationGroupPendingModifiedValues pendingModifiedValues() { return pendingModifiedValues; } /** *

* The names of all the cache clusters that are part of this replication group. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

* * @return The names of all the cache clusters that are part of this replication group. */ public List memberClusters() { return memberClusters; } /** *

* A list of node groups in this replication group. For Redis (cluster mode disabled) replication groups, this is a * single-element list. For Redis (cluster mode enabled) replication groups, the list contains an entry for each * node group (shard). *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

* * @return A list of node groups in this replication group. For Redis (cluster mode disabled) replication groups, * this is a single-element list. For Redis (cluster mode enabled) replication groups, the list contains an * entry for each node group (shard). */ public List nodeGroups() { return nodeGroups; } /** *

* The cluster ID that is used as the daily snapshot source for the replication group. *

* * @return The cluster ID that is used as the daily snapshot source for the replication group. */ public String snapshottingClusterId() { return snapshottingClusterId; } /** *

* Indicates the status of Multi-AZ with automatic failover for this Redis replication group. *

*

* Amazon ElastiCache for Redis does not support Multi-AZ with automatic failover on: *

*
    *
  • *

    * Redis versions earlier than 2.8.6. *

    *
  • *
  • *

    * Redis (cluster mode disabled): T1 node types. *

    *
  • *
  • *

    * Redis (cluster mode enabled): T1 node types. *

    *
  • *
*

* If the service returns an enum value that is not available in the current SDK version, {@link #automaticFailover} * will return {@link AutomaticFailoverStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is * available from {@link #automaticFailoverAsString}. *

* * @return Indicates the status of Multi-AZ with automatic failover for this Redis replication group.

*

* Amazon ElastiCache for Redis does not support Multi-AZ with automatic failover on: *

*
    *
  • *

    * Redis versions earlier than 2.8.6. *

    *
  • *
  • *

    * Redis (cluster mode disabled): T1 node types. *

    *
  • *
  • *

    * Redis (cluster mode enabled): T1 node types. *

    *
  • * @see AutomaticFailoverStatus */ public AutomaticFailoverStatus automaticFailover() { return AutomaticFailoverStatus.fromValue(automaticFailover); } /** *

    * Indicates the status of Multi-AZ with automatic failover for this Redis replication group. *

    *

    * Amazon ElastiCache for Redis does not support Multi-AZ with automatic failover on: *

    *
      *
    • *

      * Redis versions earlier than 2.8.6. *

      *
    • *
    • *

      * Redis (cluster mode disabled): T1 node types. *

      *
    • *
    • *

      * Redis (cluster mode enabled): T1 node types. *

      *
    • *
    *

    * If the service returns an enum value that is not available in the current SDK version, {@link #automaticFailover} * will return {@link AutomaticFailoverStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is * available from {@link #automaticFailoverAsString}. *

    * * @return Indicates the status of Multi-AZ with automatic failover for this Redis replication group.

    *

    * Amazon ElastiCache for Redis does not support Multi-AZ with automatic failover on: *

    *
      *
    • *

      * Redis versions earlier than 2.8.6. *

      *
    • *
    • *

      * Redis (cluster mode disabled): T1 node types. *

      *
    • *
    • *

      * Redis (cluster mode enabled): T1 node types. *

      *
    • * @see AutomaticFailoverStatus */ public String automaticFailoverAsString() { return automaticFailover; } /** *

      * The configuration endpoint for this replication group. Use the configuration endpoint to connect to this * replication group. *

      * * @return The configuration endpoint for this replication group. Use the configuration endpoint to connect to this * replication group. */ public Endpoint configurationEndpoint() { return configurationEndpoint; } /** *

      * The number of days for which ElastiCache retains automatic cluster snapshots before deleting them. For example, * if you set SnapshotRetentionLimit to 5, a snapshot that was taken today is retained for 5 days * before being deleted. *

      * *

      * If the value of SnapshotRetentionLimit is set to zero (0), backups are turned off. *

      *
      * * @return The number of days for which ElastiCache retains automatic cluster snapshots before deleting them. For * example, if you set SnapshotRetentionLimit to 5, a snapshot that was taken today is retained * for 5 days before being deleted.

      *

      * If the value of SnapshotRetentionLimit is set to zero (0), backups are turned off. *

      */ public Integer snapshotRetentionLimit() { return snapshotRetentionLimit; } /** *

      * The daily time range (in UTC) during which ElastiCache begins taking a daily snapshot of your node group (shard). *

      *

      * Example: 05:00-09:00 *

      *

      * If you do not specify this parameter, ElastiCache automatically chooses an appropriate time range. *

      * *

      * This parameter is only valid if the Engine parameter is redis. *

      *
      * * @return The daily time range (in UTC) during which ElastiCache begins taking a daily snapshot of your node group * (shard).

      *

      * Example: 05:00-09:00 *

      *

      * If you do not specify this parameter, ElastiCache automatically chooses an appropriate time range. *

      * *

      * This parameter is only valid if the Engine parameter is redis. *

      */ public String snapshotWindow() { return snapshotWindow; } /** *

      * A flag indicating whether or not this replication group is cluster enabled; i.e., whether its data can be * partitioned across multiple shards (API/CLI: node groups). *

      *

      * Valid values: true | false *

      * * @return A flag indicating whether or not this replication group is cluster enabled; i.e., whether its data can be * partitioned across multiple shards (API/CLI: node groups).

      *

      * Valid values: true | false */ public Boolean clusterEnabled() { return clusterEnabled; } /** *

      * The name of the compute and memory capacity node type for each node in the replication group. *

      * * @return The name of the compute and memory capacity node type for each node in the replication group. */ public String cacheNodeType() { return cacheNodeType; } /** *

      * A flag that enables using an AuthToken (password) when issuing Redis commands. *

      *

      * Default: false *

      * * @return A flag that enables using an AuthToken (password) when issuing Redis commands.

      *

      * Default: false */ public Boolean authTokenEnabled() { return authTokenEnabled; } /** *

      * A flag that enables in-transit encryption when set to true. *

      *

      * You cannot modify the value of TransitEncryptionEnabled after the cluster is created. To enable * in-transit encryption on a cluster you must set TransitEncryptionEnabled to true when * you create a cluster. *

      *

      * Required: Only available when creating a replication group in an Amazon VPC using redis version * 3.2.6, 4.x or later. *

      *

      * Default: false *

      * * @return A flag that enables in-transit encryption when set to true.

      *

      * You cannot modify the value of TransitEncryptionEnabled after the cluster is created. To * enable in-transit encryption on a cluster you must set TransitEncryptionEnabled to * true when you create a cluster. *

      *

      * Required: Only available when creating a replication group in an Amazon VPC using redis version * 3.2.6, 4.x or later. *

      *

      * Default: false */ public Boolean transitEncryptionEnabled() { return transitEncryptionEnabled; } /** *

      * A flag that enables encryption at-rest when set to true. *

      *

      * You cannot modify the value of AtRestEncryptionEnabled after the cluster is created. To enable * encryption at-rest on a cluster you must set AtRestEncryptionEnabled to true when you * create a cluster. *

      *

      * Required: Only available when creating a replication group in an Amazon VPC using redis version * 3.2.6, 4.x or later. *

      *

      * Default: false *

      * * @return A flag that enables encryption at-rest when set to true.

      *

      * You cannot modify the value of AtRestEncryptionEnabled after the cluster is created. To * enable encryption at-rest on a cluster you must set AtRestEncryptionEnabled to * true when you create a cluster. *

      *

      * Required: Only available when creating a replication group in an Amazon VPC using redis version * 3.2.6, 4.x or later. *

      *

      * Default: false */ public Boolean atRestEncryptionEnabled() { return atRestEncryptionEnabled; } /** *

      * The ID of the KMS key used to encrypt the disk in the cluster. *

      * * @return The ID of the KMS key used to encrypt the disk in the cluster. */ public String kmsKeyId() { return kmsKeyId; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(replicationGroupId()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(status()); hashCode = 31 * hashCode + Objects.hashCode(pendingModifiedValues()); hashCode = 31 * hashCode + Objects.hashCode(memberClusters()); hashCode = 31 * hashCode + Objects.hashCode(nodeGroups()); hashCode = 31 * hashCode + Objects.hashCode(snapshottingClusterId()); hashCode = 31 * hashCode + Objects.hashCode(automaticFailoverAsString()); hashCode = 31 * hashCode + Objects.hashCode(configurationEndpoint()); hashCode = 31 * hashCode + Objects.hashCode(snapshotRetentionLimit()); hashCode = 31 * hashCode + Objects.hashCode(snapshotWindow()); hashCode = 31 * hashCode + Objects.hashCode(clusterEnabled()); hashCode = 31 * hashCode + Objects.hashCode(cacheNodeType()); hashCode = 31 * hashCode + Objects.hashCode(authTokenEnabled()); hashCode = 31 * hashCode + Objects.hashCode(transitEncryptionEnabled()); hashCode = 31 * hashCode + Objects.hashCode(atRestEncryptionEnabled()); hashCode = 31 * hashCode + Objects.hashCode(kmsKeyId()); return hashCode; } @Override public boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof ReplicationGroup)) { return false; } ReplicationGroup other = (ReplicationGroup) obj; return Objects.equals(replicationGroupId(), other.replicationGroupId()) && Objects.equals(description(), other.description()) && Objects.equals(status(), other.status()) && Objects.equals(pendingModifiedValues(), other.pendingModifiedValues()) && Objects.equals(memberClusters(), other.memberClusters()) && Objects.equals(nodeGroups(), other.nodeGroups()) && Objects.equals(snapshottingClusterId(), other.snapshottingClusterId()) && Objects.equals(automaticFailoverAsString(), other.automaticFailoverAsString()) && Objects.equals(configurationEndpoint(), other.configurationEndpoint()) && Objects.equals(snapshotRetentionLimit(), other.snapshotRetentionLimit()) && Objects.equals(snapshotWindow(), other.snapshotWindow()) && Objects.equals(clusterEnabled(), other.clusterEnabled()) && Objects.equals(cacheNodeType(), other.cacheNodeType()) && Objects.equals(authTokenEnabled(), other.authTokenEnabled()) && Objects.equals(transitEncryptionEnabled(), other.transitEncryptionEnabled()) && Objects.equals(atRestEncryptionEnabled(), other.atRestEncryptionEnabled()) && Objects.equals(kmsKeyId(), other.kmsKeyId()); } /** * 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. */ @Override public String toString() { return ToString.builder("ReplicationGroup").add("ReplicationGroupId", replicationGroupId()) .add("Description", description()).add("Status", status()).add("PendingModifiedValues", pendingModifiedValues()) .add("MemberClusters", memberClusters()).add("NodeGroups", nodeGroups()) .add("SnapshottingClusterId", snapshottingClusterId()).add("AutomaticFailover", automaticFailoverAsString()) .add("ConfigurationEndpoint", configurationEndpoint()).add("SnapshotRetentionLimit", snapshotRetentionLimit()) .add("SnapshotWindow", snapshotWindow()).add("ClusterEnabled", clusterEnabled()) .add("CacheNodeType", cacheNodeType()).add("AuthTokenEnabled", authTokenEnabled()) .add("TransitEncryptionEnabled", transitEncryptionEnabled()) .add("AtRestEncryptionEnabled", atRestEncryptionEnabled()).add("KmsKeyId", kmsKeyId()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ReplicationGroupId": return Optional.ofNullable(clazz.cast(replicationGroupId())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "Status": return Optional.ofNullable(clazz.cast(status())); case "PendingModifiedValues": return Optional.ofNullable(clazz.cast(pendingModifiedValues())); case "MemberClusters": return Optional.ofNullable(clazz.cast(memberClusters())); case "NodeGroups": return Optional.ofNullable(clazz.cast(nodeGroups())); case "SnapshottingClusterId": return Optional.ofNullable(clazz.cast(snapshottingClusterId())); case "AutomaticFailover": return Optional.ofNullable(clazz.cast(automaticFailoverAsString())); case "ConfigurationEndpoint": return Optional.ofNullable(clazz.cast(configurationEndpoint())); case "SnapshotRetentionLimit": return Optional.ofNullable(clazz.cast(snapshotRetentionLimit())); case "SnapshotWindow": return Optional.ofNullable(clazz.cast(snapshotWindow())); case "ClusterEnabled": return Optional.ofNullable(clazz.cast(clusterEnabled())); case "CacheNodeType": return Optional.ofNullable(clazz.cast(cacheNodeType())); case "AuthTokenEnabled": return Optional.ofNullable(clazz.cast(authTokenEnabled())); case "TransitEncryptionEnabled": return Optional.ofNullable(clazz.cast(transitEncryptionEnabled())); case "AtRestEncryptionEnabled": return Optional.ofNullable(clazz.cast(atRestEncryptionEnabled())); case "KmsKeyId": return Optional.ofNullable(clazz.cast(kmsKeyId())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ReplicationGroup) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

      * The identifier for the replication group. *

      * * @param replicationGroupId * The identifier for the replication group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder replicationGroupId(String replicationGroupId); /** *

      * The user supplied description of the replication group. *

      * * @param description * The user supplied description of the replication group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

      * The current state of this replication group - creating, available, * modifying, deleting, create-failed, snapshotting. *

      * * @param status * The current state of this replication group - creating, available, * modifying, deleting, create-failed, snapshotting. * @return Returns a reference to this object so that method calls can be chained together. */ Builder status(String status); /** *

      * A group of settings to be applied to the replication group, either immediately or during the next maintenance * window. *

      * * @param pendingModifiedValues * A group of settings to be applied to the replication group, either immediately or during the next * maintenance window. * @return Returns a reference to this object so that method calls can be chained together. */ Builder pendingModifiedValues(ReplicationGroupPendingModifiedValues pendingModifiedValues); /** *

      * A group of settings to be applied to the replication group, either immediately or during the next maintenance * window. *

      * This is a convenience that creates an instance of the {@link ReplicationGroupPendingModifiedValues.Builder} * avoiding the need to create one manually via {@link ReplicationGroupPendingModifiedValues#builder()}. * * When the {@link Consumer} completes, {@link ReplicationGroupPendingModifiedValues.Builder#build()} is called * immediately and its result is passed to {@link #pendingModifiedValues(ReplicationGroupPendingModifiedValues)} * . * * @param pendingModifiedValues * a consumer that will call methods on {@link ReplicationGroupPendingModifiedValues.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #pendingModifiedValues(ReplicationGroupPendingModifiedValues) */ default Builder pendingModifiedValues(Consumer pendingModifiedValues) { return pendingModifiedValues(ReplicationGroupPendingModifiedValues.builder().applyMutation(pendingModifiedValues) .build()); } /** *

      * The names of all the cache clusters that are part of this replication group. *

      * * @param memberClusters * The names of all the cache clusters that are part of this replication group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder memberClusters(Collection memberClusters); /** *

      * The names of all the cache clusters that are part of this replication group. *

      * * @param memberClusters * The names of all the cache clusters that are part of this replication group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder memberClusters(String... memberClusters); /** *

      * A list of node groups in this replication group. For Redis (cluster mode disabled) replication groups, this * is a single-element list. For Redis (cluster mode enabled) replication groups, the list contains an entry for * each node group (shard). *

      * * @param nodeGroups * A list of node groups in this replication group. For Redis (cluster mode disabled) replication groups, * this is a single-element list. For Redis (cluster mode enabled) replication groups, the list contains * an entry for each node group (shard). * @return Returns a reference to this object so that method calls can be chained together. */ Builder nodeGroups(Collection nodeGroups); /** *

      * A list of node groups in this replication group. For Redis (cluster mode disabled) replication groups, this * is a single-element list. For Redis (cluster mode enabled) replication groups, the list contains an entry for * each node group (shard). *

      * * @param nodeGroups * A list of node groups in this replication group. For Redis (cluster mode disabled) replication groups, * this is a single-element list. For Redis (cluster mode enabled) replication groups, the list contains * an entry for each node group (shard). * @return Returns a reference to this object so that method calls can be chained together. */ Builder nodeGroups(NodeGroup... nodeGroups); /** *

      * A list of node groups in this replication group. For Redis (cluster mode disabled) replication groups, this * is a single-element list. For Redis (cluster mode enabled) replication groups, the list contains an entry for * each node group (shard). *

      * This is a convenience that creates an instance of the {@link List.Builder} avoiding the need to * create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and its * result is passed to {@link #nodeGroups(List)}. * * @param nodeGroups * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #nodeGroups(List) */ Builder nodeGroups(Consumer... nodeGroups); /** *

      * The cluster ID that is used as the daily snapshot source for the replication group. *

      * * @param snapshottingClusterId * The cluster ID that is used as the daily snapshot source for the replication group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder snapshottingClusterId(String snapshottingClusterId); /** *

      * Indicates the status of Multi-AZ with automatic failover for this Redis replication group. *

      *

      * Amazon ElastiCache for Redis does not support Multi-AZ with automatic failover on: *

      *
        *
      • *

        * Redis versions earlier than 2.8.6. *

        *
      • *
      • *

        * Redis (cluster mode disabled): T1 node types. *

        *
      • *
      • *

        * Redis (cluster mode enabled): T1 node types. *

        *
      • *
      * * @param automaticFailover * Indicates the status of Multi-AZ with automatic failover for this Redis replication group.

      *

      * Amazon ElastiCache for Redis does not support Multi-AZ with automatic failover on: *

      *
        *
      • *

        * Redis versions earlier than 2.8.6. *

        *
      • *
      • *

        * Redis (cluster mode disabled): T1 node types. *

        *
      • *
      • *

        * Redis (cluster mode enabled): T1 node types. *

        *
      • * @see AutomaticFailoverStatus * @return Returns a reference to this object so that method calls can be chained together. * @see AutomaticFailoverStatus */ Builder automaticFailover(String automaticFailover); /** *

        * Indicates the status of Multi-AZ with automatic failover for this Redis replication group. *

        *

        * Amazon ElastiCache for Redis does not support Multi-AZ with automatic failover on: *

        *
          *
        • *

          * Redis versions earlier than 2.8.6. *

          *
        • *
        • *

          * Redis (cluster mode disabled): T1 node types. *

          *
        • *
        • *

          * Redis (cluster mode enabled): T1 node types. *

          *
        • *
        * * @param automaticFailover * Indicates the status of Multi-AZ with automatic failover for this Redis replication group.

        *

        * Amazon ElastiCache for Redis does not support Multi-AZ with automatic failover on: *

        *
          *
        • *

          * Redis versions earlier than 2.8.6. *

          *
        • *
        • *

          * Redis (cluster mode disabled): T1 node types. *

          *
        • *
        • *

          * Redis (cluster mode enabled): T1 node types. *

          *
        • * @see AutomaticFailoverStatus * @return Returns a reference to this object so that method calls can be chained together. * @see AutomaticFailoverStatus */ Builder automaticFailover(AutomaticFailoverStatus automaticFailover); /** *

          * The configuration endpoint for this replication group. Use the configuration endpoint to connect to this * replication group. *

          * * @param configurationEndpoint * The configuration endpoint for this replication group. Use the configuration endpoint to connect to * this replication group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder configurationEndpoint(Endpoint configurationEndpoint); /** *

          * The configuration endpoint for this replication group. Use the configuration endpoint to connect to this * replication group. *

          * This is a convenience that creates an instance of the {@link Endpoint.Builder} avoiding the need to create * one manually via {@link Endpoint#builder()}. * * When the {@link Consumer} completes, {@link Endpoint.Builder#build()} is called immediately and its result is * passed to {@link #configurationEndpoint(Endpoint)}. * * @param configurationEndpoint * a consumer that will call methods on {@link Endpoint.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #configurationEndpoint(Endpoint) */ default Builder configurationEndpoint(Consumer configurationEndpoint) { return configurationEndpoint(Endpoint.builder().applyMutation(configurationEndpoint).build()); } /** *

          * The number of days for which ElastiCache retains automatic cluster snapshots before deleting them. For * example, if you set SnapshotRetentionLimit to 5, a snapshot that was taken today is retained for * 5 days before being deleted. *

          * *

          * If the value of SnapshotRetentionLimit is set to zero (0), backups are turned off. *

          *
          * * @param snapshotRetentionLimit * The number of days for which ElastiCache retains automatic cluster snapshots before deleting them. For * example, if you set SnapshotRetentionLimit to 5, a snapshot that was taken today is * retained for 5 days before being deleted.

          *

          * If the value of SnapshotRetentionLimit is set to zero (0), backups are turned off. *

          * @return Returns a reference to this object so that method calls can be chained together. */ Builder snapshotRetentionLimit(Integer snapshotRetentionLimit); /** *

          * The daily time range (in UTC) during which ElastiCache begins taking a daily snapshot of your node group * (shard). *

          *

          * Example: 05:00-09:00 *

          *

          * If you do not specify this parameter, ElastiCache automatically chooses an appropriate time range. *

          * *

          * This parameter is only valid if the Engine parameter is redis. *

          *
          * * @param snapshotWindow * The daily time range (in UTC) during which ElastiCache begins taking a daily snapshot of your node * group (shard).

          *

          * Example: 05:00-09:00 *

          *

          * If you do not specify this parameter, ElastiCache automatically chooses an appropriate time range. *

          * *

          * This parameter is only valid if the Engine parameter is redis. *

          * @return Returns a reference to this object so that method calls can be chained together. */ Builder snapshotWindow(String snapshotWindow); /** *

          * A flag indicating whether or not this replication group is cluster enabled; i.e., whether its data can be * partitioned across multiple shards (API/CLI: node groups). *

          *

          * Valid values: true | false *

          * * @param clusterEnabled * A flag indicating whether or not this replication group is cluster enabled; i.e., whether its data can * be partitioned across multiple shards (API/CLI: node groups).

          *

          * Valid values: true | false * @return Returns a reference to this object so that method calls can be chained together. */ Builder clusterEnabled(Boolean clusterEnabled); /** *

          * The name of the compute and memory capacity node type for each node in the replication group. *

          * * @param cacheNodeType * The name of the compute and memory capacity node type for each node in the replication group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder cacheNodeType(String cacheNodeType); /** *

          * A flag that enables using an AuthToken (password) when issuing Redis commands. *

          *

          * Default: false *

          * * @param authTokenEnabled * A flag that enables using an AuthToken (password) when issuing Redis commands.

          *

          * Default: false * @return Returns a reference to this object so that method calls can be chained together. */ Builder authTokenEnabled(Boolean authTokenEnabled); /** *

          * A flag that enables in-transit encryption when set to true. *

          *

          * You cannot modify the value of TransitEncryptionEnabled after the cluster is created. To enable * in-transit encryption on a cluster you must set TransitEncryptionEnabled to true * when you create a cluster. *

          *

          * Required: Only available when creating a replication group in an Amazon VPC using redis version * 3.2.6, 4.x or later. *

          *

          * Default: false *

          * * @param transitEncryptionEnabled * A flag that enables in-transit encryption when set to true.

          *

          * You cannot modify the value of TransitEncryptionEnabled after the cluster is created. To * enable in-transit encryption on a cluster you must set TransitEncryptionEnabled to * true when you create a cluster. *

          *

          * Required: Only available when creating a replication group in an Amazon VPC using redis version * 3.2.6, 4.x or later. *

          *

          * Default: false * @return Returns a reference to this object so that method calls can be chained together. */ Builder transitEncryptionEnabled(Boolean transitEncryptionEnabled); /** *

          * A flag that enables encryption at-rest when set to true. *

          *

          * You cannot modify the value of AtRestEncryptionEnabled after the cluster is created. To enable * encryption at-rest on a cluster you must set AtRestEncryptionEnabled to true when * you create a cluster. *

          *

          * Required: Only available when creating a replication group in an Amazon VPC using redis version * 3.2.6, 4.x or later. *

          *

          * Default: false *

          * * @param atRestEncryptionEnabled * A flag that enables encryption at-rest when set to true.

          *

          * You cannot modify the value of AtRestEncryptionEnabled after the cluster is created. To * enable encryption at-rest on a cluster you must set AtRestEncryptionEnabled to * true when you create a cluster. *

          *

          * Required: Only available when creating a replication group in an Amazon VPC using redis version * 3.2.6, 4.x or later. *

          *

          * Default: false * @return Returns a reference to this object so that method calls can be chained together. */ Builder atRestEncryptionEnabled(Boolean atRestEncryptionEnabled); /** *

          * The ID of the KMS key used to encrypt the disk in the cluster. *

          * * @param kmsKeyId * The ID of the KMS key used to encrypt the disk in the cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder kmsKeyId(String kmsKeyId); } static final class BuilderImpl implements Builder { private String replicationGroupId; private String description; private String status; private ReplicationGroupPendingModifiedValues pendingModifiedValues; private List memberClusters = DefaultSdkAutoConstructList.getInstance(); private List nodeGroups = DefaultSdkAutoConstructList.getInstance(); private String snapshottingClusterId; private String automaticFailover; private Endpoint configurationEndpoint; private Integer snapshotRetentionLimit; private String snapshotWindow; private Boolean clusterEnabled; private String cacheNodeType; private Boolean authTokenEnabled; private Boolean transitEncryptionEnabled; private Boolean atRestEncryptionEnabled; private String kmsKeyId; private BuilderImpl() { } private BuilderImpl(ReplicationGroup model) { replicationGroupId(model.replicationGroupId); description(model.description); status(model.status); pendingModifiedValues(model.pendingModifiedValues); memberClusters(model.memberClusters); nodeGroups(model.nodeGroups); snapshottingClusterId(model.snapshottingClusterId); automaticFailover(model.automaticFailover); configurationEndpoint(model.configurationEndpoint); snapshotRetentionLimit(model.snapshotRetentionLimit); snapshotWindow(model.snapshotWindow); clusterEnabled(model.clusterEnabled); cacheNodeType(model.cacheNodeType); authTokenEnabled(model.authTokenEnabled); transitEncryptionEnabled(model.transitEncryptionEnabled); atRestEncryptionEnabled(model.atRestEncryptionEnabled); kmsKeyId(model.kmsKeyId); } public final String getReplicationGroupId() { return replicationGroupId; } @Override public final Builder replicationGroupId(String replicationGroupId) { this.replicationGroupId = replicationGroupId; return this; } public final void setReplicationGroupId(String replicationGroupId) { this.replicationGroupId = replicationGroupId; } public final String getDescription() { return description; } @Override public final Builder description(String description) { this.description = description; return this; } public final void setDescription(String description) { this.description = description; } public final String getStatus() { return status; } @Override public final Builder status(String status) { this.status = status; return this; } public final void setStatus(String status) { this.status = status; } public final ReplicationGroupPendingModifiedValues.Builder getPendingModifiedValues() { return pendingModifiedValues != null ? pendingModifiedValues.toBuilder() : null; } @Override public final Builder pendingModifiedValues(ReplicationGroupPendingModifiedValues pendingModifiedValues) { this.pendingModifiedValues = pendingModifiedValues; return this; } public final void setPendingModifiedValues(ReplicationGroupPendingModifiedValues.BuilderImpl pendingModifiedValues) { this.pendingModifiedValues = pendingModifiedValues != null ? pendingModifiedValues.build() : null; } public final Collection getMemberClusters() { return memberClusters; } @Override public final Builder memberClusters(Collection memberClusters) { this.memberClusters = ClusterIdListCopier.copy(memberClusters); return this; } @Override @SafeVarargs public final Builder memberClusters(String... memberClusters) { memberClusters(Arrays.asList(memberClusters)); return this; } public final void setMemberClusters(Collection memberClusters) { this.memberClusters = ClusterIdListCopier.copy(memberClusters); } public final Collection getNodeGroups() { return nodeGroups != null ? nodeGroups.stream().map(NodeGroup::toBuilder).collect(Collectors.toList()) : null; } @Override public final Builder nodeGroups(Collection nodeGroups) { this.nodeGroups = NodeGroupListCopier.copy(nodeGroups); return this; } @Override @SafeVarargs public final Builder nodeGroups(NodeGroup... nodeGroups) { nodeGroups(Arrays.asList(nodeGroups)); return this; } @Override @SafeVarargs public final Builder nodeGroups(Consumer... nodeGroups) { nodeGroups(Stream.of(nodeGroups).map(c -> NodeGroup.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final void setNodeGroups(Collection nodeGroups) { this.nodeGroups = NodeGroupListCopier.copyFromBuilder(nodeGroups); } public final String getSnapshottingClusterId() { return snapshottingClusterId; } @Override public final Builder snapshottingClusterId(String snapshottingClusterId) { this.snapshottingClusterId = snapshottingClusterId; return this; } public final void setSnapshottingClusterId(String snapshottingClusterId) { this.snapshottingClusterId = snapshottingClusterId; } public final String getAutomaticFailoverAsString() { return automaticFailover; } @Override public final Builder automaticFailover(String automaticFailover) { this.automaticFailover = automaticFailover; return this; } @Override public final Builder automaticFailover(AutomaticFailoverStatus automaticFailover) { this.automaticFailover(automaticFailover == null ? null : automaticFailover.toString()); return this; } public final void setAutomaticFailover(String automaticFailover) { this.automaticFailover = automaticFailover; } public final Endpoint.Builder getConfigurationEndpoint() { return configurationEndpoint != null ? configurationEndpoint.toBuilder() : null; } @Override public final Builder configurationEndpoint(Endpoint configurationEndpoint) { this.configurationEndpoint = configurationEndpoint; return this; } public final void setConfigurationEndpoint(Endpoint.BuilderImpl configurationEndpoint) { this.configurationEndpoint = configurationEndpoint != null ? configurationEndpoint.build() : null; } public final Integer getSnapshotRetentionLimit() { return snapshotRetentionLimit; } @Override public final Builder snapshotRetentionLimit(Integer snapshotRetentionLimit) { this.snapshotRetentionLimit = snapshotRetentionLimit; return this; } public final void setSnapshotRetentionLimit(Integer snapshotRetentionLimit) { this.snapshotRetentionLimit = snapshotRetentionLimit; } public final String getSnapshotWindow() { return snapshotWindow; } @Override public final Builder snapshotWindow(String snapshotWindow) { this.snapshotWindow = snapshotWindow; return this; } public final void setSnapshotWindow(String snapshotWindow) { this.snapshotWindow = snapshotWindow; } public final Boolean getClusterEnabled() { return clusterEnabled; } @Override public final Builder clusterEnabled(Boolean clusterEnabled) { this.clusterEnabled = clusterEnabled; return this; } public final void setClusterEnabled(Boolean clusterEnabled) { this.clusterEnabled = clusterEnabled; } public final String getCacheNodeType() { return cacheNodeType; } @Override public final Builder cacheNodeType(String cacheNodeType) { this.cacheNodeType = cacheNodeType; return this; } public final void setCacheNodeType(String cacheNodeType) { this.cacheNodeType = cacheNodeType; } public final Boolean getAuthTokenEnabled() { return authTokenEnabled; } @Override public final Builder authTokenEnabled(Boolean authTokenEnabled) { this.authTokenEnabled = authTokenEnabled; return this; } public final void setAuthTokenEnabled(Boolean authTokenEnabled) { this.authTokenEnabled = authTokenEnabled; } public final Boolean getTransitEncryptionEnabled() { return transitEncryptionEnabled; } @Override public final Builder transitEncryptionEnabled(Boolean transitEncryptionEnabled) { this.transitEncryptionEnabled = transitEncryptionEnabled; return this; } public final void setTransitEncryptionEnabled(Boolean transitEncryptionEnabled) { this.transitEncryptionEnabled = transitEncryptionEnabled; } public final Boolean getAtRestEncryptionEnabled() { return atRestEncryptionEnabled; } @Override public final Builder atRestEncryptionEnabled(Boolean atRestEncryptionEnabled) { this.atRestEncryptionEnabled = atRestEncryptionEnabled; return this; } public final void setAtRestEncryptionEnabled(Boolean atRestEncryptionEnabled) { this.atRestEncryptionEnabled = atRestEncryptionEnabled; } public final String getKmsKeyId() { return kmsKeyId; } @Override public final Builder kmsKeyId(String kmsKeyId) { this.kmsKeyId = kmsKeyId; return this; } public final void setKmsKeyId(String kmsKeyId) { this.kmsKeyId = kmsKeyId; } @Override public ReplicationGroup build() { return new ReplicationGroup(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy