software.amazon.awssdk.services.elasticache.model.Snapshot Maven / Gradle / Ivy
/*
* 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.time.Instant;
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;
/**
*
* Represents a copy of an entire Redis cluster as of the time when the snapshot was taken.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class Snapshot implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField SNAPSHOT_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::snapshotName)).setter(setter(Builder::snapshotName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SnapshotName").build()).build();
private static final SdkField REPLICATION_GROUP_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::replicationGroupId)).setter(setter(Builder::replicationGroupId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicationGroupId").build())
.build();
private static final SdkField REPLICATION_GROUP_DESCRIPTION_FIELD = SdkField
. builder(MarshallingType.STRING)
.getter(getter(Snapshot::replicationGroupDescription))
.setter(setter(Builder::replicationGroupDescription))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicationGroupDescription")
.build()).build();
private static final SdkField CACHE_CLUSTER_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::cacheClusterId)).setter(setter(Builder::cacheClusterId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CacheClusterId").build()).build();
private static final SdkField SNAPSHOT_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::snapshotStatus)).setter(setter(Builder::snapshotStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SnapshotStatus").build()).build();
private static final SdkField SNAPSHOT_SOURCE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::snapshotSource)).setter(setter(Builder::snapshotSource))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SnapshotSource").build()).build();
private static final SdkField CACHE_NODE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::cacheNodeType)).setter(setter(Builder::cacheNodeType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CacheNodeType").build()).build();
private static final SdkField ENGINE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::engine)).setter(setter(Builder::engine))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Engine").build()).build();
private static final SdkField ENGINE_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::engineVersion)).setter(setter(Builder::engineVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EngineVersion").build()).build();
private static final SdkField NUM_CACHE_NODES_FIELD = SdkField. builder(MarshallingType.INTEGER)
.getter(getter(Snapshot::numCacheNodes)).setter(setter(Builder::numCacheNodes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NumCacheNodes").build()).build();
private static final SdkField PREFERRED_AVAILABILITY_ZONE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::preferredAvailabilityZone)).setter(setter(Builder::preferredAvailabilityZone))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PreferredAvailabilityZone").build())
.build();
private static final SdkField CACHE_CLUSTER_CREATE_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.getter(getter(Snapshot::cacheClusterCreateTime)).setter(setter(Builder::cacheClusterCreateTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CacheClusterCreateTime").build())
.build();
private static final SdkField PREFERRED_MAINTENANCE_WINDOW_FIELD = SdkField
. builder(MarshallingType.STRING)
.getter(getter(Snapshot::preferredMaintenanceWindow))
.setter(setter(Builder::preferredMaintenanceWindow))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PreferredMaintenanceWindow").build())
.build();
private static final SdkField TOPIC_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::topicArn)).setter(setter(Builder::topicArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TopicArn").build()).build();
private static final SdkField PORT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.getter(getter(Snapshot::port)).setter(setter(Builder::port))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Port").build()).build();
private static final SdkField CACHE_PARAMETER_GROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::cacheParameterGroupName)).setter(setter(Builder::cacheParameterGroupName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CacheParameterGroupName").build())
.build();
private static final SdkField CACHE_SUBNET_GROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::cacheSubnetGroupName)).setter(setter(Builder::cacheSubnetGroupName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CacheSubnetGroupName").build())
.build();
private static final SdkField VPC_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::vpcId)).setter(setter(Builder::vpcId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VpcId").build()).build();
private static final SdkField AUTO_MINOR_VERSION_UPGRADE_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.getter(getter(Snapshot::autoMinorVersionUpgrade)).setter(setter(Builder::autoMinorVersionUpgrade))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AutoMinorVersionUpgrade").build())
.build();
private static final SdkField SNAPSHOT_RETENTION_LIMIT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.getter(getter(Snapshot::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(Snapshot::snapshotWindow)).setter(setter(Builder::snapshotWindow))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SnapshotWindow").build()).build();
private static final SdkField NUM_NODE_GROUPS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.getter(getter(Snapshot::numNodeGroups)).setter(setter(Builder::numNodeGroups))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NumNodeGroups").build()).build();
private static final SdkField AUTOMATIC_FAILOVER_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::automaticFailoverAsString)).setter(setter(Builder::automaticFailover))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AutomaticFailover").build()).build();
private static final SdkField> NODE_SNAPSHOTS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(Snapshot::nodeSnapshots))
.setter(setter(Builder::nodeSnapshots))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NodeSnapshots").build(),
ListTrait
.builder()
.memberLocationName("NodeSnapshot")
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(NodeSnapshot::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("NodeSnapshot").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SNAPSHOT_NAME_FIELD,
REPLICATION_GROUP_ID_FIELD, REPLICATION_GROUP_DESCRIPTION_FIELD, CACHE_CLUSTER_ID_FIELD, SNAPSHOT_STATUS_FIELD,
SNAPSHOT_SOURCE_FIELD, CACHE_NODE_TYPE_FIELD, ENGINE_FIELD, ENGINE_VERSION_FIELD, NUM_CACHE_NODES_FIELD,
PREFERRED_AVAILABILITY_ZONE_FIELD, CACHE_CLUSTER_CREATE_TIME_FIELD, PREFERRED_MAINTENANCE_WINDOW_FIELD,
TOPIC_ARN_FIELD, PORT_FIELD, CACHE_PARAMETER_GROUP_NAME_FIELD, CACHE_SUBNET_GROUP_NAME_FIELD, VPC_ID_FIELD,
AUTO_MINOR_VERSION_UPGRADE_FIELD, SNAPSHOT_RETENTION_LIMIT_FIELD, SNAPSHOT_WINDOW_FIELD, NUM_NODE_GROUPS_FIELD,
AUTOMATIC_FAILOVER_FIELD, NODE_SNAPSHOTS_FIELD));
private static final long serialVersionUID = 1L;
private final String snapshotName;
private final String replicationGroupId;
private final String replicationGroupDescription;
private final String cacheClusterId;
private final String snapshotStatus;
private final String snapshotSource;
private final String cacheNodeType;
private final String engine;
private final String engineVersion;
private final Integer numCacheNodes;
private final String preferredAvailabilityZone;
private final Instant cacheClusterCreateTime;
private final String preferredMaintenanceWindow;
private final String topicArn;
private final Integer port;
private final String cacheParameterGroupName;
private final String cacheSubnetGroupName;
private final String vpcId;
private final Boolean autoMinorVersionUpgrade;
private final Integer snapshotRetentionLimit;
private final String snapshotWindow;
private final Integer numNodeGroups;
private final String automaticFailover;
private final List nodeSnapshots;
private Snapshot(BuilderImpl builder) {
this.snapshotName = builder.snapshotName;
this.replicationGroupId = builder.replicationGroupId;
this.replicationGroupDescription = builder.replicationGroupDescription;
this.cacheClusterId = builder.cacheClusterId;
this.snapshotStatus = builder.snapshotStatus;
this.snapshotSource = builder.snapshotSource;
this.cacheNodeType = builder.cacheNodeType;
this.engine = builder.engine;
this.engineVersion = builder.engineVersion;
this.numCacheNodes = builder.numCacheNodes;
this.preferredAvailabilityZone = builder.preferredAvailabilityZone;
this.cacheClusterCreateTime = builder.cacheClusterCreateTime;
this.preferredMaintenanceWindow = builder.preferredMaintenanceWindow;
this.topicArn = builder.topicArn;
this.port = builder.port;
this.cacheParameterGroupName = builder.cacheParameterGroupName;
this.cacheSubnetGroupName = builder.cacheSubnetGroupName;
this.vpcId = builder.vpcId;
this.autoMinorVersionUpgrade = builder.autoMinorVersionUpgrade;
this.snapshotRetentionLimit = builder.snapshotRetentionLimit;
this.snapshotWindow = builder.snapshotWindow;
this.numNodeGroups = builder.numNodeGroups;
this.automaticFailover = builder.automaticFailover;
this.nodeSnapshots = builder.nodeSnapshots;
}
/**
*
* The name of a snapshot. For an automatic snapshot, the name is system-generated. For a manual snapshot, this is
* the user-provided name.
*
*
* @return The name of a snapshot. For an automatic snapshot, the name is system-generated. For a manual snapshot,
* this is the user-provided name.
*/
public String snapshotName() {
return snapshotName;
}
/**
*
* The unique identifier of the source replication group.
*
*
* @return The unique identifier of the source replication group.
*/
public String replicationGroupId() {
return replicationGroupId;
}
/**
*
* A description of the source replication group.
*
*
* @return A description of the source replication group.
*/
public String replicationGroupDescription() {
return replicationGroupDescription;
}
/**
*
* The user-supplied identifier of the source cluster.
*
*
* @return The user-supplied identifier of the source cluster.
*/
public String cacheClusterId() {
return cacheClusterId;
}
/**
*
* The status of the snapshot. Valid values: creating
| available
| restoring
* | copying
| deleting
.
*
*
* @return The status of the snapshot. Valid values: creating
| available
|
* restoring
| copying
| deleting
.
*/
public String snapshotStatus() {
return snapshotStatus;
}
/**
*
* Indicates whether the snapshot is from an automatic backup (automated
) or was created manually (
* manual
).
*
*
* @return Indicates whether the snapshot is from an automatic backup (automated
) or was created
* manually (manual
).
*/
public String snapshotSource() {
return snapshotSource;
}
/**
*
* The name of the compute and memory capacity node type for the source cluster.
*
*
* The following node types are supported by ElastiCache. Generally speaking, the current generation types provide
* more memory and computational power at lower cost when compared to their equivalent previous generation
* counterparts.
*
*
* -
*
* General purpose:
*
*
* -
*
* Current generation:
*
*
* T2 node types: cache.t2.micro
, cache.t2.small
, cache.t2.medium
*
*
* M3 node types: cache.m3.medium
, cache.m3.large
, cache.m3.xlarge
,
* cache.m3.2xlarge
*
*
* M4 node types: cache.m4.large
, cache.m4.xlarge
, cache.m4.2xlarge
,
* cache.m4.4xlarge
, cache.m4.10xlarge
*
*
* -
*
* Previous generation: (not recommended)
*
*
* T1 node types: cache.t1.micro
*
*
* M1 node types: cache.m1.small
, cache.m1.medium
, cache.m1.large
,
* cache.m1.xlarge
*
*
*
*
* -
*
* Compute optimized:
*
*
* -
*
* Previous generation: (not recommended)
*
*
* C1 node types: cache.c1.xlarge
*
*
*
*
* -
*
* Memory optimized:
*
*
* -
*
* Current generation:
*
*
* R3 node types: cache.r3.large
, cache.r3.xlarge
, cache.r3.2xlarge
,
* cache.r3.4xlarge
, cache.r3.8xlarge
*
*
* R4 node types; cache.r4.large
, cache.r4.xlarge
, cache.r4.2xlarge
,
* cache.r4.4xlarge
, cache.r4.8xlarge
, cache.r4.16xlarge
*
*
* -
*
* Previous generation: (not recommended)
*
*
* M2 node types: cache.m2.xlarge
, cache.m2.2xlarge
, cache.m2.4xlarge
*
*
*
*
*
*
* Notes:
*
*
* -
*
* All T2 instances are created in an Amazon Virtual Private Cloud (Amazon VPC).
*
*
* -
*
* Redis (cluster mode disabled): Redis backup/restore is not supported on T1 and T2 instances.
*
*
* -
*
* Redis (cluster mode enabled): Backup/restore is not supported on T1 instances.
*
*
* -
*
* Redis Append-only files (AOF) functionality is not supported for T1 or T2 instances.
*
*
*
*
* For a complete listing of node types and specifications, see:
*
*
* -
*
*
* -
*
*
* -
*
*
*
*
* @return The name of the compute and memory capacity node type for the source cluster.
*
* The following node types are supported by ElastiCache. Generally speaking, the current generation types
* provide more memory and computational power at lower cost when compared to their equivalent previous
* generation counterparts.
*
*
* -
*
* General purpose:
*
*
* -
*
* Current generation:
*
*
* T2 node types: cache.t2.micro
, cache.t2.small
,
* cache.t2.medium
*
*
* M3 node types: cache.m3.medium
, cache.m3.large
,
* cache.m3.xlarge
, cache.m3.2xlarge
*
*
* M4 node types: cache.m4.large
, cache.m4.xlarge
,
* cache.m4.2xlarge
, cache.m4.4xlarge
, cache.m4.10xlarge
*
*
* -
*
* Previous generation: (not recommended)
*
*
* T1 node types: cache.t1.micro
*
*
* M1 node types: cache.m1.small
, cache.m1.medium
,
* cache.m1.large
, cache.m1.xlarge
*
*
*
*
* -
*
* Compute optimized:
*
*
* -
*
* Previous generation: (not recommended)
*
*
* C1 node types: cache.c1.xlarge
*
*
*
*
* -
*
* Memory optimized:
*
*
* -
*
* Current generation:
*
*
* R3 node types: cache.r3.large
, cache.r3.xlarge
,
* cache.r3.2xlarge
, cache.r3.4xlarge
, cache.r3.8xlarge
*
*
* R4 node types; cache.r4.large
, cache.r4.xlarge
,
* cache.r4.2xlarge
, cache.r4.4xlarge
, cache.r4.8xlarge
,
* cache.r4.16xlarge
*
*
* -
*
* Previous generation: (not recommended)
*
*
* M2 node types: cache.m2.xlarge
, cache.m2.2xlarge
,
* cache.m2.4xlarge
*
*
*
*
*
*
* Notes:
*
*
* -
*
* All T2 instances are created in an Amazon Virtual Private Cloud (Amazon VPC).
*
*
* -
*
* Redis (cluster mode disabled): Redis backup/restore is not supported on T1 and T2 instances.
*
*
* -
*
* Redis (cluster mode enabled): Backup/restore is not supported on T1 instances.
*
*
* -
*
* Redis Append-only files (AOF) functionality is not supported for T1 or T2 instances.
*
*
*
*
* For a complete listing of node types and specifications, see:
*
*
* -
*
*
* -
*
*
* -
*
*
*/
public String cacheNodeType() {
return cacheNodeType;
}
/**
*
* The name of the cache engine (memcached
or redis
) used by the source cluster.
*
*
* @return The name of the cache engine (memcached
or redis
) used by the source cluster.
*/
public String engine() {
return engine;
}
/**
*
* The version of the cache engine version that is used by the source cluster.
*
*
* @return The version of the cache engine version that is used by the source cluster.
*/
public String engineVersion() {
return engineVersion;
}
/**
*
* The number of cache nodes in the source cluster.
*
*
* For clusters running Redis, this value must be 1. For clusters running Memcached, this value must be between 1
* and 20.
*
*
* @return The number of cache nodes in the source cluster.
*
* For clusters running Redis, this value must be 1. For clusters running Memcached, this value must be
* between 1 and 20.
*/
public Integer numCacheNodes() {
return numCacheNodes;
}
/**
*
* The name of the Availability Zone in which the source cluster is located.
*
*
* @return The name of the Availability Zone in which the source cluster is located.
*/
public String preferredAvailabilityZone() {
return preferredAvailabilityZone;
}
/**
*
* The date and time when the source cluster was created.
*
*
* @return The date and time when the source cluster was created.
*/
public Instant cacheClusterCreateTime() {
return cacheClusterCreateTime;
}
/**
*
* Specifies the weekly time range during which maintenance on the cluster is performed. It is specified as a range
* in the format ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window is a 60 minute period.
*
*
* Valid values for ddd
are:
*
*
* -
*
* sun
*
*
* -
*
* mon
*
*
* -
*
* tue
*
*
* -
*
* wed
*
*
* -
*
* thu
*
*
* -
*
* fri
*
*
* -
*
* sat
*
*
*
*
* Example: sun:23:00-mon:01:30
*
*
* @return Specifies the weekly time range during which maintenance on the cluster is performed. It is specified as
* a range in the format ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window is a 60
* minute period.
*
* Valid values for ddd
are:
*
*
* -
*
* sun
*
*
* -
*
* mon
*
*
* -
*
* tue
*
*
* -
*
* wed
*
*
* -
*
* thu
*
*
* -
*
* fri
*
*
* -
*
* sat
*
*
*
*
* Example: sun:23:00-mon:01:30
*/
public String preferredMaintenanceWindow() {
return preferredMaintenanceWindow;
}
/**
*
* The Amazon Resource Name (ARN) for the topic used by the source cluster for publishing notifications.
*
*
* @return The Amazon Resource Name (ARN) for the topic used by the source cluster for publishing notifications.
*/
public String topicArn() {
return topicArn;
}
/**
*
* The port number used by each cache nodes in the source cluster.
*
*
* @return The port number used by each cache nodes in the source cluster.
*/
public Integer port() {
return port;
}
/**
*
* The cache parameter group that is associated with the source cluster.
*
*
* @return The cache parameter group that is associated with the source cluster.
*/
public String cacheParameterGroupName() {
return cacheParameterGroupName;
}
/**
*
* The name of the cache subnet group associated with the source cluster.
*
*
* @return The name of the cache subnet group associated with the source cluster.
*/
public String cacheSubnetGroupName() {
return cacheSubnetGroupName;
}
/**
*
* The Amazon Virtual Private Cloud identifier (VPC ID) of the cache subnet group for the source cluster.
*
*
* @return The Amazon Virtual Private Cloud identifier (VPC ID) of the cache subnet group for the source cluster.
*/
public String vpcId() {
return vpcId;
}
/**
*
* This parameter is currently disabled.
*
*
* @return This parameter is currently disabled.
*/
public Boolean autoMinorVersionUpgrade() {
return autoMinorVersionUpgrade;
}
/**
*
* For an automatic snapshot, the number of days for which ElastiCache retains the snapshot before deleting it.
*
*
* For manual snapshots, this field reflects the SnapshotRetentionLimit
for the source cluster when the
* snapshot was created. This field is otherwise ignored: Manual snapshots do not expire, and can only be deleted
* using the DeleteSnapshot
operation.
*
*
* Important If the value of SnapshotRetentionLimit is set to zero (0), backups are turned off.
*
*
* @return For an automatic snapshot, the number of days for which ElastiCache retains the snapshot before deleting
* it.
*
* For manual snapshots, this field reflects the SnapshotRetentionLimit
for the source cluster
* when the snapshot was created. This field is otherwise ignored: Manual snapshots do not expire, and can
* only be deleted using the DeleteSnapshot
operation.
*
*
* Important If the value of SnapshotRetentionLimit is set to zero (0), backups are turned off.
*/
public Integer snapshotRetentionLimit() {
return snapshotRetentionLimit;
}
/**
*
* The daily time range during which ElastiCache takes daily snapshots of the source cluster.
*
*
* @return The daily time range during which ElastiCache takes daily snapshots of the source cluster.
*/
public String snapshotWindow() {
return snapshotWindow;
}
/**
*
* The number of node groups (shards) in this snapshot. When restoring from a snapshot, the number of node groups
* (shards) in the snapshot and in the restored replication group must be the same.
*
*
* @return The number of node groups (shards) in this snapshot. When restoring from a snapshot, the number of node
* groups (shards) in the snapshot and in the restored replication group must be the same.
*/
public Integer numNodeGroups() {
return numNodeGroups;
}
/**
*
* Indicates the status of Multi-AZ with automatic failover for the source 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 and T2 cache 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 the source 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 and T2 cache 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 the source 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 and T2 cache 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 the source 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 and T2 cache node types.
*
*
* -
*
* Redis (cluster mode enabled): T1 node types.
*
*
* @see AutomaticFailoverStatus
*/
public String automaticFailoverAsString() {
return automaticFailover;
}
/**
*
* A list of the cache nodes in the source cluster.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return A list of the cache nodes in the source cluster.
*/
public List nodeSnapshots() {
return nodeSnapshots;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(snapshotName());
hashCode = 31 * hashCode + Objects.hashCode(replicationGroupId());
hashCode = 31 * hashCode + Objects.hashCode(replicationGroupDescription());
hashCode = 31 * hashCode + Objects.hashCode(cacheClusterId());
hashCode = 31 * hashCode + Objects.hashCode(snapshotStatus());
hashCode = 31 * hashCode + Objects.hashCode(snapshotSource());
hashCode = 31 * hashCode + Objects.hashCode(cacheNodeType());
hashCode = 31 * hashCode + Objects.hashCode(engine());
hashCode = 31 * hashCode + Objects.hashCode(engineVersion());
hashCode = 31 * hashCode + Objects.hashCode(numCacheNodes());
hashCode = 31 * hashCode + Objects.hashCode(preferredAvailabilityZone());
hashCode = 31 * hashCode + Objects.hashCode(cacheClusterCreateTime());
hashCode = 31 * hashCode + Objects.hashCode(preferredMaintenanceWindow());
hashCode = 31 * hashCode + Objects.hashCode(topicArn());
hashCode = 31 * hashCode + Objects.hashCode(port());
hashCode = 31 * hashCode + Objects.hashCode(cacheParameterGroupName());
hashCode = 31 * hashCode + Objects.hashCode(cacheSubnetGroupName());
hashCode = 31 * hashCode + Objects.hashCode(vpcId());
hashCode = 31 * hashCode + Objects.hashCode(autoMinorVersionUpgrade());
hashCode = 31 * hashCode + Objects.hashCode(snapshotRetentionLimit());
hashCode = 31 * hashCode + Objects.hashCode(snapshotWindow());
hashCode = 31 * hashCode + Objects.hashCode(numNodeGroups());
hashCode = 31 * hashCode + Objects.hashCode(automaticFailoverAsString());
hashCode = 31 * hashCode + Objects.hashCode(nodeSnapshots());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Snapshot)) {
return false;
}
Snapshot other = (Snapshot) obj;
return Objects.equals(snapshotName(), other.snapshotName())
&& Objects.equals(replicationGroupId(), other.replicationGroupId())
&& Objects.equals(replicationGroupDescription(), other.replicationGroupDescription())
&& Objects.equals(cacheClusterId(), other.cacheClusterId())
&& Objects.equals(snapshotStatus(), other.snapshotStatus())
&& Objects.equals(snapshotSource(), other.snapshotSource())
&& Objects.equals(cacheNodeType(), other.cacheNodeType()) && Objects.equals(engine(), other.engine())
&& Objects.equals(engineVersion(), other.engineVersion())
&& Objects.equals(numCacheNodes(), other.numCacheNodes())
&& Objects.equals(preferredAvailabilityZone(), other.preferredAvailabilityZone())
&& Objects.equals(cacheClusterCreateTime(), other.cacheClusterCreateTime())
&& Objects.equals(preferredMaintenanceWindow(), other.preferredMaintenanceWindow())
&& Objects.equals(topicArn(), other.topicArn()) && Objects.equals(port(), other.port())
&& Objects.equals(cacheParameterGroupName(), other.cacheParameterGroupName())
&& Objects.equals(cacheSubnetGroupName(), other.cacheSubnetGroupName()) && Objects.equals(vpcId(), other.vpcId())
&& Objects.equals(autoMinorVersionUpgrade(), other.autoMinorVersionUpgrade())
&& Objects.equals(snapshotRetentionLimit(), other.snapshotRetentionLimit())
&& Objects.equals(snapshotWindow(), other.snapshotWindow())
&& Objects.equals(numNodeGroups(), other.numNodeGroups())
&& Objects.equals(automaticFailoverAsString(), other.automaticFailoverAsString())
&& Objects.equals(nodeSnapshots(), other.nodeSnapshots());
}
/**
* 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("Snapshot").add("SnapshotName", snapshotName()).add("ReplicationGroupId", replicationGroupId())
.add("ReplicationGroupDescription", replicationGroupDescription()).add("CacheClusterId", cacheClusterId())
.add("SnapshotStatus", snapshotStatus()).add("SnapshotSource", snapshotSource())
.add("CacheNodeType", cacheNodeType()).add("Engine", engine()).add("EngineVersion", engineVersion())
.add("NumCacheNodes", numCacheNodes()).add("PreferredAvailabilityZone", preferredAvailabilityZone())
.add("CacheClusterCreateTime", cacheClusterCreateTime())
.add("PreferredMaintenanceWindow", preferredMaintenanceWindow()).add("TopicArn", topicArn()).add("Port", port())
.add("CacheParameterGroupName", cacheParameterGroupName()).add("CacheSubnetGroupName", cacheSubnetGroupName())
.add("VpcId", vpcId()).add("AutoMinorVersionUpgrade", autoMinorVersionUpgrade())
.add("SnapshotRetentionLimit", snapshotRetentionLimit()).add("SnapshotWindow", snapshotWindow())
.add("NumNodeGroups", numNodeGroups()).add("AutomaticFailover", automaticFailoverAsString())
.add("NodeSnapshots", nodeSnapshots()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "SnapshotName":
return Optional.ofNullable(clazz.cast(snapshotName()));
case "ReplicationGroupId":
return Optional.ofNullable(clazz.cast(replicationGroupId()));
case "ReplicationGroupDescription":
return Optional.ofNullable(clazz.cast(replicationGroupDescription()));
case "CacheClusterId":
return Optional.ofNullable(clazz.cast(cacheClusterId()));
case "SnapshotStatus":
return Optional.ofNullable(clazz.cast(snapshotStatus()));
case "SnapshotSource":
return Optional.ofNullable(clazz.cast(snapshotSource()));
case "CacheNodeType":
return Optional.ofNullable(clazz.cast(cacheNodeType()));
case "Engine":
return Optional.ofNullable(clazz.cast(engine()));
case "EngineVersion":
return Optional.ofNullable(clazz.cast(engineVersion()));
case "NumCacheNodes":
return Optional.ofNullable(clazz.cast(numCacheNodes()));
case "PreferredAvailabilityZone":
return Optional.ofNullable(clazz.cast(preferredAvailabilityZone()));
case "CacheClusterCreateTime":
return Optional.ofNullable(clazz.cast(cacheClusterCreateTime()));
case "PreferredMaintenanceWindow":
return Optional.ofNullable(clazz.cast(preferredMaintenanceWindow()));
case "TopicArn":
return Optional.ofNullable(clazz.cast(topicArn()));
case "Port":
return Optional.ofNullable(clazz.cast(port()));
case "CacheParameterGroupName":
return Optional.ofNullable(clazz.cast(cacheParameterGroupName()));
case "CacheSubnetGroupName":
return Optional.ofNullable(clazz.cast(cacheSubnetGroupName()));
case "VpcId":
return Optional.ofNullable(clazz.cast(vpcId()));
case "AutoMinorVersionUpgrade":
return Optional.ofNullable(clazz.cast(autoMinorVersionUpgrade()));
case "SnapshotRetentionLimit":
return Optional.ofNullable(clazz.cast(snapshotRetentionLimit()));
case "SnapshotWindow":
return Optional.ofNullable(clazz.cast(snapshotWindow()));
case "NumNodeGroups":
return Optional.ofNullable(clazz.cast(numNodeGroups()));
case "AutomaticFailover":
return Optional.ofNullable(clazz.cast(automaticFailoverAsString()));
case "NodeSnapshots":
return Optional.ofNullable(clazz.cast(nodeSnapshots()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function