/* * Copyright 2010-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 com.amazonaws.services.dynamodbv2.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; /** *
* Restores the specified table to the specified point in time within
* EarliestRestorableDateTime
and
* LatestRestorableDateTime
. You can restore your table to any
* point in time during the last 35 days. Any number of users can execute up to
* 4 concurrent restores (any type of restore) in a given account.
*
* When you restore using point in time recovery, DynamoDB restores your table * data to the state based on the selected date and time * (day:hour:minute:second) to a new table. *
** Along with data, the following are also included on the new restored table * using point in time recovery: *
** Global secondary indexes (GSIs) *
** Local secondary indexes (LSIs) *
** Provisioned read and write capacity *
** Encryption settings *
** All these settings come from the current settings of the source table at the * time of restore. *
** You must manually set up the following on the restored table: *
** Auto scaling policies *
** IAM policies *
** Cloudwatch metrics and alarms *
** Tags *
** Stream settings *
** Time to Live (TTL) settings *
** Point in time recovery settings *
** Name of the source table that is being restored. *
*
* Constraints:
* Length: 3 - 255
* Pattern: [a-zA-Z0-9_.-]+
*/
private String sourceTableName;
/**
*
* The name of the new table to which it must be restored to. *
*
* Constraints:
* Length: 3 - 255
* Pattern: [a-zA-Z0-9_.-]+
*/
private String targetTableName;
/**
*
* Restore the table to the latest possible time.
* LatestRestorableDateTime
is typically 5 minutes before the
* current time.
*
* Time in the past to restore the table to. *
*/ private java.util.Date restoreDateTime; /** ** Name of the source table that is being restored. *
*
* Constraints:
* Length: 3 - 255
* Pattern: [a-zA-Z0-9_.-]+
*
* @return
* Name of the source table that is being restored. *
*/ public String getSourceTableName() { return sourceTableName; } /** ** Name of the source table that is being restored. *
*
* Constraints:
* Length: 3 - 255
* Pattern: [a-zA-Z0-9_.-]+
*
* @param sourceTableName
* Name of the source table that is being restored. *
*/ public void setSourceTableName(String sourceTableName) { this.sourceTableName = sourceTableName; } /** ** Name of the source table that is being restored. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 3 - 255
* Pattern: [a-zA-Z0-9_.-]+
*
* @param sourceTableName
* Name of the source table that is being restored. *
* @return A reference to this updated object so that method calls can be * chained together. */ public RestoreTableToPointInTimeRequest withSourceTableName(String sourceTableName) { this.sourceTableName = sourceTableName; return this; } /** ** The name of the new table to which it must be restored to. *
*
* Constraints:
* Length: 3 - 255
* Pattern: [a-zA-Z0-9_.-]+
*
* @return
* The name of the new table to which it must be restored to. *
*/ public String getTargetTableName() { return targetTableName; } /** ** The name of the new table to which it must be restored to. *
*
* Constraints:
* Length: 3 - 255
* Pattern: [a-zA-Z0-9_.-]+
*
* @param targetTableName
* The name of the new table to which it must be restored to. *
*/ public void setTargetTableName(String targetTableName) { this.targetTableName = targetTableName; } /** ** The name of the new table to which it must be restored to. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 3 - 255
* Pattern: [a-zA-Z0-9_.-]+
*
* @param targetTableName
* The name of the new table to which it must be restored to. *
* @return A reference to this updated object so that method calls can be * chained together. */ public RestoreTableToPointInTimeRequest withTargetTableName(String targetTableName) { this.targetTableName = targetTableName; return this; } /** *
* Restore the table to the latest possible time.
* LatestRestorableDateTime
is typically 5 minutes before the
* current time.
*
* Restore the table to the latest possible time.
* LatestRestorableDateTime
is typically 5 minutes
* before the current time.
*
* Restore the table to the latest possible time.
* LatestRestorableDateTime
is typically 5 minutes before the
* current time.
*
* Restore the table to the latest possible time.
* LatestRestorableDateTime
is typically 5 minutes
* before the current time.
*
* Restore the table to the latest possible time.
* LatestRestorableDateTime
is typically 5 minutes before the
* current time.
*
* Restore the table to the latest possible time.
* LatestRestorableDateTime
is typically 5 minutes
* before the current time.
*
* Restore the table to the latest possible time.
* LatestRestorableDateTime
is typically 5 minutes before the
* current time.
*
* Returns a reference to this object so that method calls can be chained * together. * * @param useLatestRestorableTime
* Restore the table to the latest possible time.
* LatestRestorableDateTime
is typically 5 minutes
* before the current time.
*
* Time in the past to restore the table to. *
* * @return* Time in the past to restore the table to. *
*/ public java.util.Date getRestoreDateTime() { return restoreDateTime; } /** ** Time in the past to restore the table to. *
* * @param restoreDateTime* Time in the past to restore the table to. *
*/ public void setRestoreDateTime(java.util.Date restoreDateTime) { this.restoreDateTime = restoreDateTime; } /** ** Time in the past to restore the table to. *
** Returns a reference to this object so that method calls can be chained * together. * * @param restoreDateTime
* Time in the past to restore the table to. *
* @return A reference to this updated object so that method calls can be * chained together. */ public RestoreTableToPointInTimeRequest withRestoreDateTime(java.util.Date restoreDateTime) { this.restoreDateTime = restoreDateTime; 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 (getSourceTableName() != null) sb.append("SourceTableName: " + getSourceTableName() + ","); if (getTargetTableName() != null) sb.append("TargetTableName: " + getTargetTableName() + ","); if (getUseLatestRestorableTime() != null) sb.append("UseLatestRestorableTime: " + getUseLatestRestorableTime() + ","); if (getRestoreDateTime() != null) sb.append("RestoreDateTime: " + getRestoreDateTime()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getSourceTableName() == null) ? 0 : getSourceTableName().hashCode()); hashCode = prime * hashCode + ((getTargetTableName() == null) ? 0 : getTargetTableName().hashCode()); hashCode = prime * hashCode + ((getUseLatestRestorableTime() == null) ? 0 : getUseLatestRestorableTime() .hashCode()); hashCode = prime * hashCode + ((getRestoreDateTime() == null) ? 0 : getRestoreDateTime().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof RestoreTableToPointInTimeRequest == false) return false; RestoreTableToPointInTimeRequest other = (RestoreTableToPointInTimeRequest) obj; if (other.getSourceTableName() == null ^ this.getSourceTableName() == null) return false; if (other.getSourceTableName() != null && other.getSourceTableName().equals(this.getSourceTableName()) == false) return false; if (other.getTargetTableName() == null ^ this.getTargetTableName() == null) return false; if (other.getTargetTableName() != null && other.getTargetTableName().equals(this.getTargetTableName()) == false) return false; if (other.getUseLatestRestorableTime() == null ^ this.getUseLatestRestorableTime() == null) return false; if (other.getUseLatestRestorableTime() != null && other.getUseLatestRestorableTime().equals(this.getUseLatestRestorableTime()) == false) return false; if (other.getRestoreDateTime() == null ^ this.getRestoreDateTime() == null) return false; if (other.getRestoreDateTime() != null && other.getRestoreDateTime().equals(this.getRestoreDateTime()) == false) return false; return true; } }