com.amazonaws.services.redshift.model.RestoreStatus Maven / Gradle / Ivy
Show all versions of aws-java-sdk-redshift Show documentation
/*
* Copyright 2010-2016 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.redshift.model;
import java.io.Serializable;
/**
*
* Describes the status of a cluster restore action. Returns null if the cluster
* was not created by restoring a snapshot.
*
*/
public class RestoreStatus implements Serializable, Cloneable {
/**
*
* The status of the restore action. Returns starting, restoring, completed,
* or failed.
*
*/
private String status;
/**
*
* The number of megabytes per second being transferred from the backup
* storage. Returns the average rate for a completed backup.
*
*/
private Double currentRestoreRateInMegaBytesPerSecond;
/**
*
* The size of the set of snapshot data used to restore the cluster.
*
*/
private Long snapshotSizeInMegaBytes;
/**
*
* The number of megabytes that have been transferred from snapshot storage.
*
*/
private Long progressInMegaBytes;
/**
*
* The amount of time an in-progress restore has been running, or the amount
* of time it took a completed restore to finish.
*
*/
private Long elapsedTimeInSeconds;
/**
*
* The estimate of the time remaining before the restore will complete.
* Returns 0 for a completed restore.
*
*/
private Long estimatedTimeToCompletionInSeconds;
/**
*
* The status of the restore action. Returns starting, restoring, completed,
* or failed.
*
*
* @param status
* The status of the restore action. Returns starting, restoring,
* completed, or failed.
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The status of the restore action. Returns starting, restoring, completed,
* or failed.
*
*
* @return The status of the restore action. Returns starting, restoring,
* completed, or failed.
*/
public String getStatus() {
return this.status;
}
/**
*
* The status of the restore action. Returns starting, restoring, completed,
* or failed.
*
*
* @param status
* The status of the restore action. Returns starting, restoring,
* completed, or failed.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public RestoreStatus withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The number of megabytes per second being transferred from the backup
* storage. Returns the average rate for a completed backup.
*
*
* @param currentRestoreRateInMegaBytesPerSecond
* The number of megabytes per second being transferred from the
* backup storage. Returns the average rate for a completed backup.
*/
public void setCurrentRestoreRateInMegaBytesPerSecond(
Double currentRestoreRateInMegaBytesPerSecond) {
this.currentRestoreRateInMegaBytesPerSecond = currentRestoreRateInMegaBytesPerSecond;
}
/**
*
* The number of megabytes per second being transferred from the backup
* storage. Returns the average rate for a completed backup.
*
*
* @return The number of megabytes per second being transferred from the
* backup storage. Returns the average rate for a completed backup.
*/
public Double getCurrentRestoreRateInMegaBytesPerSecond() {
return this.currentRestoreRateInMegaBytesPerSecond;
}
/**
*
* The number of megabytes per second being transferred from the backup
* storage. Returns the average rate for a completed backup.
*
*
* @param currentRestoreRateInMegaBytesPerSecond
* The number of megabytes per second being transferred from the
* backup storage. Returns the average rate for a completed backup.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public RestoreStatus withCurrentRestoreRateInMegaBytesPerSecond(
Double currentRestoreRateInMegaBytesPerSecond) {
setCurrentRestoreRateInMegaBytesPerSecond(currentRestoreRateInMegaBytesPerSecond);
return this;
}
/**
*
* The size of the set of snapshot data used to restore the cluster.
*
*
* @param snapshotSizeInMegaBytes
* The size of the set of snapshot data used to restore the cluster.
*/
public void setSnapshotSizeInMegaBytes(Long snapshotSizeInMegaBytes) {
this.snapshotSizeInMegaBytes = snapshotSizeInMegaBytes;
}
/**
*
* The size of the set of snapshot data used to restore the cluster.
*
*
* @return The size of the set of snapshot data used to restore the cluster.
*/
public Long getSnapshotSizeInMegaBytes() {
return this.snapshotSizeInMegaBytes;
}
/**
*
* The size of the set of snapshot data used to restore the cluster.
*
*
* @param snapshotSizeInMegaBytes
* The size of the set of snapshot data used to restore the cluster.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public RestoreStatus withSnapshotSizeInMegaBytes(
Long snapshotSizeInMegaBytes) {
setSnapshotSizeInMegaBytes(snapshotSizeInMegaBytes);
return this;
}
/**
*
* The number of megabytes that have been transferred from snapshot storage.
*
*
* @param progressInMegaBytes
* The number of megabytes that have been transferred from snapshot
* storage.
*/
public void setProgressInMegaBytes(Long progressInMegaBytes) {
this.progressInMegaBytes = progressInMegaBytes;
}
/**
*
* The number of megabytes that have been transferred from snapshot storage.
*
*
* @return The number of megabytes that have been transferred from snapshot
* storage.
*/
public Long getProgressInMegaBytes() {
return this.progressInMegaBytes;
}
/**
*
* The number of megabytes that have been transferred from snapshot storage.
*
*
* @param progressInMegaBytes
* The number of megabytes that have been transferred from snapshot
* storage.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public RestoreStatus withProgressInMegaBytes(Long progressInMegaBytes) {
setProgressInMegaBytes(progressInMegaBytes);
return this;
}
/**
*
* The amount of time an in-progress restore has been running, or the amount
* of time it took a completed restore to finish.
*
*
* @param elapsedTimeInSeconds
* The amount of time an in-progress restore has been running, or the
* amount of time it took a completed restore to finish.
*/
public void setElapsedTimeInSeconds(Long elapsedTimeInSeconds) {
this.elapsedTimeInSeconds = elapsedTimeInSeconds;
}
/**
*
* The amount of time an in-progress restore has been running, or the amount
* of time it took a completed restore to finish.
*
*
* @return The amount of time an in-progress restore has been running, or
* the amount of time it took a completed restore to finish.
*/
public Long getElapsedTimeInSeconds() {
return this.elapsedTimeInSeconds;
}
/**
*
* The amount of time an in-progress restore has been running, or the amount
* of time it took a completed restore to finish.
*
*
* @param elapsedTimeInSeconds
* The amount of time an in-progress restore has been running, or the
* amount of time it took a completed restore to finish.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public RestoreStatus withElapsedTimeInSeconds(Long elapsedTimeInSeconds) {
setElapsedTimeInSeconds(elapsedTimeInSeconds);
return this;
}
/**
*
* The estimate of the time remaining before the restore will complete.
* Returns 0 for a completed restore.
*
*
* @param estimatedTimeToCompletionInSeconds
* The estimate of the time remaining before the restore will
* complete. Returns 0 for a completed restore.
*/
public void setEstimatedTimeToCompletionInSeconds(
Long estimatedTimeToCompletionInSeconds) {
this.estimatedTimeToCompletionInSeconds = estimatedTimeToCompletionInSeconds;
}
/**
*
* The estimate of the time remaining before the restore will complete.
* Returns 0 for a completed restore.
*
*
* @return The estimate of the time remaining before the restore will
* complete. Returns 0 for a completed restore.
*/
public Long getEstimatedTimeToCompletionInSeconds() {
return this.estimatedTimeToCompletionInSeconds;
}
/**
*
* The estimate of the time remaining before the restore will complete.
* Returns 0 for a completed restore.
*
*
* @param estimatedTimeToCompletionInSeconds
* The estimate of the time remaining before the restore will
* complete. Returns 0 for a completed restore.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public RestoreStatus withEstimatedTimeToCompletionInSeconds(
Long estimatedTimeToCompletionInSeconds) {
setEstimatedTimeToCompletionInSeconds(estimatedTimeToCompletionInSeconds);
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 (getStatus() != null)
sb.append("Status: " + getStatus() + ",");
if (getCurrentRestoreRateInMegaBytesPerSecond() != null)
sb.append("CurrentRestoreRateInMegaBytesPerSecond: "
+ getCurrentRestoreRateInMegaBytesPerSecond() + ",");
if (getSnapshotSizeInMegaBytes() != null)
sb.append("SnapshotSizeInMegaBytes: "
+ getSnapshotSizeInMegaBytes() + ",");
if (getProgressInMegaBytes() != null)
sb.append("ProgressInMegaBytes: " + getProgressInMegaBytes() + ",");
if (getElapsedTimeInSeconds() != null)
sb.append("ElapsedTimeInSeconds: " + getElapsedTimeInSeconds()
+ ",");
if (getEstimatedTimeToCompletionInSeconds() != null)
sb.append("EstimatedTimeToCompletionInSeconds: "
+ getEstimatedTimeToCompletionInSeconds());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof RestoreStatus == false)
return false;
RestoreStatus other = (RestoreStatus) obj;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null
&& other.getStatus().equals(this.getStatus()) == false)
return false;
if (other.getCurrentRestoreRateInMegaBytesPerSecond() == null
^ this.getCurrentRestoreRateInMegaBytesPerSecond() == null)
return false;
if (other.getCurrentRestoreRateInMegaBytesPerSecond() != null
&& other.getCurrentRestoreRateInMegaBytesPerSecond().equals(
this.getCurrentRestoreRateInMegaBytesPerSecond()) == false)
return false;
if (other.getSnapshotSizeInMegaBytes() == null
^ this.getSnapshotSizeInMegaBytes() == null)
return false;
if (other.getSnapshotSizeInMegaBytes() != null
&& other.getSnapshotSizeInMegaBytes().equals(
this.getSnapshotSizeInMegaBytes()) == false)
return false;
if (other.getProgressInMegaBytes() == null
^ this.getProgressInMegaBytes() == null)
return false;
if (other.getProgressInMegaBytes() != null
&& other.getProgressInMegaBytes().equals(
this.getProgressInMegaBytes()) == false)
return false;
if (other.getElapsedTimeInSeconds() == null
^ this.getElapsedTimeInSeconds() == null)
return false;
if (other.getElapsedTimeInSeconds() != null
&& other.getElapsedTimeInSeconds().equals(
this.getElapsedTimeInSeconds()) == false)
return false;
if (other.getEstimatedTimeToCompletionInSeconds() == null
^ this.getEstimatedTimeToCompletionInSeconds() == null)
return false;
if (other.getEstimatedTimeToCompletionInSeconds() != null
&& other.getEstimatedTimeToCompletionInSeconds().equals(
this.getEstimatedTimeToCompletionInSeconds()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode
+ ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime
* hashCode
+ ((getCurrentRestoreRateInMegaBytesPerSecond() == null) ? 0
: getCurrentRestoreRateInMegaBytesPerSecond()
.hashCode());
hashCode = prime
* hashCode
+ ((getSnapshotSizeInMegaBytes() == null) ? 0
: getSnapshotSizeInMegaBytes().hashCode());
hashCode = prime
* hashCode
+ ((getProgressInMegaBytes() == null) ? 0
: getProgressInMegaBytes().hashCode());
hashCode = prime
* hashCode
+ ((getElapsedTimeInSeconds() == null) ? 0
: getElapsedTimeInSeconds().hashCode());
hashCode = prime
* hashCode
+ ((getEstimatedTimeToCompletionInSeconds() == null) ? 0
: getEstimatedTimeToCompletionInSeconds().hashCode());
return hashCode;
}
@Override
public RestoreStatus clone() {
try {
return (RestoreStatus) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException(
"Got a CloneNotSupportedException from Object.clone() "
+ "even though we're Cloneable!", e);
}
}
}