Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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.rds.model;
 
 
Container for the parameters to the PromoteReadReplica operation.

Promotes a Read Replica DB instance to a standalone DB instance.

NOTE: We recommend that you enable automated backups on your Read Replica before promoting the Read Replica. This ensures that no backup is taken during the promotion process. Once the instance is promoted to a primary instance, backups are taken based on your backup settings.

 
 public class PromoteReadReplicaRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The DB instance identifier. This value is stored as a lowercase string.

Constraints:

  • Must be the identifier for an existing Read Replica DB instance
  • Must contain from 1 to 63 alphanumeric characters or hyphens
  • First character must be a letter
  • Cannot end with a hyphen or contain two consecutive hyphens

Example: <copy>mydbinstance</copy>

 
     private String dBInstanceIdentifier;

    
The number of days to retain automated backups. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.

Default: 1

Constraints:

  • Must be a value from 0 to 8
 
     private Integer backupRetentionPeriod;

    
The daily time range during which automated backups are created if automated backups are enabled, using the BackupRetentionPeriod parameter.

Default: A 30-minute window selected at random from an 8-hour block of time per region. See the Amazon RDS User Guide for the time blocks for each region from which the default backup windows are assigned.

Constraints: Must be in the format hh24:mi-hh24:mi. Times should be Universal Time Coordinated (UTC). Must not conflict with the preferred maintenance window. Must be at least 30 minutes.

 
     private String preferredBackupWindow;

    
The DB instance identifier. This value is stored as a lowercase string.

Constraints:

  • Must be the identifier for an existing Read Replica DB instance
  • Must contain from 1 to 63 alphanumeric characters or hyphens
  • First character must be a letter
  • Cannot end with a hyphen or contain two consecutive hyphens

Example: <copy>mydbinstance</copy>

Returns:
The DB instance identifier. This value is stored as a lowercase string.

Constraints:

  • Must be the identifier for an existing Read Replica DB instance
  • Must contain from 1 to 63 alphanumeric characters or hyphens
  • First character must be a letter
  • Cannot end with a hyphen or contain two consecutive hyphens

Example: <copy>mydbinstance</copy>

 
     public String getDBInstanceIdentifier() {
         return ;
     }
    
    
The DB instance identifier. This value is stored as a lowercase string.

Constraints:

  • Must be the identifier for an existing Read Replica DB instance
  • Must contain from 1 to 63 alphanumeric characters or hyphens
  • First character must be a letter
  • Cannot end with a hyphen or contain two consecutive hyphens

Example: <copy>mydbinstance</copy>

Parameters:
dBInstanceIdentifier The DB instance identifier. This value is stored as a lowercase string.

Constraints:

  • Must be the identifier for an existing Read Replica DB instance
  • Must contain from 1 to 63 alphanumeric characters or hyphens
  • First character must be a letter
  • Cannot end with a hyphen or contain two consecutive hyphens

Example: <copy>mydbinstance</copy>

    public void setDBInstanceIdentifier(String dBInstanceIdentifier) {
        this. = dBInstanceIdentifier;
    }
    
    
The DB instance identifier. This value is stored as a lowercase string.

Constraints:

  • Must be the identifier for an existing Read Replica DB instance
  • Must contain from 1 to 63 alphanumeric characters or hyphens
  • First character must be a letter
  • Cannot end with a hyphen or contain two consecutive hyphens

Example: <copy>mydbinstance</copy>

Returns a reference to this object so that method calls can be chained together.

Parameters:
dBInstanceIdentifier The DB instance identifier. This value is stored as a lowercase string.

Constraints:

  • Must be the identifier for an existing Read Replica DB instance
  • Must contain from 1 to 63 alphanumeric characters or hyphens
  • First character must be a letter
  • Cannot end with a hyphen or contain two consecutive hyphens

Example: <copy>mydbinstance</copy>

Returns:
A reference to this updated object so that method calls can be chained together.
    public PromoteReadReplicaRequest withDBInstanceIdentifier(String dBInstanceIdentifier) {
        this. = dBInstanceIdentifier;
        return this;
    }

    
The number of days to retain automated backups. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.

Default: 1

Constraints:

  • Must be a value from 0 to 8

Returns:
The number of days to retain automated backups. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.

Default: 1

Constraints:

  • Must be a value from 0 to 8
    public Integer getBackupRetentionPeriod() {
        return ;
    }
    
    
The number of days to retain automated backups. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.

Default: 1

Constraints:

  • Must be a value from 0 to 8

Parameters:
backupRetentionPeriod The number of days to retain automated backups. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.

Default: 1

Constraints:

  • Must be a value from 0 to 8
    public void setBackupRetentionPeriod(Integer backupRetentionPeriod) {
        this. = backupRetentionPeriod;
    }
    
    
The number of days to retain automated backups. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.

Default: 1

Constraints:

  • Must be a value from 0 to 8

Returns a reference to this object so that method calls can be chained together.

Parameters:
backupRetentionPeriod The number of days to retain automated backups. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.

Default: 1

Constraints:

  • Must be a value from 0 to 8
Returns:
A reference to this updated object so that method calls can be chained together.
    public PromoteReadReplicaRequest withBackupRetentionPeriod(Integer backupRetentionPeriod) {
        this. = backupRetentionPeriod;
        return this;
    }

    
The daily time range during which automated backups are created if automated backups are enabled, using the BackupRetentionPeriod parameter.

Default: A 30-minute window selected at random from an 8-hour block of time per region. See the Amazon RDS User Guide for the time blocks for each region from which the default backup windows are assigned.

Constraints: Must be in the format hh24:mi-hh24:mi. Times should be Universal Time Coordinated (UTC). Must not conflict with the preferred maintenance window. Must be at least 30 minutes.

Returns:
The daily time range during which automated backups are created if automated backups are enabled, using the BackupRetentionPeriod parameter.

Default: A 30-minute window selected at random from an 8-hour block of time per region. See the Amazon RDS User Guide for the time blocks for each region from which the default backup windows are assigned.

Constraints: Must be in the format hh24:mi-hh24:mi. Times should be Universal Time Coordinated (UTC). Must not conflict with the preferred maintenance window. Must be at least 30 minutes.

    public String getPreferredBackupWindow() {
        return ;
    }
    
    
The daily time range during which automated backups are created if automated backups are enabled, using the BackupRetentionPeriod parameter.

Default: A 30-minute window selected at random from an 8-hour block of time per region. See the Amazon RDS User Guide for the time blocks for each region from which the default backup windows are assigned.

Constraints: Must be in the format hh24:mi-hh24:mi. Times should be Universal Time Coordinated (UTC). Must not conflict with the preferred maintenance window. Must be at least 30 minutes.

Parameters:
preferredBackupWindow The daily time range during which automated backups are created if automated backups are enabled, using the BackupRetentionPeriod parameter.

Default: A 30-minute window selected at random from an 8-hour block of time per region. See the Amazon RDS User Guide for the time blocks for each region from which the default backup windows are assigned.

Constraints: Must be in the format hh24:mi-hh24:mi. Times should be Universal Time Coordinated (UTC). Must not conflict with the preferred maintenance window. Must be at least 30 minutes.

    public void setPreferredBackupWindow(String preferredBackupWindow) {
        this. = preferredBackupWindow;
    }
    
    
The daily time range during which automated backups are created if automated backups are enabled, using the BackupRetentionPeriod parameter.

Default: A 30-minute window selected at random from an 8-hour block of time per region. See the Amazon RDS User Guide for the time blocks for each region from which the default backup windows are assigned.

Constraints: Must be in the format hh24:mi-hh24:mi. Times should be Universal Time Coordinated (UTC). Must not conflict with the preferred maintenance window. Must be at least 30 minutes.

Returns a reference to this object so that method calls can be chained together.

Parameters:
preferredBackupWindow The daily time range during which automated backups are created if automated backups are enabled, using the BackupRetentionPeriod parameter.

Default: A 30-minute window selected at random from an 8-hour block of time per region. See the Amazon RDS User Guide for the time blocks for each region from which the default backup windows are assigned.

Constraints: Must be in the format hh24:mi-hh24:mi. Times should be Universal Time Coordinated (UTC). Must not conflict with the preferred maintenance window. Must be at least 30 minutes.

Returns:
A reference to this updated object so that method calls can be chained together.
    public PromoteReadReplicaRequest withPreferredBackupWindow(String preferredBackupWindow) {
        this. = preferredBackupWindow;
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getDBInstanceIdentifier() != nullsb.append("DBInstanceIdentifier: " + getDBInstanceIdentifier() + ",");
        if (getBackupRetentionPeriod() != nullsb.append("BackupRetentionPeriod: " + getBackupRetentionPeriod() + ",");
        if (getPreferredBackupWindow() != nullsb.append("PreferredBackupWindow: " + getPreferredBackupWindow() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getDBInstanceIdentifier() == null) ? 0 : getDBInstanceIdentifier().hashCode()); 
        hashCode = prime * hashCode + ((getBackupRetentionPeriod() == null) ? 0 : getBackupRetentionPeriod().hashCode()); 
        hashCode = prime * hashCode + ((getPreferredBackupWindow() == null) ? 0 : getPreferredBackupWindow().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof PromoteReadReplicaRequest == falsereturn false;
        
        if (other.getDBInstanceIdentifier() == null ^ this.getDBInstanceIdentifier() == nullreturn false;
        if (other.getDBInstanceIdentifier() != null && other.getDBInstanceIdentifier().equals(this.getDBInstanceIdentifier()) == falsereturn false
        if (other.getBackupRetentionPeriod() == null ^ this.getBackupRetentionPeriod() == nullreturn false;
        if (other.getBackupRetentionPeriod() != null && other.getBackupRetentionPeriod().equals(this.getBackupRetentionPeriod()) == falsereturn false
        if (other.getPreferredBackupWindow() == null ^ this.getPreferredBackupWindow() == nullreturn false;
        if (other.getPreferredBackupWindow() != null && other.getPreferredBackupWindow().equals(this.getPreferredBackupWindow()) == falsereturn false
        return true;
    }
    
    @Override
    public PromoteReadReplicaRequest clone() {
        
            return (PromoteReadReplicaRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X