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

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

Introduction

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

Prototype


public void setEngineVersion(String engineVersion) 

Source Link

Document

Indicates the database engine version.

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());// w  ww .java 2s  .  co 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;
}