
software.amazon.awssdk.services.databasemigration.model.ReplicationTask Maven / Gradle / Ivy
/*
* Copyright 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.databasemigration.model;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
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 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.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Provides information that describes a replication task created by the CreateReplicationTask
operation.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ReplicationTask implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField REPLICATION_TASK_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ReplicationTaskIdentifier").getter(getter(ReplicationTask::replicationTaskIdentifier))
.setter(setter(Builder::replicationTaskIdentifier))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicationTaskIdentifier").build())
.build();
private static final SdkField SOURCE_ENDPOINT_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SourceEndpointArn").getter(getter(ReplicationTask::sourceEndpointArn))
.setter(setter(Builder::sourceEndpointArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceEndpointArn").build()).build();
private static final SdkField TARGET_ENDPOINT_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TargetEndpointArn").getter(getter(ReplicationTask::targetEndpointArn))
.setter(setter(Builder::targetEndpointArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TargetEndpointArn").build()).build();
private static final SdkField REPLICATION_INSTANCE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ReplicationInstanceArn").getter(getter(ReplicationTask::replicationInstanceArn))
.setter(setter(Builder::replicationInstanceArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicationInstanceArn").build())
.build();
private static final SdkField MIGRATION_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("MigrationType").getter(getter(ReplicationTask::migrationTypeAsString))
.setter(setter(Builder::migrationType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MigrationType").build()).build();
private static final SdkField TABLE_MAPPINGS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TableMappings").getter(getter(ReplicationTask::tableMappings)).setter(setter(Builder::tableMappings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TableMappings").build()).build();
private static final SdkField REPLICATION_TASK_SETTINGS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ReplicationTaskSettings").getter(getter(ReplicationTask::replicationTaskSettings))
.setter(setter(Builder::replicationTaskSettings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicationTaskSettings").build())
.build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status")
.getter(getter(ReplicationTask::status)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();
private static final SdkField LAST_FAILURE_MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LastFailureMessage").getter(getter(ReplicationTask::lastFailureMessage))
.setter(setter(Builder::lastFailureMessage))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastFailureMessage").build())
.build();
private static final SdkField STOP_REASON_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StopReason").getter(getter(ReplicationTask::stopReason)).setter(setter(Builder::stopReason))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StopReason").build()).build();
private static final SdkField REPLICATION_TASK_CREATION_DATE_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("ReplicationTaskCreationDate")
.getter(getter(ReplicationTask::replicationTaskCreationDate))
.setter(setter(Builder::replicationTaskCreationDate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicationTaskCreationDate")
.build()).build();
private static final SdkField REPLICATION_TASK_START_DATE_FIELD = SdkField
. builder(MarshallingType.INSTANT).memberName("ReplicationTaskStartDate")
.getter(getter(ReplicationTask::replicationTaskStartDate)).setter(setter(Builder::replicationTaskStartDate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicationTaskStartDate").build())
.build();
private static final SdkField CDC_START_POSITION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CdcStartPosition").getter(getter(ReplicationTask::cdcStartPosition))
.setter(setter(Builder::cdcStartPosition))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CdcStartPosition").build()).build();
private static final SdkField CDC_STOP_POSITION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CdcStopPosition").getter(getter(ReplicationTask::cdcStopPosition))
.setter(setter(Builder::cdcStopPosition))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CdcStopPosition").build()).build();
private static final SdkField RECOVERY_CHECKPOINT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RecoveryCheckpoint").getter(getter(ReplicationTask::recoveryCheckpoint))
.setter(setter(Builder::recoveryCheckpoint))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecoveryCheckpoint").build())
.build();
private static final SdkField REPLICATION_TASK_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ReplicationTaskArn").getter(getter(ReplicationTask::replicationTaskArn))
.setter(setter(Builder::replicationTaskArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicationTaskArn").build())
.build();
private static final SdkField REPLICATION_TASK_STATS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ReplicationTaskStats")
.getter(getter(ReplicationTask::replicationTaskStats)).setter(setter(Builder::replicationTaskStats))
.constructor(ReplicationTaskStats::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicationTaskStats").build())
.build();
private static final SdkField TASK_DATA_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TaskData").getter(getter(ReplicationTask::taskData)).setter(setter(Builder::taskData))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TaskData").build()).build();
private static final SdkField TARGET_REPLICATION_INSTANCE_ARN_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("TargetReplicationInstanceArn")
.getter(getter(ReplicationTask::targetReplicationInstanceArn))
.setter(setter(Builder::targetReplicationInstanceArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TargetReplicationInstanceArn")
.build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
REPLICATION_TASK_IDENTIFIER_FIELD, SOURCE_ENDPOINT_ARN_FIELD, TARGET_ENDPOINT_ARN_FIELD,
REPLICATION_INSTANCE_ARN_FIELD, MIGRATION_TYPE_FIELD, TABLE_MAPPINGS_FIELD, REPLICATION_TASK_SETTINGS_FIELD,
STATUS_FIELD, LAST_FAILURE_MESSAGE_FIELD, STOP_REASON_FIELD, REPLICATION_TASK_CREATION_DATE_FIELD,
REPLICATION_TASK_START_DATE_FIELD, CDC_START_POSITION_FIELD, CDC_STOP_POSITION_FIELD, RECOVERY_CHECKPOINT_FIELD,
REPLICATION_TASK_ARN_FIELD, REPLICATION_TASK_STATS_FIELD, TASK_DATA_FIELD, TARGET_REPLICATION_INSTANCE_ARN_FIELD));
private static final long serialVersionUID = 1L;
private final String replicationTaskIdentifier;
private final String sourceEndpointArn;
private final String targetEndpointArn;
private final String replicationInstanceArn;
private final String migrationType;
private final String tableMappings;
private final String replicationTaskSettings;
private final String status;
private final String lastFailureMessage;
private final String stopReason;
private final Instant replicationTaskCreationDate;
private final Instant replicationTaskStartDate;
private final String cdcStartPosition;
private final String cdcStopPosition;
private final String recoveryCheckpoint;
private final String replicationTaskArn;
private final ReplicationTaskStats replicationTaskStats;
private final String taskData;
private final String targetReplicationInstanceArn;
private ReplicationTask(BuilderImpl builder) {
this.replicationTaskIdentifier = builder.replicationTaskIdentifier;
this.sourceEndpointArn = builder.sourceEndpointArn;
this.targetEndpointArn = builder.targetEndpointArn;
this.replicationInstanceArn = builder.replicationInstanceArn;
this.migrationType = builder.migrationType;
this.tableMappings = builder.tableMappings;
this.replicationTaskSettings = builder.replicationTaskSettings;
this.status = builder.status;
this.lastFailureMessage = builder.lastFailureMessage;
this.stopReason = builder.stopReason;
this.replicationTaskCreationDate = builder.replicationTaskCreationDate;
this.replicationTaskStartDate = builder.replicationTaskStartDate;
this.cdcStartPosition = builder.cdcStartPosition;
this.cdcStopPosition = builder.cdcStopPosition;
this.recoveryCheckpoint = builder.recoveryCheckpoint;
this.replicationTaskArn = builder.replicationTaskArn;
this.replicationTaskStats = builder.replicationTaskStats;
this.taskData = builder.taskData;
this.targetReplicationInstanceArn = builder.targetReplicationInstanceArn;
}
/**
*
* The user-assigned replication task identifier or name.
*
*
* Constraints:
*
*
* -
*
* Must contain 1-255 alphanumeric characters or hyphens.
*
*
* -
*
* First character must be a letter.
*
*
* -
*
* Cannot end with a hyphen or contain two consecutive hyphens.
*
*
*
*
* @return The user-assigned replication task identifier or name.
*
* Constraints:
*
*
* -
*
* Must contain 1-255 alphanumeric characters or hyphens.
*
*
* -
*
* First character must be a letter.
*
*
* -
*
* Cannot end with a hyphen or contain two consecutive hyphens.
*
*
*/
public final String replicationTaskIdentifier() {
return replicationTaskIdentifier;
}
/**
*
* The Amazon Resource Name (ARN) that uniquely identifies the endpoint.
*
*
* @return The Amazon Resource Name (ARN) that uniquely identifies the endpoint.
*/
public final String sourceEndpointArn() {
return sourceEndpointArn;
}
/**
*
* The ARN that uniquely identifies the endpoint.
*
*
* @return The ARN that uniquely identifies the endpoint.
*/
public final String targetEndpointArn() {
return targetEndpointArn;
}
/**
*
* The ARN of the replication instance.
*
*
* @return The ARN of the replication instance.
*/
public final String replicationInstanceArn() {
return replicationInstanceArn;
}
/**
*
* The type of migration.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #migrationType}
* will return {@link MigrationTypeValue#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #migrationTypeAsString}.
*
*
* @return The type of migration.
* @see MigrationTypeValue
*/
public final MigrationTypeValue migrationType() {
return MigrationTypeValue.fromValue(migrationType);
}
/**
*
* The type of migration.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #migrationType}
* will return {@link MigrationTypeValue#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #migrationTypeAsString}.
*
*
* @return The type of migration.
* @see MigrationTypeValue
*/
public final String migrationTypeAsString() {
return migrationType;
}
/**
*
* Table mappings specified in the task.
*
*
* @return Table mappings specified in the task.
*/
public final String tableMappings() {
return tableMappings;
}
/**
*
* The settings for the replication task.
*
*
* @return The settings for the replication task.
*/
public final String replicationTaskSettings() {
return replicationTaskSettings;
}
/**
*
* The status of the replication task. This response parameter can return one of the following values:
*
*
* -
*
* "moving"
– The task is being moved in response to running the
* MoveReplicationTask
operation.
*
*
* -
*
* "creating"
– The task is being created in response to running the
* CreateReplicationTask
operation.
*
*
* -
*
* "deleting"
– The task is being deleted in response to running the
* DeleteReplicationTask
operation.
*
*
* -
*
* "failed"
– The task failed to successfully complete the database migration in response to running
* the
* StartReplicationTask
operation.
*
*
* -
*
* "failed-move"
– The task failed to move in response to running the
* MoveReplicationTask
operation.
*
*
* -
*
* "modifying"
– The task definition is being modified in response to running the
* ModifyReplicationTask
operation.
*
*
* -
*
* "ready"
– The task is in a ready
state where it can respond to other task operations,
* such as
* StartReplicationTask
or
* DeleteReplicationTask
.
*
*
* -
*
* "running"
– The task is performing a database migration in response to running the
* StartReplicationTask
operation.
*
*
* -
*
* "starting"
– The task is preparing to perform a database migration in response to running the
* StartReplicationTask
operation.
*
*
* -
*
* "stopped"
– The task has stopped in response to running the
* StopReplicationTask
operation.
*
*
* -
*
* "stopping"
– The task is preparing to stop in response to running the
* StopReplicationTask
operation.
*
*
* -
*
* "testing"
– The database migration specified for this task is being tested in response to running
* either the
* StartReplicationTaskAssessmentRun
or the
* StartReplicationTaskAssessment
operation.
*
*
*
*
* StartReplicationTaskAssessmentRun
is an improved premigration task assessment operation. The
* StartReplicationTaskAssessment
operation assesses data type compatibility only between the
* source and target database of a given migration task. In contrast,
* StartReplicationTaskAssessmentRun
enables you to specify a variety of premigration task
* assessments in addition to data type compatibility. These assessments include ones for the validity of primary
* key definitions and likely issues with database migration performance, among others.
*
*
*
*
* @return The status of the replication task. This response parameter can return one of the following values:
*
* -
*
* "moving"
– The task is being moved in response to running the
* MoveReplicationTask
operation.
*
*
* -
*
* "creating"
– The task is being created in response to running the
* CreateReplicationTask
operation.
*
*
* -
*
* "deleting"
– The task is being deleted in response to running the
* DeleteReplicationTask
operation.
*
*
* -
*
* "failed"
– The task failed to successfully complete the database migration in response to
* running the
* StartReplicationTask
operation.
*
*
* -
*
* "failed-move"
– The task failed to move in response to running the
* MoveReplicationTask
operation.
*
*
* -
*
* "modifying"
– The task definition is being modified in response to running the
* ModifyReplicationTask
operation.
*
*
* -
*
* "ready"
– The task is in a ready
state where it can respond to other task
* operations, such as
* StartReplicationTask
or
* DeleteReplicationTask
.
*
*
* -
*
* "running"
– The task is performing a database migration in response to running the
* StartReplicationTask
operation.
*
*
* -
*
* "starting"
– The task is preparing to perform a database migration in response to running
* the
* StartReplicationTask
operation.
*
*
* -
*
* "stopped"
– The task has stopped in response to running the
* StopReplicationTask
operation.
*
*
* -
*
* "stopping"
– The task is preparing to stop in response to running the
* StopReplicationTask
operation.
*
*
* -
*
* "testing"
– The database migration specified for this task is being tested in response to
* running either the
* StartReplicationTaskAssessmentRun
or the
* StartReplicationTaskAssessment
operation.
*
*
*
*
* StartReplicationTaskAssessmentRun
is an improved premigration task assessment
* operation. The
* StartReplicationTaskAssessment
operation assesses data type compatibility only between
* the source and target database of a given migration task. In contrast,
* StartReplicationTaskAssessmentRun
enables you to specify a variety of premigration task
* assessments in addition to data type compatibility. These assessments include ones for the validity of
* primary key definitions and likely issues with database migration performance, among others.
*
*
*/
public final String status() {
return status;
}
/**
*
* The last error (failure) message generated for the replication task.
*
*
* @return The last error (failure) message generated for the replication task.
*/
public final String lastFailureMessage() {
return lastFailureMessage;
}
/**
*
* The reason the replication task was stopped. This response parameter can return one of the following values:
*
*
* -
*
* "STOP_REASON_FULL_LOAD_COMPLETED"
– Full-load migration completed.
*
*
* -
*
* "STOP_REASON_CACHED_CHANGES_APPLIED"
– Change data capture (CDC) load completed.
*
*
* -
*
* "STOP_REASON_CACHED_CHANGES_NOT_APPLIED"
– In a full-load and CDC migration, the full load stopped
* as specified before starting the CDC migration.
*
*
* -
*
* "STOP_REASON_SERVER_TIME"
– The migration stopped at the specified server time.
*
*
*
*
* @return The reason the replication task was stopped. This response parameter can return one of the following
* values:
*
* -
*
* "STOP_REASON_FULL_LOAD_COMPLETED"
– Full-load migration completed.
*
*
* -
*
* "STOP_REASON_CACHED_CHANGES_APPLIED"
– Change data capture (CDC) load completed.
*
*
* -
*
* "STOP_REASON_CACHED_CHANGES_NOT_APPLIED"
– In a full-load and CDC migration, the full load
* stopped as specified before starting the CDC migration.
*
*
* -
*
* "STOP_REASON_SERVER_TIME"
– The migration stopped at the specified server time.
*
*
*/
public final String stopReason() {
return stopReason;
}
/**
*
* The date the replication task was created.
*
*
* @return The date the replication task was created.
*/
public final Instant replicationTaskCreationDate() {
return replicationTaskCreationDate;
}
/**
*
* The date the replication task is scheduled to start.
*
*
* @return The date the replication task is scheduled to start.
*/
public final Instant replicationTaskStartDate() {
return replicationTaskStartDate;
}
/**
*
* Indicates when you want a change data capture (CDC) operation to start. Use either CdcStartPosition
* or CdcStartTime
to specify when you want the CDC operation to start. Specifying both values results
* in an error.
*
*
* The value can be in date, checkpoint, or LSN/SCN format.
*
*
* Date Example: --cdc-start-position “2018-03-08T12:12:12”
*
*
* Checkpoint Example: --cdc-start-position
* "checkpoint:V1#27#mysql-bin-changelog.157832:1975:-1:2002:677883278264080:mysql-bin-changelog.157832:1876#0#0#*#0#93"
*
*
* LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373”
*
*
* @return Indicates when you want a change data capture (CDC) operation to start. Use either
* CdcStartPosition
or CdcStartTime
to specify when you want the CDC operation to
* start. Specifying both values results in an error.
*
* The value can be in date, checkpoint, or LSN/SCN format.
*
*
* Date Example: --cdc-start-position “2018-03-08T12:12:12”
*
*
* Checkpoint Example: --cdc-start-position
* "checkpoint:V1#27#mysql-bin-changelog.157832:1975:-1:2002:677883278264080:mysql-bin-changelog.157832:1876#0#0#*#0#93"
*
*
* LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373”
*/
public final String cdcStartPosition() {
return cdcStartPosition;
}
/**
*
* Indicates when you want a change data capture (CDC) operation to stop. The value can be either server time or
* commit time.
*
*
* Server time example: --cdc-stop-position “server_time:2018-02-09T12:12:12”
*
*
* Commit time example: --cdc-stop-position “commit_time: 2018-02-09T12:12:12 “
*
*
* @return Indicates when you want a change data capture (CDC) operation to stop. The value can be either server
* time or commit time.
*
* Server time example: --cdc-stop-position “server_time:2018-02-09T12:12:12”
*
*
* Commit time example: --cdc-stop-position “commit_time: 2018-02-09T12:12:12 “
*/
public final String cdcStopPosition() {
return cdcStopPosition;
}
/**
*
* Indicates the last checkpoint that occurred during a change data capture (CDC) operation. You can provide this
* value to the CdcStartPosition
parameter to start a CDC operation that begins at that checkpoint.
*
*
* @return Indicates the last checkpoint that occurred during a change data capture (CDC) operation. You can provide
* this value to the CdcStartPosition
parameter to start a CDC operation that begins at that
* checkpoint.
*/
public final String recoveryCheckpoint() {
return recoveryCheckpoint;
}
/**
*
* The Amazon Resource Name (ARN) of the replication task.
*
*
* @return The Amazon Resource Name (ARN) of the replication task.
*/
public final String replicationTaskArn() {
return replicationTaskArn;
}
/**
*
* The statistics for the task, including elapsed time, tables loaded, and table errors.
*
*
* @return The statistics for the task, including elapsed time, tables loaded, and table errors.
*/
public final ReplicationTaskStats replicationTaskStats() {
return replicationTaskStats;
}
/**
*
* Supplemental information that the task requires to migrate the data for certain source and target endpoints. For
* more information, see Specifying Supplemental Data for
* Task Settings in the AWS Database Migration Service User Guide.
*
*
* @return Supplemental information that the task requires to migrate the data for certain source and target
* endpoints. For more information, see Specifying Supplemental
* Data for Task Settings in the AWS Database Migration Service User Guide.
*/
public final String taskData() {
return taskData;
}
/**
*
* The ARN of the replication instance to which this task is moved in response to running the
* MoveReplicationTask
operation. Otherwise, this response parameter isn't a member of the
* ReplicationTask
object.
*
*
* @return The ARN of the replication instance to which this task is moved in response to running the
* MoveReplicationTask
operation. Otherwise, this response parameter isn't a member of the
* ReplicationTask
object.
*/
public final String targetReplicationInstanceArn() {
return targetReplicationInstanceArn;
}
@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 final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(replicationTaskIdentifier());
hashCode = 31 * hashCode + Objects.hashCode(sourceEndpointArn());
hashCode = 31 * hashCode + Objects.hashCode(targetEndpointArn());
hashCode = 31 * hashCode + Objects.hashCode(replicationInstanceArn());
hashCode = 31 * hashCode + Objects.hashCode(migrationTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(tableMappings());
hashCode = 31 * hashCode + Objects.hashCode(replicationTaskSettings());
hashCode = 31 * hashCode + Objects.hashCode(status());
hashCode = 31 * hashCode + Objects.hashCode(lastFailureMessage());
hashCode = 31 * hashCode + Objects.hashCode(stopReason());
hashCode = 31 * hashCode + Objects.hashCode(replicationTaskCreationDate());
hashCode = 31 * hashCode + Objects.hashCode(replicationTaskStartDate());
hashCode = 31 * hashCode + Objects.hashCode(cdcStartPosition());
hashCode = 31 * hashCode + Objects.hashCode(cdcStopPosition());
hashCode = 31 * hashCode + Objects.hashCode(recoveryCheckpoint());
hashCode = 31 * hashCode + Objects.hashCode(replicationTaskArn());
hashCode = 31 * hashCode + Objects.hashCode(replicationTaskStats());
hashCode = 31 * hashCode + Objects.hashCode(taskData());
hashCode = 31 * hashCode + Objects.hashCode(targetReplicationInstanceArn());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ReplicationTask)) {
return false;
}
ReplicationTask other = (ReplicationTask) obj;
return Objects.equals(replicationTaskIdentifier(), other.replicationTaskIdentifier())
&& Objects.equals(sourceEndpointArn(), other.sourceEndpointArn())
&& Objects.equals(targetEndpointArn(), other.targetEndpointArn())
&& Objects.equals(replicationInstanceArn(), other.replicationInstanceArn())
&& Objects.equals(migrationTypeAsString(), other.migrationTypeAsString())
&& Objects.equals(tableMappings(), other.tableMappings())
&& Objects.equals(replicationTaskSettings(), other.replicationTaskSettings())
&& Objects.equals(status(), other.status()) && Objects.equals(lastFailureMessage(), other.lastFailureMessage())
&& Objects.equals(stopReason(), other.stopReason())
&& Objects.equals(replicationTaskCreationDate(), other.replicationTaskCreationDate())
&& Objects.equals(replicationTaskStartDate(), other.replicationTaskStartDate())
&& Objects.equals(cdcStartPosition(), other.cdcStartPosition())
&& Objects.equals(cdcStopPosition(), other.cdcStopPosition())
&& Objects.equals(recoveryCheckpoint(), other.recoveryCheckpoint())
&& Objects.equals(replicationTaskArn(), other.replicationTaskArn())
&& Objects.equals(replicationTaskStats(), other.replicationTaskStats())
&& Objects.equals(taskData(), other.taskData())
&& Objects.equals(targetReplicationInstanceArn(), other.targetReplicationInstanceArn());
}
/**
* 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 final String toString() {
return ToString.builder("ReplicationTask").add("ReplicationTaskIdentifier", replicationTaskIdentifier())
.add("SourceEndpointArn", sourceEndpointArn()).add("TargetEndpointArn", targetEndpointArn())
.add("ReplicationInstanceArn", replicationInstanceArn()).add("MigrationType", migrationTypeAsString())
.add("TableMappings", tableMappings()).add("ReplicationTaskSettings", replicationTaskSettings())
.add("Status", status()).add("LastFailureMessage", lastFailureMessage()).add("StopReason", stopReason())
.add("ReplicationTaskCreationDate", replicationTaskCreationDate())
.add("ReplicationTaskStartDate", replicationTaskStartDate()).add("CdcStartPosition", cdcStartPosition())
.add("CdcStopPosition", cdcStopPosition()).add("RecoveryCheckpoint", recoveryCheckpoint())
.add("ReplicationTaskArn", replicationTaskArn()).add("ReplicationTaskStats", replicationTaskStats())
.add("TaskData", taskData()).add("TargetReplicationInstanceArn", targetReplicationInstanceArn()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ReplicationTaskIdentifier":
return Optional.ofNullable(clazz.cast(replicationTaskIdentifier()));
case "SourceEndpointArn":
return Optional.ofNullable(clazz.cast(sourceEndpointArn()));
case "TargetEndpointArn":
return Optional.ofNullable(clazz.cast(targetEndpointArn()));
case "ReplicationInstanceArn":
return Optional.ofNullable(clazz.cast(replicationInstanceArn()));
case "MigrationType":
return Optional.ofNullable(clazz.cast(migrationTypeAsString()));
case "TableMappings":
return Optional.ofNullable(clazz.cast(tableMappings()));
case "ReplicationTaskSettings":
return Optional.ofNullable(clazz.cast(replicationTaskSettings()));
case "Status":
return Optional.ofNullable(clazz.cast(status()));
case "LastFailureMessage":
return Optional.ofNullable(clazz.cast(lastFailureMessage()));
case "StopReason":
return Optional.ofNullable(clazz.cast(stopReason()));
case "ReplicationTaskCreationDate":
return Optional.ofNullable(clazz.cast(replicationTaskCreationDate()));
case "ReplicationTaskStartDate":
return Optional.ofNullable(clazz.cast(replicationTaskStartDate()));
case "CdcStartPosition":
return Optional.ofNullable(clazz.cast(cdcStartPosition()));
case "CdcStopPosition":
return Optional.ofNullable(clazz.cast(cdcStopPosition()));
case "RecoveryCheckpoint":
return Optional.ofNullable(clazz.cast(recoveryCheckpoint()));
case "ReplicationTaskArn":
return Optional.ofNullable(clazz.cast(replicationTaskArn()));
case "ReplicationTaskStats":
return Optional.ofNullable(clazz.cast(replicationTaskStats()));
case "TaskData":
return Optional.ofNullable(clazz.cast(taskData()));
case "TargetReplicationInstanceArn":
return Optional.ofNullable(clazz.cast(targetReplicationInstanceArn()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function