@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getHostedZone() == null) ? 0 : getHostedZone().hashCode()); hashCode = prime * hashCode + ((getDelegationSet() == null) ? 0 : getDelegationSet().hashCode()); hashCode = prime * hashCode + ((getVPCs() == null) ? 0 : getVPCs().hashCode()); return hashCode; }
/** * <p> * A complex type that lists the Amazon Route 53 name servers for the specified hosted zone. * </p> * * @param delegationSet * A complex type that lists the Amazon Route 53 name servers for the specified hosted zone. * @return Returns a reference to this object so that method calls can be chained together. */ public GetHostedZoneResult withDelegationSet(DelegationSet delegationSet) { setDelegationSet(delegationSet); return this; }
/** * <p> * A complex type that contains general information about the specified hosted zone. * </p> * * @param hostedZone * A complex type that contains general information about the specified hosted zone. * @return Returns a reference to this object so that method calls can be chained together. */ public GetHostedZoneResult withHostedZone(HostedZone hostedZone) { setHostedZone(hostedZone); return this; }
} else if (obj instanceof GetHostedZoneResult) { GetHostedZoneResult result = (GetHostedZoneResult)obj; removePrefix(result.getHostedZone()); } else if (obj instanceof ListHostedZonesResult) { ListHostedZonesResult result = (ListHostedZonesResult)obj; } else if (obj instanceof GetHostedZoneResult) { GetHostedZoneResult result = (GetHostedZoneResult) obj; removePrefix(result.getDelegationSet()); } else if (obj instanceof GetReusableDelegationSetResult) { GetReusableDelegationSetResult result = (GetReusableDelegationSetResult) obj;
public GetHostedZoneResult unmarshall(StaxUnmarshallerContext context) throws Exception { GetHostedZoneResult getHostedZoneResult = new GetHostedZoneResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; getHostedZoneResult.setHostedZone(HostedZoneStaxUnmarshaller.getInstance().unmarshall(context)); continue; getHostedZoneResult.setDelegationSet(DelegationSetStaxUnmarshaller.getInstance().unmarshall(context)); continue; getHostedZoneResult.withVPCs(new ArrayList<VPC>()); continue; getHostedZoneResult.withVPCs(VPCStaxUnmarshaller.getInstance().unmarshall(context)); continue;
protected void projectHostedZoneResult(GetHostedZoneResult hostedZoneResult) { HostedZone hz = hostedZoneResult.getHostedZone(); ObjectNode n = toJson(hostedZoneResult); getNeoRxClient().execCypher( "merge (a:AwsRoute53HostedZone {aws_id:{aws_id}}) set a+={props}, a.updateTs=timestamp() return a", "aws_id", n.get("aws_id").asText(), "props", n); ListResourceRecordSetsRequest request = new ListResourceRecordSetsRequest(); request.setHostedZoneId(hz.getId()); ListResourceRecordSetsResult result; long timestamp = System.currentTimeMillis(); do { rateLimit(); result = getClient().listResourceRecordSets(request); request.setStartRecordName(result.getNextRecordName()); for (ResourceRecordSet rs : result.getResourceRecordSets()) { projectResourceRecordSet(hz.getId(), rs, timestamp); } } while (result.isTruncated()); getNeoRxClient().execCypher( "match (z:AwsRoute53HostedZone {aws_id:{aws_id}})--(r:AwsRoute53RecordSet) where r.updateTs<{ts} detach delete r", "ts", timestamp, "aws_id", hz.getId()); getNeoRxClient().execCypher( "match (a:AwsRoute53RecordSet) where not (a)-[:CONTAINS]-(:AwsRoute53HostedZone) detach delete a"); }
/** * <p> * A complex type that contains information about the VPCs that are associated with the specified hosted zone. * </p> * * @param vPCs * A complex type that contains information about the VPCs that are associated with the specified hosted * zone. * @return Returns a reference to this object so that method calls can be chained together. */ public GetHostedZoneResult withVPCs(java.util.Collection<VPC> vPCs) { setVPCs(vPCs); return this; }
ObjectNode toJson(GetHostedZoneResult hzResult) { HostedZone hz = hzResult.getHostedZone(); ObjectNode n = mapper.createObjectNode(); n.put("aws_account", getAccountId()); n.put("aws_id", hz.getId()); n.put("aws_name", hz.getName()); n.put("aws_callerReference", hz.getCallerReference()); n.put("aws_resourceRecordSetCount", hz.getResourceRecordSetCount()); n.put("aws_comment", hz.getConfig().getComment()); n.put("aws_privateZone", hz.getConfig().getPrivateZone()); n.put("aws_arn", "arn:aws:route53:::hostedzone/" + hz.getId()); ArrayNode an = mapper.createArrayNode(); if (hzResult.getDelegationSet() != null) { hzResult.getDelegationSet().getNameServers().forEach(ns -> { an.add(ns); }); } n.set("aws_nameServers", an); return n; }
/** * <p> * A complex type that contains information about the VPCs that are associated with the specified hosted zone. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setVPCs(java.util.Collection)} or {@link #withVPCs(java.util.Collection)} if you want to override the * existing values. * </p> * * @param vPCs * A complex type that contains information about the VPCs that are associated with the specified hosted * zone. * @return Returns a reference to this object so that method calls can be chained together. */ public GetHostedZoneResult withVPCs(VPC... vPCs) { if (this.vPCs == null) { setVPCs(new com.amazonaws.internal.SdkInternalList<VPC>(vPCs.length)); } for (VPC ele : vPCs) { this.vPCs.add(ele); } return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetHostedZoneResult == false) return false; GetHostedZoneResult other = (GetHostedZoneResult) obj; if (other.getHostedZone() == null ^ this.getHostedZone() == null) return false; if (other.getHostedZone() != null && other.getHostedZone().equals(this.getHostedZone()) == false) return false; if (other.getDelegationSet() == null ^ this.getDelegationSet() == null) return false; if (other.getDelegationSet() != null && other.getDelegationSet().equals(this.getDelegationSet()) == false) return false; if (other.getVPCs() == null ^ this.getVPCs() == null) return false; if (other.getVPCs() != null && other.getVPCs().equals(this.getVPCs()) == 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 (getHostedZone() != null) sb.append("HostedZone: ").append(getHostedZone()).append(","); if (getDelegationSet() != null) sb.append("DelegationSet: ").append(getDelegationSet()).append(","); if (getVPCs() != null) sb.append("VPCs: ").append(getVPCs()); sb.append("}"); return sb.toString(); }