@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDBInstanceIdentifier() == null) ? 0 : getDBInstanceIdentifier().hashCode()); hashCode = prime * hashCode + ((getIsClusterWriter() == null) ? 0 : getIsClusterWriter().hashCode()); hashCode = prime * hashCode + ((getDBClusterParameterGroupStatus() == null) ? 0 : getDBClusterParameterGroupStatus().hashCode()); hashCode = prime * hashCode + ((getPromotionTier() == null) ? 0 : getPromotionTier().hashCode()); return hashCode; }
/** * <p> * Specifies the status of the DB cluster parameter group for this member of the DB cluster. * </p> * * @param dBClusterParameterGroupStatus * Specifies the status of the DB cluster parameter group for this member of the DB cluster. * @return Returns a reference to this object so that method calls can be chained together. */ public DBClusterMember withDBClusterParameterGroupStatus(String dBClusterParameterGroupStatus) { setDBClusterParameterGroupStatus(dBClusterParameterGroupStatus); return this; }
/** * <p> * Specifies the instance identifier for this member of the DB cluster. * </p> * * @param dBInstanceIdentifier * Specifies the instance identifier for this member of the DB cluster. * @return Returns a reference to this object so that method calls can be chained together. */ public DBClusterMember withDBInstanceIdentifier(String dBInstanceIdentifier) { setDBInstanceIdentifier(dBInstanceIdentifier); return this; }
public DBClusterMember unmarshall(StaxUnmarshallerContext context) throws Exception { DBClusterMember dBClusterMember = new DBClusterMember(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; dBClusterMember.setDBInstanceIdentifier(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; dBClusterMember.setIsClusterWriter(BooleanStaxUnmarshaller.getInstance().unmarshall(context)); continue; dBClusterMember.setDBClusterParameterGroupStatus(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; dBClusterMember.setPromotionTier(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue;
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; } }
for (DBCluster cluster : clusters) { for (DBClusterMember member : cluster.getDBClusterMembers()) { instanceIdToCluster.put(member.getDBInstanceIdentifier(), cluster);
/** * <p> * Value that is <code>true</code> if the cluster member is the primary instance for the DB cluster and * <code>false</code> otherwise. * </p> * * @param isClusterWriter * Value that is <code>true</code> if the cluster member is the primary instance for the DB cluster and * <code>false</code> otherwise. * @return Returns a reference to this object so that method calls can be chained together. */ public DBClusterMember withIsClusterWriter(Boolean isClusterWriter) { setIsClusterWriter(isClusterWriter); return this; }
/** * <p> * A value that specifies the order in which an Aurora Replica is promoted to the primary instance after a failure * of the existing primary instance. For more information, see <a href= * "http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.Managing.Backups.html#Aurora.Managing.FaultTolerance" * > Fault Tolerance for an Aurora DB Cluster</a> in the <i>Amazon Aurora User Guide</i>. * </p> * * @param promotionTier * A value that specifies the order in which an Aurora Replica is promoted to the primary instance after a * failure of the existing primary instance. For more information, see <a href= * "http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.Managing.Backups.html#Aurora.Managing.FaultTolerance" * > Fault Tolerance for an Aurora DB Cluster</a> in the <i>Amazon Aurora User Guide</i>. * @return Returns a reference to this object so that method calls can be chained together. */ public DBClusterMember withPromotionTier(Integer promotionTier) { setPromotionTier(promotionTier); return this; }
public DBClusterMember unmarshall(StaxUnmarshallerContext context) throws Exception { DBClusterMember dBClusterMember = new DBClusterMember(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; dBClusterMember.setDBInstanceIdentifier(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; dBClusterMember.setIsClusterWriter(BooleanStaxUnmarshaller.getInstance().unmarshall(context)); continue; dBClusterMember.setDBClusterParameterGroupStatus(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; dBClusterMember.setPromotionTier(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue;
/** * <p> * Value that is <code>true</code> if the cluster member is the primary instance for the DB cluster and * <code>false</code> otherwise. * </p> * * @param isClusterWriter * Value that is <code>true</code> if the cluster member is the primary instance for the DB cluster and * <code>false</code> otherwise. * @return Returns a reference to this object so that method calls can be chained together. */ public DBClusterMember withIsClusterWriter(Boolean isClusterWriter) { setIsClusterWriter(isClusterWriter); return this; }
/** * <p> * A value that specifies the order in which an Aurora Replica is promoted to the primary instance after a failure * of the existing primary instance. For more information, see <a href= * "http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.Managing.Backups.html#Aurora.Managing.FaultTolerance" * > Fault Tolerance for an Aurora DB Cluster</a> in the <i>Amazon Aurora User Guide</i>. * </p> * * @param promotionTier * A value that specifies the order in which an Aurora Replica is promoted to the primary instance after a * failure of the existing primary instance. For more information, see <a href= * "http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.Managing.Backups.html#Aurora.Managing.FaultTolerance" * > Fault Tolerance for an Aurora DB Cluster</a> in the <i>Amazon Aurora User Guide</i>. * @return Returns a reference to this object so that method calls can be chained together. */ public DBClusterMember withPromotionTier(Integer promotionTier) { setPromotionTier(promotionTier); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DBClusterMember == false) return false; DBClusterMember other = (DBClusterMember) obj; if (other.getDBInstanceIdentifier() == null ^ this.getDBInstanceIdentifier() == null) return false; if (other.getDBInstanceIdentifier() != null && other.getDBInstanceIdentifier().equals(this.getDBInstanceIdentifier()) == false) return false; if (other.getIsClusterWriter() == null ^ this.getIsClusterWriter() == null) return false; if (other.getIsClusterWriter() != null && other.getIsClusterWriter().equals(this.getIsClusterWriter()) == false) return false; if (other.getDBClusterParameterGroupStatus() == null ^ this.getDBClusterParameterGroupStatus() == null) return false; if (other.getDBClusterParameterGroupStatus() != null && other.getDBClusterParameterGroupStatus().equals(this.getDBClusterParameterGroupStatus()) == false) return false; if (other.getPromotionTier() == null ^ this.getPromotionTier() == null) return false; if (other.getPromotionTier() != null && other.getPromotionTier().equals(this.getPromotionTier()) == false) return false; return true; }
/** * <p> * Specifies the status of the DB cluster parameter group for this member of the DB cluster. * </p> * * @param dBClusterParameterGroupStatus * Specifies the status of the DB cluster parameter group for this member of the DB cluster. * @return Returns a reference to this object so that method calls can be chained together. */ public DBClusterMember withDBClusterParameterGroupStatus(String dBClusterParameterGroupStatus) { setDBClusterParameterGroupStatus(dBClusterParameterGroupStatus); return this; }
/** * <p> * Specifies the instance identifier for this member of the DB cluster. * </p> * * @param dBInstanceIdentifier * Specifies the instance identifier for this member of the DB cluster. * @return Returns a reference to this object so that method calls can be chained together. */ public DBClusterMember withDBInstanceIdentifier(String dBInstanceIdentifier) { setDBInstanceIdentifier(dBInstanceIdentifier); return this; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getDBInstanceIdentifier() != null) sb.append("DBInstanceIdentifier: ").append(getDBInstanceIdentifier()).append(","); if (getIsClusterWriter() != null) sb.append("IsClusterWriter: ").append(getIsClusterWriter()).append(","); if (getDBClusterParameterGroupStatus() != null) sb.append("DBClusterParameterGroupStatus: ").append(getDBClusterParameterGroupStatus()).append(","); if (getPromotionTier() != null) sb.append("PromotionTier: ").append(getPromotionTier()); 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 + ((getIsClusterWriter() == null) ? 0 : getIsClusterWriter().hashCode()); hashCode = prime * hashCode + ((getDBClusterParameterGroupStatus() == null) ? 0 : getDBClusterParameterGroupStatus().hashCode()); hashCode = prime * hashCode + ((getPromotionTier() == null) ? 0 : getPromotionTier().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DBClusterMember == false) return false; DBClusterMember other = (DBClusterMember) obj; if (other.getDBInstanceIdentifier() == null ^ this.getDBInstanceIdentifier() == null) return false; if (other.getDBInstanceIdentifier() != null && other.getDBInstanceIdentifier().equals(this.getDBInstanceIdentifier()) == false) return false; if (other.getIsClusterWriter() == null ^ this.getIsClusterWriter() == null) return false; if (other.getIsClusterWriter() != null && other.getIsClusterWriter().equals(this.getIsClusterWriter()) == false) return false; if (other.getDBClusterParameterGroupStatus() == null ^ this.getDBClusterParameterGroupStatus() == null) return false; if (other.getDBClusterParameterGroupStatus() != null && other.getDBClusterParameterGroupStatus().equals(this.getDBClusterParameterGroupStatus()) == false) return false; if (other.getPromotionTier() == null ^ this.getPromotionTier() == null) return false; if (other.getPromotionTier() != null && other.getPromotionTier().equals(this.getPromotionTier()) == false) return false; return true; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getDBInstanceIdentifier() != null) sb.append("DBInstanceIdentifier: ").append(getDBInstanceIdentifier()).append(","); if (getIsClusterWriter() != null) sb.append("IsClusterWriter: ").append(getIsClusterWriter()).append(","); if (getDBClusterParameterGroupStatus() != null) sb.append("DBClusterParameterGroupStatus: ").append(getDBClusterParameterGroupStatus()).append(","); if (getPromotionTier() != null) sb.append("PromotionTier: ").append(getPromotionTier()); sb.append("}"); return sb.toString(); }