@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAddress() == null) ? 0 : getAddress().hashCode()); hashCode = prime * hashCode + ((getPort() == null) ? 0 : getPort().hashCode()); return hashCode; }
/** * <p> * The DNS address of the Cluster. * </p> * * @param address * The DNS address of the Cluster. * @return Returns a reference to this object so that method calls can be chained together. */ public Endpoint withAddress(String address) { setAddress(address); return this; }
/** * <p> * The port that the database engine is listening on. * </p> * * @param port * The port that the database engine is listening on. * @return Returns a reference to this object so that method calls can be chained together. */ public Endpoint withPort(Integer port) { setPort(port); return this; }
public Endpoint unmarshall(StaxUnmarshallerContext context) throws Exception { Endpoint endpoint = new Endpoint(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return endpoint; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Address", targetDepth)) { endpoint.setAddress(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("Port", targetDepth)) { endpoint.setPort(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return endpoint; } } } }
hashCode = prime * hashCode + ((getMasterUsername() == null) ? 0 : getMasterUsername().hashCode()); hashCode = prime * hashCode + ((getDBName() == null) ? 0 : getDBName().hashCode()); hashCode = prime * hashCode + ((getEndpoint() == null) ? 0 : getEndpoint().hashCode()); hashCode = prime * hashCode + ((getClusterCreateTime() == null) ? 0 : getClusterCreateTime().hashCode()); hashCode = prime * hashCode + ((getAutomatedSnapshotRetentionPeriod() == null) ? 0 : getAutomatedSnapshotRetentionPeriod().hashCode());
if (other.getEndpoint() == null ^ this.getEndpoint() == null) return false; if (other.getEndpoint() != null && other.getEndpoint().equals(this.getEndpoint()) == false) return false; if (other.getClusterCreateTime() == null ^ this.getClusterCreateTime() == null)
public Endpoint unmarshall(StaxUnmarshallerContext context) throws Exception { Endpoint endpoint = new Endpoint(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return endpoint; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Address", targetDepth)) { endpoint.setAddress(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("Port", targetDepth)) { endpoint.setPort(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return endpoint; } } } }
hashCode = prime * hashCode + ((getMasterUsername() == null) ? 0 : getMasterUsername().hashCode()); hashCode = prime * hashCode + ((getDBName() == null) ? 0 : getDBName().hashCode()); hashCode = prime * hashCode + ((getEndpoint() == null) ? 0 : getEndpoint().hashCode()); hashCode = prime * hashCode + ((getClusterCreateTime() == null) ? 0 : getClusterCreateTime().hashCode()); hashCode = prime * hashCode + ((getAutomatedSnapshotRetentionPeriod() == null) ? 0 : getAutomatedSnapshotRetentionPeriod().hashCode());
if (other.getEndpoint() == null ^ this.getEndpoint() == null) return false; if (other.getEndpoint() != null && other.getEndpoint().equals(this.getEndpoint()) == false) return false; if (other.getClusterCreateTime() == null ^ this.getClusterCreateTime() == null)
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Endpoint == false) return false; Endpoint other = (Endpoint) obj; if (other.getAddress() == null ^ this.getAddress() == null) return false; if (other.getAddress() != null && other.getAddress().equals(this.getAddress()) == false) return false; if (other.getPort() == null ^ this.getPort() == null) return false; if (other.getPort() != null && other.getPort().equals(this.getPort()) == false) return false; return true; }
/** * <p> * The DNS address of the Cluster. * </p> * * @param address * The DNS address of the Cluster. * @return Returns a reference to this object so that method calls can be chained together. */ public Endpoint withAddress(String address) { setAddress(address); return this; }
/** * <p> * The port that the database engine is listening on. * </p> * * @param port * The port that the database engine is listening on. * @return Returns a reference to this object so that method calls can be chained together. */ public Endpoint withPort(Integer port) { setPort(port); 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 (getAddress() != null) sb.append("Address: ").append(getAddress()).append(","); if (getPort() != null) sb.append("Port: ").append(getPort()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAddress() == null) ? 0 : getAddress().hashCode()); hashCode = prime * hashCode + ((getPort() == null) ? 0 : getPort().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Endpoint == false) return false; Endpoint other = (Endpoint) obj; if (other.getAddress() == null ^ this.getAddress() == null) return false; if (other.getAddress() != null && other.getAddress().equals(this.getAddress()) == false) return false; if (other.getPort() == null ^ this.getPort() == null) return false; if (other.getPort() != null && other.getPort().equals(this.getPort()) == 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 (getAddress() != null) sb.append("Address: ").append(getAddress()).append(","); if (getPort() != null) sb.append("Port: ").append(getPort()); sb.append("}"); return sb.toString(); }
private void describe(String dbInstanceIdentifier) throws Exception { while (true) { DescribeDBInstancesRequest request = new DescribeDBInstancesRequest() .withDBInstanceIdentifier(dbInstanceIdentifier); DescribeClustersResult response = client.describeClusters(new DescribeClustersRequest() .withClusterIdentifier(INSTANCE_ID) ); Cluster dbInstance = response.getClusters().get(0); if (!dbInstance.getClusterStatus().equalsIgnoreCase("creating")) { System.out.println("Done! " + response); System.out.println(dbInstance.getEndpoint().getAddress()); System.out.println(dbInstance.getEndpoint().getPort()); break; } System.out.println("Not done - will wait 10s: " + response); Thread.sleep(10000L); } }