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

software.amazon.awssdk.services.databasemigration.model.ReplicationTask Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Database Migration Service module holds the client classes that are used for communicating with AWS Database Migration Service.

There is a newer version: 2.0.0-preview-11
Show newest version
/*
 * Copyright 2012-2017 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.time.Instant;
import java.util.Optional;
import javax.annotation.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.core.protocol.ProtocolMarshaller;
import software.amazon.awssdk.core.protocol.StructuredPojo;
import software.amazon.awssdk.services.databasemigration.transform.ReplicationTaskMarshaller;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

*/ @Generated("software.amazon.awssdk:codegen") public class ReplicationTask implements StructuredPojo, ToCopyableBuilder { 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 replicationTaskArn; private final ReplicationTaskStats replicationTaskStats; 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.replicationTaskArn = builder.replicationTaskArn; this.replicationTaskStats = builder.replicationTaskStats; } /** *

* The replication task identifier. *

*

* Constraints: *

*
    *
  • *

    * Must contain from 1 to 255 alphanumeric characters or hyphens. *

    *
  • *
  • *

    * First character must be a letter. *

    *
  • *
  • *

    * Cannot end with a hyphen or contain two consecutive hyphens. *

    *
  • *
* * @return The replication task identifier.

*

* Constraints: *

*
    *
  • *

    * Must contain from 1 to 255 alphanumeric characters or hyphens. *

    *
  • *
  • *

    * First character must be a letter. *

    *
  • *
  • *

    * Cannot end with a hyphen or contain two consecutive hyphens. *

    *
  • */ public String replicationTaskIdentifier() { return replicationTaskIdentifier; } /** *

    * The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. *

    * * @return The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. */ public String sourceEndpointArn() { return sourceEndpointArn; } /** *

    * The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. *

    * * @return The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. */ public String targetEndpointArn() { return targetEndpointArn; } /** *

    * The Amazon Resource Name (ARN) of the replication instance. *

    * * @return The Amazon Resource Name (ARN) of the replication instance. */ public 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 #migrationTypeString}. *

    * * @return The type of migration. * @see MigrationTypeValue */ public 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 #migrationTypeString}. *

    * * @return The type of migration. * @see MigrationTypeValue */ public String migrationTypeString() { return migrationType; } /** *

    * Table mappings specified in the task. *

    * * @return Table mappings specified in the task. */ public String tableMappings() { return tableMappings; } /** *

    * The settings for the replication task. *

    * * @return The settings for the replication task. */ public String replicationTaskSettings() { return replicationTaskSettings; } /** *

    * The status of the replication task. *

    * * @return The status of the replication task. */ public String status() { return status; } /** *

    * The last error (failure) message generated for the replication instance. *

    * * @return The last error (failure) message generated for the replication instance. */ public String lastFailureMessage() { return lastFailureMessage; } /** *

    * The reason the replication task was stopped. *

    * * @return The reason the replication task was stopped. */ public String stopReason() { return stopReason; } /** *

    * The date the replication task was created. *

    * * @return The date the replication task was created. */ public Instant replicationTaskCreationDate() { return replicationTaskCreationDate; } /** *

    * The date the replication task is scheduled to start. *

    * * @return The date the replication task is scheduled to start. */ public Instant replicationTaskStartDate() { return replicationTaskStartDate; } /** *

    * The Amazon Resource Name (ARN) of the replication task. *

    * * @return The Amazon Resource Name (ARN) of the replication task. */ public 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 ReplicationTaskStats replicationTaskStats() { return replicationTaskStats; } @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 + ((replicationTaskIdentifier() == null) ? 0 : replicationTaskIdentifier().hashCode()); hashCode = 31 * hashCode + ((sourceEndpointArn() == null) ? 0 : sourceEndpointArn().hashCode()); hashCode = 31 * hashCode + ((targetEndpointArn() == null) ? 0 : targetEndpointArn().hashCode()); hashCode = 31 * hashCode + ((replicationInstanceArn() == null) ? 0 : replicationInstanceArn().hashCode()); hashCode = 31 * hashCode + ((migrationTypeString() == null) ? 0 : migrationTypeString().hashCode()); hashCode = 31 * hashCode + ((tableMappings() == null) ? 0 : tableMappings().hashCode()); hashCode = 31 * hashCode + ((replicationTaskSettings() == null) ? 0 : replicationTaskSettings().hashCode()); hashCode = 31 * hashCode + ((status() == null) ? 0 : status().hashCode()); hashCode = 31 * hashCode + ((lastFailureMessage() == null) ? 0 : lastFailureMessage().hashCode()); hashCode = 31 * hashCode + ((stopReason() == null) ? 0 : stopReason().hashCode()); hashCode = 31 * hashCode + ((replicationTaskCreationDate() == null) ? 0 : replicationTaskCreationDate().hashCode()); hashCode = 31 * hashCode + ((replicationTaskStartDate() == null) ? 0 : replicationTaskStartDate().hashCode()); hashCode = 31 * hashCode + ((replicationTaskArn() == null) ? 0 : replicationTaskArn().hashCode()); hashCode = 31 * hashCode + ((replicationTaskStats() == null) ? 0 : replicationTaskStats().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof ReplicationTask)) { return false; } ReplicationTask other = (ReplicationTask) obj; if (other.replicationTaskIdentifier() == null ^ this.replicationTaskIdentifier() == null) { return false; } if (other.replicationTaskIdentifier() != null && !other.replicationTaskIdentifier().equals(this.replicationTaskIdentifier())) { return false; } if (other.sourceEndpointArn() == null ^ this.sourceEndpointArn() == null) { return false; } if (other.sourceEndpointArn() != null && !other.sourceEndpointArn().equals(this.sourceEndpointArn())) { return false; } if (other.targetEndpointArn() == null ^ this.targetEndpointArn() == null) { return false; } if (other.targetEndpointArn() != null && !other.targetEndpointArn().equals(this.targetEndpointArn())) { return false; } if (other.replicationInstanceArn() == null ^ this.replicationInstanceArn() == null) { return false; } if (other.replicationInstanceArn() != null && !other.replicationInstanceArn().equals(this.replicationInstanceArn())) { return false; } if (other.migrationTypeString() == null ^ this.migrationTypeString() == null) { return false; } if (other.migrationTypeString() != null && !other.migrationTypeString().equals(this.migrationTypeString())) { return false; } if (other.tableMappings() == null ^ this.tableMappings() == null) { return false; } if (other.tableMappings() != null && !other.tableMappings().equals(this.tableMappings())) { return false; } if (other.replicationTaskSettings() == null ^ this.replicationTaskSettings() == null) { return false; } if (other.replicationTaskSettings() != null && !other.replicationTaskSettings().equals(this.replicationTaskSettings())) { return false; } if (other.status() == null ^ this.status() == null) { return false; } if (other.status() != null && !other.status().equals(this.status())) { return false; } if (other.lastFailureMessage() == null ^ this.lastFailureMessage() == null) { return false; } if (other.lastFailureMessage() != null && !other.lastFailureMessage().equals(this.lastFailureMessage())) { return false; } if (other.stopReason() == null ^ this.stopReason() == null) { return false; } if (other.stopReason() != null && !other.stopReason().equals(this.stopReason())) { return false; } if (other.replicationTaskCreationDate() == null ^ this.replicationTaskCreationDate() == null) { return false; } if (other.replicationTaskCreationDate() != null && !other.replicationTaskCreationDate().equals(this.replicationTaskCreationDate())) { return false; } if (other.replicationTaskStartDate() == null ^ this.replicationTaskStartDate() == null) { return false; } if (other.replicationTaskStartDate() != null && !other.replicationTaskStartDate().equals(this.replicationTaskStartDate())) { return false; } if (other.replicationTaskArn() == null ^ this.replicationTaskArn() == null) { return false; } if (other.replicationTaskArn() != null && !other.replicationTaskArn().equals(this.replicationTaskArn())) { return false; } if (other.replicationTaskStats() == null ^ this.replicationTaskStats() == null) { return false; } if (other.replicationTaskStats() != null && !other.replicationTaskStats().equals(this.replicationTaskStats())) { return false; } return true; } @Override public String toString() { StringBuilder sb = new StringBuilder("{"); if (replicationTaskIdentifier() != null) { sb.append("ReplicationTaskIdentifier: ").append(replicationTaskIdentifier()).append(","); } if (sourceEndpointArn() != null) { sb.append("SourceEndpointArn: ").append(sourceEndpointArn()).append(","); } if (targetEndpointArn() != null) { sb.append("TargetEndpointArn: ").append(targetEndpointArn()).append(","); } if (replicationInstanceArn() != null) { sb.append("ReplicationInstanceArn: ").append(replicationInstanceArn()).append(","); } if (migrationTypeString() != null) { sb.append("MigrationType: ").append(migrationTypeString()).append(","); } if (tableMappings() != null) { sb.append("TableMappings: ").append(tableMappings()).append(","); } if (replicationTaskSettings() != null) { sb.append("ReplicationTaskSettings: ").append(replicationTaskSettings()).append(","); } if (status() != null) { sb.append("Status: ").append(status()).append(","); } if (lastFailureMessage() != null) { sb.append("LastFailureMessage: ").append(lastFailureMessage()).append(","); } if (stopReason() != null) { sb.append("StopReason: ").append(stopReason()).append(","); } if (replicationTaskCreationDate() != null) { sb.append("ReplicationTaskCreationDate: ").append(replicationTaskCreationDate()).append(","); } if (replicationTaskStartDate() != null) { sb.append("ReplicationTaskStartDate: ").append(replicationTaskStartDate()).append(","); } if (replicationTaskArn() != null) { sb.append("ReplicationTaskArn: ").append(replicationTaskArn()).append(","); } if (replicationTaskStats() != null) { sb.append("ReplicationTaskStats: ").append(replicationTaskStats()).append(","); } if (sb.length() > 1) { sb.setLength(sb.length() - 1); } sb.append("}"); return sb.toString(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ReplicationTaskIdentifier": return Optional.of(clazz.cast(replicationTaskIdentifier())); case "SourceEndpointArn": return Optional.of(clazz.cast(sourceEndpointArn())); case "TargetEndpointArn": return Optional.of(clazz.cast(targetEndpointArn())); case "ReplicationInstanceArn": return Optional.of(clazz.cast(replicationInstanceArn())); case "MigrationType": return Optional.of(clazz.cast(migrationTypeString())); case "TableMappings": return Optional.of(clazz.cast(tableMappings())); case "ReplicationTaskSettings": return Optional.of(clazz.cast(replicationTaskSettings())); case "Status": return Optional.of(clazz.cast(status())); case "LastFailureMessage": return Optional.of(clazz.cast(lastFailureMessage())); case "StopReason": return Optional.of(clazz.cast(stopReason())); case "ReplicationTaskCreationDate": return Optional.of(clazz.cast(replicationTaskCreationDate())); case "ReplicationTaskStartDate": return Optional.of(clazz.cast(replicationTaskStartDate())); case "ReplicationTaskArn": return Optional.of(clazz.cast(replicationTaskArn())); case "ReplicationTaskStats": return Optional.of(clazz.cast(replicationTaskStats())); default: return Optional.empty(); } } @SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { ReplicationTaskMarshaller.getInstance().marshall(this, protocolMarshaller); } public interface Builder extends CopyableBuilder { /** *

    * The replication task identifier. *

    *

    * Constraints: *

    *
      *
    • *

      * Must contain from 1 to 255 alphanumeric characters or hyphens. *

      *
    • *
    • *

      * First character must be a letter. *

      *
    • *
    • *

      * Cannot end with a hyphen or contain two consecutive hyphens. *

      *
    • *
    * * @param replicationTaskIdentifier * The replication task identifier.

    *

    * Constraints: *

    *
      *
    • *

      * Must contain from 1 to 255 alphanumeric characters or hyphens. *

      *
    • *
    • *

      * First character must be a letter. *

      *
    • *
    • *

      * Cannot end with a hyphen or contain two consecutive hyphens. *

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

      * The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. *

      * * @param sourceEndpointArn * The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceEndpointArn(String sourceEndpointArn); /** *

      * The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. *

      * * @param targetEndpointArn * The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ Builder targetEndpointArn(String targetEndpointArn); /** *

      * The Amazon Resource Name (ARN) of the replication instance. *

      * * @param replicationInstanceArn * The Amazon Resource Name (ARN) of the replication instance. * @return Returns a reference to this object so that method calls can be chained together. */ Builder replicationInstanceArn(String replicationInstanceArn); /** *

      * The type of migration. *

      * * @param migrationType * The type of migration. * @see MigrationTypeValue * @return Returns a reference to this object so that method calls can be chained together. * @see MigrationTypeValue */ Builder migrationType(String migrationType); /** *

      * The type of migration. *

      * * @param migrationType * The type of migration. * @see MigrationTypeValue * @return Returns a reference to this object so that method calls can be chained together. * @see MigrationTypeValue */ Builder migrationType(MigrationTypeValue migrationType); /** *

      * Table mappings specified in the task. *

      * * @param tableMappings * Table mappings specified in the task. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tableMappings(String tableMappings); /** *

      * The settings for the replication task. *

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

      * The status of the replication task. *

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

      * The last error (failure) message generated for the replication instance. *

      * * @param lastFailureMessage * The last error (failure) message generated for the replication instance. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastFailureMessage(String lastFailureMessage); /** *

      * The reason the replication task was stopped. *

      * * @param stopReason * The reason the replication task was stopped. * @return Returns a reference to this object so that method calls can be chained together. */ Builder stopReason(String stopReason); /** *

      * The date the replication task was created. *

      * * @param replicationTaskCreationDate * The date the replication task was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder replicationTaskCreationDate(Instant replicationTaskCreationDate); /** *

      * The date the replication task is scheduled to start. *

      * * @param replicationTaskStartDate * The date the replication task is scheduled to start. * @return Returns a reference to this object so that method calls can be chained together. */ Builder replicationTaskStartDate(Instant replicationTaskStartDate); /** *

      * The Amazon Resource Name (ARN) of the replication task. *

      * * @param replicationTaskArn * The Amazon Resource Name (ARN) of the replication task. * @return Returns a reference to this object so that method calls can be chained together. */ Builder replicationTaskArn(String replicationTaskArn); /** *

      * The statistics for the task, including elapsed time, tables loaded, and table errors. *

      * * @param replicationTaskStats * The statistics for the task, including elapsed time, tables loaded, and table errors. * @return Returns a reference to this object so that method calls can be chained together. */ Builder replicationTaskStats(ReplicationTaskStats replicationTaskStats); } static final class BuilderImpl implements Builder { private String replicationTaskIdentifier; private String sourceEndpointArn; private String targetEndpointArn; private String replicationInstanceArn; private String migrationType; private String tableMappings; private String replicationTaskSettings; private String status; private String lastFailureMessage; private String stopReason; private Instant replicationTaskCreationDate; private Instant replicationTaskStartDate; private String replicationTaskArn; private ReplicationTaskStats replicationTaskStats; private BuilderImpl() { } private BuilderImpl(ReplicationTask model) { replicationTaskIdentifier(model.replicationTaskIdentifier); sourceEndpointArn(model.sourceEndpointArn); targetEndpointArn(model.targetEndpointArn); replicationInstanceArn(model.replicationInstanceArn); migrationType(model.migrationType); tableMappings(model.tableMappings); replicationTaskSettings(model.replicationTaskSettings); status(model.status); lastFailureMessage(model.lastFailureMessage); stopReason(model.stopReason); replicationTaskCreationDate(model.replicationTaskCreationDate); replicationTaskStartDate(model.replicationTaskStartDate); replicationTaskArn(model.replicationTaskArn); replicationTaskStats(model.replicationTaskStats); } public final String getReplicationTaskIdentifier() { return replicationTaskIdentifier; } @Override public final Builder replicationTaskIdentifier(String replicationTaskIdentifier) { this.replicationTaskIdentifier = replicationTaskIdentifier; return this; } public final void setReplicationTaskIdentifier(String replicationTaskIdentifier) { this.replicationTaskIdentifier = replicationTaskIdentifier; } public final String getSourceEndpointArn() { return sourceEndpointArn; } @Override public final Builder sourceEndpointArn(String sourceEndpointArn) { this.sourceEndpointArn = sourceEndpointArn; return this; } public final void setSourceEndpointArn(String sourceEndpointArn) { this.sourceEndpointArn = sourceEndpointArn; } public final String getTargetEndpointArn() { return targetEndpointArn; } @Override public final Builder targetEndpointArn(String targetEndpointArn) { this.targetEndpointArn = targetEndpointArn; return this; } public final void setTargetEndpointArn(String targetEndpointArn) { this.targetEndpointArn = targetEndpointArn; } public final String getReplicationInstanceArn() { return replicationInstanceArn; } @Override public final Builder replicationInstanceArn(String replicationInstanceArn) { this.replicationInstanceArn = replicationInstanceArn; return this; } public final void setReplicationInstanceArn(String replicationInstanceArn) { this.replicationInstanceArn = replicationInstanceArn; } public final String getMigrationType() { return migrationType; } @Override public final Builder migrationType(String migrationType) { this.migrationType = migrationType; return this; } @Override public final Builder migrationType(MigrationTypeValue migrationType) { this.migrationType(migrationType.toString()); return this; } public final void setMigrationType(String migrationType) { this.migrationType = migrationType; } public final String getTableMappings() { return tableMappings; } @Override public final Builder tableMappings(String tableMappings) { this.tableMappings = tableMappings; return this; } public final void setTableMappings(String tableMappings) { this.tableMappings = tableMappings; } public final String getReplicationTaskSettings() { return replicationTaskSettings; } @Override public final Builder replicationTaskSettings(String replicationTaskSettings) { this.replicationTaskSettings = replicationTaskSettings; return this; } public final void setReplicationTaskSettings(String replicationTaskSettings) { this.replicationTaskSettings = replicationTaskSettings; } 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 String getLastFailureMessage() { return lastFailureMessage; } @Override public final Builder lastFailureMessage(String lastFailureMessage) { this.lastFailureMessage = lastFailureMessage; return this; } public final void setLastFailureMessage(String lastFailureMessage) { this.lastFailureMessage = lastFailureMessage; } public final String getStopReason() { return stopReason; } @Override public final Builder stopReason(String stopReason) { this.stopReason = stopReason; return this; } public final void setStopReason(String stopReason) { this.stopReason = stopReason; } public final Instant getReplicationTaskCreationDate() { return replicationTaskCreationDate; } @Override public final Builder replicationTaskCreationDate(Instant replicationTaskCreationDate) { this.replicationTaskCreationDate = replicationTaskCreationDate; return this; } public final void setReplicationTaskCreationDate(Instant replicationTaskCreationDate) { this.replicationTaskCreationDate = replicationTaskCreationDate; } public final Instant getReplicationTaskStartDate() { return replicationTaskStartDate; } @Override public final Builder replicationTaskStartDate(Instant replicationTaskStartDate) { this.replicationTaskStartDate = replicationTaskStartDate; return this; } public final void setReplicationTaskStartDate(Instant replicationTaskStartDate) { this.replicationTaskStartDate = replicationTaskStartDate; } public final String getReplicationTaskArn() { return replicationTaskArn; } @Override public final Builder replicationTaskArn(String replicationTaskArn) { this.replicationTaskArn = replicationTaskArn; return this; } public final void setReplicationTaskArn(String replicationTaskArn) { this.replicationTaskArn = replicationTaskArn; } public final ReplicationTaskStats.Builder getReplicationTaskStats() { return replicationTaskStats != null ? replicationTaskStats.toBuilder() : null; } @Override public final Builder replicationTaskStats(ReplicationTaskStats replicationTaskStats) { this.replicationTaskStats = replicationTaskStats; return this; } public final void setReplicationTaskStats(ReplicationTaskStats.BuilderImpl replicationTaskStats) { this.replicationTaskStats = replicationTaskStats != null ? replicationTaskStats.build() : null; } @Override public ReplicationTask build() { return new ReplicationTask(this); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy