/* * 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 com.amazonaws.services.databasemigrationservice.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * <p/> * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateReplicationTask" target="_top">AWS API * Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CreateReplicationTaskRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** * <p> * The replication task identifier. * </p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must contain from 1 to 63 alphanumeric characters or hyphens. * </p> * </li> * <li> * <p> * First character must be a letter. * </p> * </li> * <li> * <p> * Cannot end with a hyphen or contain two consecutive hyphens. * </p> * </li> * </ul> */ private String replicationTaskIdentifier; /** * <p> * The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. * </p> */ private String sourceEndpointArn; /** * <p> * The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. * </p> */ private String targetEndpointArn; /** * <p> * The Amazon Resource Name (ARN) of the replication instance. * </p> */ private String replicationInstanceArn; /** * <p> * The migration type. * </p> */ private String migrationType; /** * <p> * The path of the JSON file that contains the table mappings. Preceed the path with "file://". * </p> * <p> * For example, --table-mappings file://mappingfile.json * </p> */ private String tableMappings; /** * <p> * Settings for the task, such as target metadata settings. For a complete list of task settings, see <a * href="http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.html">Task * Settings for AWS Database Migration Service Tasks</a>. * </p> */ private String replicationTaskSettings; /** * <p> * The start time for the Change Data Capture (CDC) operation. * </p> */ private java.util.Date cdcStartTime; /** * <p> * Tags to be added to the replication instance. * </p> */ private java.util.List<Tag> tags; /** * <p> * The replication task identifier. * </p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must contain from 1 to 63 alphanumeric characters or hyphens. * </p> * </li> * <li> * <p> * First character must be a letter. * </p> * </li> * <li> * <p> * Cannot end with a hyphen or contain two consecutive hyphens. * </p> * </li> * </ul> * * @param replicationTaskIdentifier * The replication task identifier.</p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must contain from 1 to 63 alphanumeric characters or hyphens. * </p> * </li> * <li> * <p> * First character must be a letter. * </p> * </li> * <li> * <p> * Cannot end with a hyphen or contain two consecutive hyphens. * </p> * </li> */ public void setReplicationTaskIdentifier(String replicationTaskIdentifier) { this.replicationTaskIdentifier = replicationTaskIdentifier; } /** * <p> * The replication task identifier. * </p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must contain from 1 to 63 alphanumeric characters or hyphens. * </p> * </li> * <li> * <p> * First character must be a letter. * </p> * </li> * <li> * <p> * Cannot end with a hyphen or contain two consecutive hyphens. * </p> * </li> * </ul> * * @return The replication task identifier.</p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must contain from 1 to 63 alphanumeric characters or hyphens. * </p> * </li> * <li> * <p> * First character must be a letter. * </p> * </li> * <li> * <p> * Cannot end with a hyphen or contain two consecutive hyphens. * </p> * </li> */ public String getReplicationTaskIdentifier() { return this.replicationTaskIdentifier; } /** * <p> * The replication task identifier. * </p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must contain from 1 to 63 alphanumeric characters or hyphens. * </p> * </li> * <li> * <p> * First character must be a letter. * </p> * </li> * <li> * <p> * Cannot end with a hyphen or contain two consecutive hyphens. * </p> * </li> * </ul> * * @param replicationTaskIdentifier * The replication task identifier.</p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must contain from 1 to 63 alphanumeric characters or hyphens. * </p> * </li> * <li> * <p> * First character must be a letter. * </p> * </li> * <li> * <p> * Cannot end with a hyphen or contain two consecutive hyphens. * </p> * </li> * @return Returns a reference to this object so that method calls can be chained together. */ public CreateReplicationTaskRequest withReplicationTaskIdentifier(String replicationTaskIdentifier) { setReplicationTaskIdentifier(replicationTaskIdentifier); return this; } /** * <p> * The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. * </p> * * @param sourceEndpointArn * The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. */ public void setSourceEndpointArn(String sourceEndpointArn) { this.sourceEndpointArn = sourceEndpointArn; } /** * <p> * The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. * </p> * * @return The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. */ public String getSourceEndpointArn() { return this.sourceEndpointArn; } /** * <p> * The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. * </p> * * @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. */ public CreateReplicationTaskRequest withSourceEndpointArn(String sourceEndpointArn) { setSourceEndpointArn(sourceEndpointArn); return this; } /** * <p> * The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. * </p> * * @param targetEndpointArn * The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. */ public void setTargetEndpointArn(String targetEndpointArn) { this.targetEndpointArn = targetEndpointArn; } /** * <p> * The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. * </p> * * @return The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. */ public String getTargetEndpointArn() { return this.targetEndpointArn; } /** * <p> * The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. * </p> * * @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. */ public CreateReplicationTaskRequest withTargetEndpointArn(String targetEndpointArn) { setTargetEndpointArn(targetEndpointArn); return this; } /** * <p> * The Amazon Resource Name (ARN) of the replication instance. * </p> * * @param replicationInstanceArn * The Amazon Resource Name (ARN) of the replication instance. */ public void setReplicationInstanceArn(String replicationInstanceArn) { this.replicationInstanceArn = replicationInstanceArn; } /** * <p> * The Amazon Resource Name (ARN) of the replication instance. * </p> * * @return The Amazon Resource Name (ARN) of the replication instance. */ public String getReplicationInstanceArn() { return this.replicationInstanceArn; } /** * <p> * The Amazon Resource Name (ARN) of the replication instance. * </p> * * @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. */ public CreateReplicationTaskRequest withReplicationInstanceArn(String replicationInstanceArn) { setReplicationInstanceArn(replicationInstanceArn); return this; } /** * <p> * The migration type. * </p> * * @param migrationType * The migration type. * @see MigrationTypeValue */ public void setMigrationType(String migrationType) { this.migrationType = migrationType; } /** * <p> * The migration type. * </p> * * @return The migration type. * @see MigrationTypeValue */ public String getMigrationType() { return this.migrationType; } /** * <p> * The migration type. * </p> * * @param migrationType * The migration type. * @return Returns a reference to this object so that method calls can be chained together. * @see MigrationTypeValue */ public CreateReplicationTaskRequest withMigrationType(String migrationType) { setMigrationType(migrationType); return this; } /** * <p> * The migration type. * </p> * * @param migrationType * The migration type. * @see MigrationTypeValue */ public void setMigrationType(MigrationTypeValue migrationType) { this.migrationType = migrationType.toString(); } /** * <p> * The migration type. * </p> * * @param migrationType * The migration type. * @return Returns a reference to this object so that method calls can be chained together. * @see MigrationTypeValue */ public CreateReplicationTaskRequest withMigrationType(MigrationTypeValue migrationType) { setMigrationType(migrationType); return this; } /** * <p> * The path of the JSON file that contains the table mappings. Preceed the path with "file://". * </p> * <p> * For example, --table-mappings file://mappingfile.json * </p> * * @param tableMappings * The path of the JSON file that contains the table mappings. Preceed the path with "file://".</p> * <p> * For example, --table-mappings file://mappingfile.json */ public void setTableMappings(String tableMappings) { this.tableMappings = tableMappings; } /** * <p> * The path of the JSON file that contains the table mappings. Preceed the path with "file://". * </p> * <p> * For example, --table-mappings file://mappingfile.json * </p> * * @return The path of the JSON file that contains the table mappings. Preceed the path with "file://".</p> * <p> * For example, --table-mappings file://mappingfile.json */ public String getTableMappings() { return this.tableMappings; } /** * <p> * The path of the JSON file that contains the table mappings. Preceed the path with "file://". * </p> * <p> * For example, --table-mappings file://mappingfile.json * </p> * * @param tableMappings * The path of the JSON file that contains the table mappings. Preceed the path with "file://".</p> * <p> * For example, --table-mappings file://mappingfile.json * @return Returns a reference to this object so that method calls can be chained together. */ public CreateReplicationTaskRequest withTableMappings(String tableMappings) { setTableMappings(tableMappings); return this; } /** * <p> * Settings for the task, such as target metadata settings. For a complete list of task settings, see <a * href="http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.html">Task * Settings for AWS Database Migration Service Tasks</a>. * </p> * * @param replicationTaskSettings * Settings for the task, such as target metadata settings. For a complete list of task settings, see <a * href="http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.html">Task * Settings for AWS Database Migration Service Tasks</a>. */ public void setReplicationTaskSettings(String replicationTaskSettings) { this.replicationTaskSettings = replicationTaskSettings; } /** * <p> * Settings for the task, such as target metadata settings. For a complete list of task settings, see <a * href="http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.html">Task * Settings for AWS Database Migration Service Tasks</a>. * </p> * * @return Settings for the task, such as target metadata settings. For a complete list of task settings, see <a * href="http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.html">Task * Settings for AWS Database Migration Service Tasks</a>. */ public String getReplicationTaskSettings() { return this.replicationTaskSettings; } /** * <p> * Settings for the task, such as target metadata settings. For a complete list of task settings, see <a * href="http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.html">Task * Settings for AWS Database Migration Service Tasks</a>. * </p> * * @param replicationTaskSettings * Settings for the task, such as target metadata settings. For a complete list of task settings, see <a * href="http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.html">Task * Settings for AWS Database Migration Service Tasks</a>. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateReplicationTaskRequest withReplicationTaskSettings(String replicationTaskSettings) { setReplicationTaskSettings(replicationTaskSettings); return this; } /** * <p> * The start time for the Change Data Capture (CDC) operation. * </p> * * @param cdcStartTime * The start time for the Change Data Capture (CDC) operation. */ public void setCdcStartTime(java.util.Date cdcStartTime) { this.cdcStartTime = cdcStartTime; } /** * <p> * The start time for the Change Data Capture (CDC) operation. * </p> * * @return The start time for the Change Data Capture (CDC) operation. */ public java.util.Date getCdcStartTime() { return this.cdcStartTime; } /** * <p> * The start time for the Change Data Capture (CDC) operation. * </p> * * @param cdcStartTime * The start time for the Change Data Capture (CDC) operation. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateReplicationTaskRequest withCdcStartTime(java.util.Date cdcStartTime) { setCdcStartTime(cdcStartTime); return this; } /** * <p> * Tags to be added to the replication instance. * </p> * * @return Tags to be added to the replication instance. */ public java.util.List<Tag> getTags() { return tags; } /** * <p> * Tags to be added to the replication instance. * </p> * * @param tags * Tags to be added to the replication instance. */ public void setTags(java.util.Collection<Tag> tags) { if (tags == null) { this.tags = null; return; } this.tags = new java.util.ArrayList<Tag>(tags); } /** * <p> * Tags to be added to the replication instance. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. * </p> * * @param tags * Tags to be added to the replication instance. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateReplicationTaskRequest withTags(Tag... tags) { if (this.tags == null) { setTags(new java.util.ArrayList<Tag>(tags.length)); } for (Tag ele : tags) { this.tags.add(ele); } return this; } /** * <p> * Tags to be added to the replication instance. * </p> * * @param tags * Tags to be added to the replication instance. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateReplicationTaskRequest withTags(java.util.Collection<Tag> tags) { setTags(tags); return this; } /** * Returns a string representation of this object; useful for testing and debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getReplicationTaskIdentifier() != null) sb.append("ReplicationTaskIdentifier: ").append(getReplicationTaskIdentifier()).append(","); if (getSourceEndpointArn() != null) sb.append("SourceEndpointArn: ").append(getSourceEndpointArn()).append(","); if (getTargetEndpointArn() != null) sb.append("TargetEndpointArn: ").append(getTargetEndpointArn()).append(","); if (getReplicationInstanceArn() != null) sb.append("ReplicationInstanceArn: ").append(getReplicationInstanceArn()).append(","); if (getMigrationType() != null) sb.append("MigrationType: ").append(getMigrationType()).append(","); if (getTableMappings() != null) sb.append("TableMappings: ").append(getTableMappings()).append(","); if (getReplicationTaskSettings() != null) sb.append("ReplicationTaskSettings: ").append(getReplicationTaskSettings()).append(","); if (getCdcStartTime() != null) sb.append("CdcStartTime: ").append(getCdcStartTime()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateReplicationTaskRequest == false) return false; CreateReplicationTaskRequest other = (CreateReplicationTaskRequest) obj; if (other.getReplicationTaskIdentifier() == null ^ this.getReplicationTaskIdentifier() == null) return false; if (other.getReplicationTaskIdentifier() != null && other.getReplicationTaskIdentifier().equals(this.getReplicationTaskIdentifier()) == false) return false; if (other.getSourceEndpointArn() == null ^ this.getSourceEndpointArn() == null) return false; if (other.getSourceEndpointArn() != null && other.getSourceEndpointArn().equals(this.getSourceEndpointArn()) == false) return false; if (other.getTargetEndpointArn() == null ^ this.getTargetEndpointArn() == null) return false; if (other.getTargetEndpointArn() != null && other.getTargetEndpointArn().equals(this.getTargetEndpointArn()) == false) return false; if (other.getReplicationInstanceArn() == null ^ this.getReplicationInstanceArn() == null) return false; if (other.getReplicationInstanceArn() != null && other.getReplicationInstanceArn().equals(this.getReplicationInstanceArn()) == false) return false; if (other.getMigrationType() == null ^ this.getMigrationType() == null) return false; if (other.getMigrationType() != null && other.getMigrationType().equals(this.getMigrationType()) == false) return false; if (other.getTableMappings() == null ^ this.getTableMappings() == null) return false; if (other.getTableMappings() != null && other.getTableMappings().equals(this.getTableMappings()) == false) return false; if (other.getReplicationTaskSettings() == null ^ this.getReplicationTaskSettings() == null) return false; if (other.getReplicationTaskSettings() != null && other.getReplicationTaskSettings().equals(this.getReplicationTaskSettings()) == false) return false; if (other.getCdcStartTime() == null ^ this.getCdcStartTime() == null) return false; if (other.getCdcStartTime() != null && other.getCdcStartTime().equals(this.getCdcStartTime()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getReplicationTaskIdentifier() == null) ? 0 : getReplicationTaskIdentifier().hashCode()); hashCode = prime * hashCode + ((getSourceEndpointArn() == null) ? 0 : getSourceEndpointArn().hashCode()); hashCode = prime * hashCode + ((getTargetEndpointArn() == null) ? 0 : getTargetEndpointArn().hashCode()); hashCode = prime * hashCode + ((getReplicationInstanceArn() == null) ? 0 : getReplicationInstanceArn().hashCode()); hashCode = prime * hashCode + ((getMigrationType() == null) ? 0 : getMigrationType().hashCode()); hashCode = prime * hashCode + ((getTableMappings() == null) ? 0 : getTableMappings().hashCode()); hashCode = prime * hashCode + ((getReplicationTaskSettings() == null) ? 0 : getReplicationTaskSettings().hashCode()); hashCode = prime * hashCode + ((getCdcStartTime() == null) ? 0 : getCdcStartTime().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; } @Override public CreateReplicationTaskRequest clone() { return (CreateReplicationTaskRequest) super.clone(); } }