hashCode = prime * hashCode + ((getAllocatedStorage() == null) ? 0 : getAllocatedStorage().hashCode()); hashCode = prime * hashCode + ((getAvailabilityZones() == null) ? 0 : getAvailabilityZones().hashCode()); hashCode = prime * hashCode + ((getBackupRetentionPeriod() == null) ? 0 : getBackupRetentionPeriod().hashCode()); hashCode = prime * hashCode + ((getCharacterSetName() == null) ? 0 : getCharacterSetName().hashCode()); hashCode = prime * hashCode + ((getDatabaseName() == null) ? 0 : getDatabaseName().hashCode()); hashCode = prime * hashCode + ((getDBClusterIdentifier() == null) ? 0 : getDBClusterIdentifier().hashCode()); hashCode = prime * hashCode + ((getDBClusterParameterGroup() == null) ? 0 : getDBClusterParameterGroup().hashCode()); hashCode = prime * hashCode + ((getDBSubnetGroup() == null) ? 0 : getDBSubnetGroup().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getPercentProgress() == null) ? 0 : getPercentProgress().hashCode()); hashCode = prime * hashCode + ((getEarliestRestorableTime() == null) ? 0 : getEarliestRestorableTime().hashCode()); hashCode = prime * hashCode + ((getEndpoint() == null) ? 0 : getEndpoint().hashCode()); hashCode = prime * hashCode + ((getReaderEndpoint() == null) ? 0 : getReaderEndpoint().hashCode()); hashCode = prime * hashCode + ((getCustomEndpoints() == null) ? 0 : getCustomEndpoints().hashCode()); hashCode = prime * hashCode + ((getMultiAZ() == null) ? 0 : getMultiAZ().hashCode()); hashCode = prime * hashCode + ((getEngine() == null) ? 0 : getEngine().hashCode()); hashCode = prime * hashCode + ((getEngineVersion() == null) ? 0 : getEngineVersion().hashCode()); hashCode = prime * hashCode + ((getLatestRestorableTime() == null) ? 0 : getLatestRestorableTime().hashCode()); hashCode = prime * hashCode + ((getPort() == null) ? 0 : getPort().hashCode()); hashCode = prime * hashCode + ((getMasterUsername() == null) ? 0 : getMasterUsername().hashCode()); hashCode = prime * hashCode + ((getDBClusterOptionGroupMemberships() == null) ? 0 : getDBClusterOptionGroupMemberships().hashCode()); hashCode = prime * hashCode + ((getPreferredBackupWindow() == null) ? 0 : getPreferredBackupWindow().hashCode()); hashCode = prime * hashCode + ((getPreferredMaintenanceWindow() == null) ? 0 : getPreferredMaintenanceWindow().hashCode()); hashCode = prime * hashCode + ((getReplicationSourceIdentifier() == null) ? 0 : getReplicationSourceIdentifier().hashCode()); hashCode = prime * hashCode + ((getReadReplicaIdentifiers() == null) ? 0 : getReadReplicaIdentifiers().hashCode()); hashCode = prime * hashCode + ((getDBClusterMembers() == null) ? 0 : getDBClusterMembers().hashCode()); hashCode = prime * hashCode + ((getVpcSecurityGroups() == null) ? 0 : getVpcSecurityGroups().hashCode()); hashCode = prime * hashCode + ((getHostedZoneId() == null) ? 0 : getHostedZoneId().hashCode()); hashCode = prime * hashCode + ((getStorageEncrypted() == null) ? 0 : getStorageEncrypted().hashCode());
public DBCluster unmarshall(StaxUnmarshallerContext context) throws Exception { DBCluster dBCluster = new DBCluster(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; dBCluster.setAllocatedStorage(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; dBCluster.withAvailabilityZones(new ArrayList<String>()); continue; dBCluster.withAvailabilityZones(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; dBCluster.setBackupRetentionPeriod(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; dBCluster.setCharacterSetName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; dBCluster.setDatabaseName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; dBCluster.setDBClusterIdentifier(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; dBCluster.setDBClusterParameterGroup(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; dBCluster.setDBSubnetGroup(StringStaxUnmarshaller.getInstance().unmarshall(context));
public static boolean checkIfMaster(DBInstance instance, DBCluster cluster) { if (instance.getDBClusterIdentifier() == null || cluster == null) { // It's NOT a member of a DB cluster return instance.getReadReplicaSourceDBInstanceIdentifier() == null; } else { // It's a member of a DB cluster for (DBClusterMember member : cluster.getDBClusterMembers()) { if (member.getDBInstanceIdentifier().equals(instance.getDBInstanceIdentifier()) && member.isClusterWriter()) { return true; } } return false; } }
getLogger().info("Restored an RDS cluster to point in time: {}", dbCluster.getDBClusterIdentifier());
lastStatus = dbCluster.getStatus(); if (successStatuses.contains(lastStatus)) { getLogger().info("Status of DB cluster {} is now {}.", dbClusterIdentifier, lastStatus);
for(DBCluster cluster : rdsListTemp){ DBClusterVH vh = new DBClusterVH(cluster,rdsClient.listTagsForResource(new ListTagsForResourceRequest(). withResourceName(cluster.getDBClusterArn())). getTagList()); rdsList.add(vh);
log.debug("Found {} DB clusters", clusters.size()); for (DBCluster cluster : clusters) { for (DBClusterMember member : cluster.getDBClusterMembers()) { instanceIdToCluster.put(member.getDBInstanceIdentifier(), cluster);
@TaskAction public void deleteDBInstance() { String dbClusterIdentifier = getDbClusterIdentifier(); if (dbClusterIdentifier == null) { throw new GradleException("dbClusterIdentifier is required"); } AmazonRDSPluginExtension ext = getProject().getExtensions().getByType(AmazonRDSPluginExtension.class); AmazonRDS rds = ext.getClient(); try { DeleteDBClusterRequest request = new DeleteDBClusterRequest() .withDBClusterIdentifier(dbClusterIdentifier) .withSkipFinalSnapshot(isSkipFinalSnapshot()) .withFinalDBSnapshotIdentifier(getFinalDBSnapshotIdentifier()); dbCluster = rds.deleteDBCluster(request); getLogger().info("Delete RDS cluster requested: {}", dbCluster.getDBClusterIdentifier()); } catch (DBInstanceNotFoundException e) { getLogger().warn(e.getMessage()); } } }
return false; DBCluster other = (DBCluster) obj; if (other.getAllocatedStorage() == null ^ this.getAllocatedStorage() == null) return false; if (other.getAllocatedStorage() != null && other.getAllocatedStorage().equals(this.getAllocatedStorage()) == false) return false; if (other.getAvailabilityZones() == null ^ this.getAvailabilityZones() == null) return false; if (other.getAvailabilityZones() != null && other.getAvailabilityZones().equals(this.getAvailabilityZones()) == false) return false; if (other.getBackupRetentionPeriod() == null ^ this.getBackupRetentionPeriod() == null) return false; if (other.getBackupRetentionPeriod() != null && other.getBackupRetentionPeriod().equals(this.getBackupRetentionPeriod()) == false) return false; if (other.getCharacterSetName() == null ^ this.getCharacterSetName() == null) return false; if (other.getCharacterSetName() != null && other.getCharacterSetName().equals(this.getCharacterSetName()) == false) return false; if (other.getDatabaseName() == null ^ this.getDatabaseName() == null) return false; if (other.getDatabaseName() != null && other.getDatabaseName().equals(this.getDatabaseName()) == false) return false; if (other.getDBClusterIdentifier() == null ^ this.getDBClusterIdentifier() == null) return false; if (other.getDBClusterIdentifier() != null && other.getDBClusterIdentifier().equals(this.getDBClusterIdentifier()) == false) return false; if (other.getDBClusterParameterGroup() == null ^ this.getDBClusterParameterGroup() == null) return false; if (other.getDBClusterParameterGroup() != null && other.getDBClusterParameterGroup().equals(this.getDBClusterParameterGroup()) == false)
public DBCluster unmarshall(StaxUnmarshallerContext context) throws Exception { DBCluster dBCluster = new DBCluster(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; dBCluster.setAllocatedStorage(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; dBCluster.withAvailabilityZones(new ArrayList<String>()); continue; dBCluster.withAvailabilityZones(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; dBCluster.setBackupRetentionPeriod(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; dBCluster.setCharacterSetName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; dBCluster.setDatabaseName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; dBCluster.setDBClusterIdentifier(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; dBCluster.setDBClusterParameterGroup(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; dBCluster.setDBSubnetGroup(StringStaxUnmarshaller.getInstance().unmarshall(context));
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getAllocatedStorage() != null) sb.append("AllocatedStorage: ").append(getAllocatedStorage()).append(","); if (getAvailabilityZones() != null) sb.append("AvailabilityZones: ").append(getAvailabilityZones()).append(","); if (getBackupRetentionPeriod() != null) sb.append("BackupRetentionPeriod: ").append(getBackupRetentionPeriod()).append(","); if (getCharacterSetName() != null) sb.append("CharacterSetName: ").append(getCharacterSetName()).append(","); if (getDatabaseName() != null) sb.append("DatabaseName: ").append(getDatabaseName()).append(","); if (getDBClusterIdentifier() != null) sb.append("DBClusterIdentifier: ").append(getDBClusterIdentifier()).append(","); if (getDBClusterParameterGroup() != null) sb.append("DBClusterParameterGroup: ").append(getDBClusterParameterGroup()).append(","); if (getDBSubnetGroup() != null) sb.append("DBSubnetGroup: ").append(getDBSubnetGroup()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getPercentProgress() != null) sb.append("PercentProgress: ").append(getPercentProgress()).append(","); if (getEarliestRestorableTime() != null) sb.append("EarliestRestorableTime: ").append(getEarliestRestorableTime()).append(","); if (getEndpoint() != null) sb.append("Endpoint: ").append(getEndpoint()).append(","); if (getReaderEndpoint() != null) sb.append("ReaderEndpoint: ").append(getReaderEndpoint()).append(","); if (getCustomEndpoints() != null)
hashCode = prime * hashCode + ((getAllocatedStorage() == null) ? 0 : getAllocatedStorage().hashCode()); hashCode = prime * hashCode + ((getAvailabilityZones() == null) ? 0 : getAvailabilityZones().hashCode()); hashCode = prime * hashCode + ((getBackupRetentionPeriod() == null) ? 0 : getBackupRetentionPeriod().hashCode()); hashCode = prime * hashCode + ((getCharacterSetName() == null) ? 0 : getCharacterSetName().hashCode()); hashCode = prime * hashCode + ((getDatabaseName() == null) ? 0 : getDatabaseName().hashCode()); hashCode = prime * hashCode + ((getDBClusterIdentifier() == null) ? 0 : getDBClusterIdentifier().hashCode()); hashCode = prime * hashCode + ((getDBClusterParameterGroup() == null) ? 0 : getDBClusterParameterGroup().hashCode()); hashCode = prime * hashCode + ((getDBSubnetGroup() == null) ? 0 : getDBSubnetGroup().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getPercentProgress() == null) ? 0 : getPercentProgress().hashCode()); hashCode = prime * hashCode + ((getEarliestRestorableTime() == null) ? 0 : getEarliestRestorableTime().hashCode()); hashCode = prime * hashCode + ((getEndpoint() == null) ? 0 : getEndpoint().hashCode()); hashCode = prime * hashCode + ((getReaderEndpoint() == null) ? 0 : getReaderEndpoint().hashCode()); hashCode = prime * hashCode + ((getCustomEndpoints() == null) ? 0 : getCustomEndpoints().hashCode()); hashCode = prime * hashCode + ((getMultiAZ() == null) ? 0 : getMultiAZ().hashCode()); hashCode = prime * hashCode + ((getEngine() == null) ? 0 : getEngine().hashCode()); hashCode = prime * hashCode + ((getEngineVersion() == null) ? 0 : getEngineVersion().hashCode()); hashCode = prime * hashCode + ((getLatestRestorableTime() == null) ? 0 : getLatestRestorableTime().hashCode()); hashCode = prime * hashCode + ((getPort() == null) ? 0 : getPort().hashCode()); hashCode = prime * hashCode + ((getMasterUsername() == null) ? 0 : getMasterUsername().hashCode()); hashCode = prime * hashCode + ((getDBClusterOptionGroupMemberships() == null) ? 0 : getDBClusterOptionGroupMemberships().hashCode()); hashCode = prime * hashCode + ((getPreferredBackupWindow() == null) ? 0 : getPreferredBackupWindow().hashCode()); hashCode = prime * hashCode + ((getPreferredMaintenanceWindow() == null) ? 0 : getPreferredMaintenanceWindow().hashCode()); hashCode = prime * hashCode + ((getReplicationSourceIdentifier() == null) ? 0 : getReplicationSourceIdentifier().hashCode()); hashCode = prime * hashCode + ((getReadReplicaIdentifiers() == null) ? 0 : getReadReplicaIdentifiers().hashCode()); hashCode = prime * hashCode + ((getDBClusterMembers() == null) ? 0 : getDBClusterMembers().hashCode()); hashCode = prime * hashCode + ((getVpcSecurityGroups() == null) ? 0 : getVpcSecurityGroups().hashCode()); hashCode = prime * hashCode + ((getHostedZoneId() == null) ? 0 : getHostedZoneId().hashCode()); hashCode = prime * hashCode + ((getStorageEncrypted() == null) ? 0 : getStorageEncrypted().hashCode());
return false; DBCluster other = (DBCluster) obj; if (other.getAllocatedStorage() == null ^ this.getAllocatedStorage() == null) return false; if (other.getAllocatedStorage() != null && other.getAllocatedStorage().equals(this.getAllocatedStorage()) == false) return false; if (other.getAvailabilityZones() == null ^ this.getAvailabilityZones() == null) return false; if (other.getAvailabilityZones() != null && other.getAvailabilityZones().equals(this.getAvailabilityZones()) == false) return false; if (other.getBackupRetentionPeriod() == null ^ this.getBackupRetentionPeriod() == null) return false; if (other.getBackupRetentionPeriod() != null && other.getBackupRetentionPeriod().equals(this.getBackupRetentionPeriod()) == false) return false; if (other.getCharacterSetName() == null ^ this.getCharacterSetName() == null) return false; if (other.getCharacterSetName() != null && other.getCharacterSetName().equals(this.getCharacterSetName()) == false) return false; if (other.getDatabaseName() == null ^ this.getDatabaseName() == null) return false; if (other.getDatabaseName() != null && other.getDatabaseName().equals(this.getDatabaseName()) == false) return false; if (other.getDBClusterIdentifier() == null ^ this.getDBClusterIdentifier() == null) return false; if (other.getDBClusterIdentifier() != null && other.getDBClusterIdentifier().equals(this.getDBClusterIdentifier()) == false) return false; if (other.getDBClusterParameterGroup() == null ^ this.getDBClusterParameterGroup() == null) return false; if (other.getDBClusterParameterGroup() != null && other.getDBClusterParameterGroup().equals(this.getDBClusterParameterGroup()) == false)
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getAllocatedStorage() != null) sb.append("AllocatedStorage: ").append(getAllocatedStorage()).append(","); if (getAvailabilityZones() != null) sb.append("AvailabilityZones: ").append(getAvailabilityZones()).append(","); if (getBackupRetentionPeriod() != null) sb.append("BackupRetentionPeriod: ").append(getBackupRetentionPeriod()).append(","); if (getCharacterSetName() != null) sb.append("CharacterSetName: ").append(getCharacterSetName()).append(","); if (getDatabaseName() != null) sb.append("DatabaseName: ").append(getDatabaseName()).append(","); if (getDBClusterIdentifier() != null) sb.append("DBClusterIdentifier: ").append(getDBClusterIdentifier()).append(","); if (getDBClusterParameterGroup() != null) sb.append("DBClusterParameterGroup: ").append(getDBClusterParameterGroup()).append(","); if (getDBSubnetGroup() != null) sb.append("DBSubnetGroup: ").append(getDBSubnetGroup()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getPercentProgress() != null) sb.append("PercentProgress: ").append(getPercentProgress()).append(","); if (getEarliestRestorableTime() != null) sb.append("EarliestRestorableTime: ").append(getEarliestRestorableTime()).append(","); if (getEndpoint() != null) sb.append("Endpoint: ").append(getEndpoint()).append(","); if (getReaderEndpoint() != null) sb.append("ReaderEndpoint: ").append(getReaderEndpoint()).append(","); if (getCustomEndpoints() != null)