Example usage for com.amazonaws.services.rds.model DBInstance setPreferredMaintenanceWindow

List of usage examples for com.amazonaws.services.rds.model DBInstance setPreferredMaintenanceWindow

Introduction

In this page you can find the example usage for com.amazonaws.services.rds.model DBInstance setPreferredMaintenanceWindow.

Prototype


public void setPreferredMaintenanceWindow(String preferredMaintenanceWindow) 

Source Link

Document

Specifies the weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).

Usage

From source file:com.msi.tough.utils.rds.InstanceEntity.java

public static DBInstance toDBInstance(final RdsDbinstance b, final AccountBean ac) {
    final DBInstance instRec = new DBInstance();
    instRec.setDBInstanceIdentifier(b.getDbinstanceId());
    instRec.setReadReplicaSourceDBInstanceIdentifier(b.getSourceDbinstanceId());
    instRec.setReadReplicaDBInstanceIdentifiers(b.getReplicas());
    instRec.setDBInstanceClass(b.getDbinstanceClass());
    instRec.setAllocatedStorage(Integer.valueOf(b.getAllocatedStorage()));
    instRec.setInstanceCreateTime(b.getInstanceCreateTime());
    instRec.setDBInstanceStatus(b.getDbinstanceStatus());
    instRec.setEngine(b.getEngine());//from  w w  w. java  2s .  c  o m
    instRec.setEngineVersion(b.getEngineVersion());
    instRec.setAvailabilityZone(b.getAvailabilityZone());
    instRec.setMultiAZ(b.getMultiAz());
    instRec.setMasterUsername(b.getMasterUsername());
    instRec.setDBName(b.getDbName());
    instRec.setAutoMinorVersionUpgrade(b.getAutoMinorVersionUpgrade());
    instRec.setBackupRetentionPeriod(Integer.valueOf(b.getBackupRetentionPeriod()));
    instRec.setLatestRestorableTime(b.getLatestRestorableTime());
    instRec.setPreferredBackupWindow(b.getPreferredBackupWindow());
    instRec.setPreferredMaintenanceWindow(b.getPreferredMaintenanceWindow());
    instRec.setLicenseModel(b.getLicenseModel());
    final Endpoint endpoint = new Endpoint();
    endpoint.setAddress(b.getAddress());
    endpoint.setPort(Integer.valueOf(b.getPort()));
    instRec.setEndpoint(endpoint);
    String status = b.getDbinstanceStatus();
    if (status.equals("restoring")) {
        status = "creating";
    }
    instRec.setDBInstanceStatus(status);
    final String dbparamName = b.getDbParameterGroup();
    final Collection<DBParameterGroupStatus> dBParameterGroups = new LinkedList<DBParameterGroupStatus>();
    final DBParameterGroupStatus dbparamStatus = new DBParameterGroupStatus();
    dbparamStatus.setDBParameterGroupName(dbparamName);
    if (b.getPendingRebootParameters() == null || b.getPendingRebootParameters().size() == 0) {
        dbparamStatus.setParameterApplyStatus(RDSUtilities.STATUS_IN_SYNC);
    } else {
        dbparamStatus.setParameterApplyStatus(RDSUtilities.STATUS_PENDING_REBOOT);
    }
    dBParameterGroups.add(dbparamStatus);
    instRec.setDBParameterGroups(dBParameterGroups);

    final Collection<DBSecurityGroupMembership> dBSecurityGroups = new LinkedList<DBSecurityGroupMembership>();
    for (final RdsDbsecurityGroup secGrp : b.getSecurityGroups()) {
        final DBSecurityGroupMembership membership = new DBSecurityGroupMembership();
        membership.setDBSecurityGroupName(secGrp.getDbsecurityGroupName());
        membership.setStatus(secGrp.getStatus());
        dBSecurityGroups.add(membership);
    }
    instRec.setDBSecurityGroups(dBSecurityGroups);
    return instRec;
}