private HostedZone getHostedZone(String domain) { ListHostedZonesRequest listHostedZoneRequest = new ListHostedZonesRequest(); listHostedZoneRequest.setMaxItems(String.valueOf(Integer.MAX_VALUE)); ListHostedZonesResult listHostedZonesResult = amazonRoute53Client.listHostedZones(listHostedZoneRequest); for(HostedZone hostedZone : listHostedZonesResult.getHostedZones()) { if (domain.endsWith(hostedZone.getName())) { return hostedZone; } } return null; }
/** * 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 (getId() != null) sb.append("Id: ").append(getId()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getCallerReference() != null) sb.append("CallerReference: ").append(getCallerReference()).append(","); if (getConfig() != null) sb.append("Config: ").append(getConfig()).append(","); if (getResourceRecordSetCount() != null) sb.append("ResourceRecordSetCount: ").append(getResourceRecordSetCount()).append(","); if (getLinkedService() != null) sb.append("LinkedService: ").append(getLinkedService()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getCallerReference() == null) ? 0 : getCallerReference().hashCode()); hashCode = prime * hashCode + ((getConfig() == null) ? 0 : getConfig().hashCode()); hashCode = prime * hashCode + ((getResourceRecordSetCount() == null) ? 0 : getResourceRecordSetCount().hashCode()); hashCode = prime * hashCode + ((getLinkedService() == null) ? 0 : getLinkedService().hashCode()); return hashCode; }
if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getCallerReference() == null ^ this.getCallerReference() == null)
private HostedZone getHostedZone(String domain) { ListHostedZonesRequest listHostedZoneRequest = new ListHostedZonesRequest(); listHostedZoneRequest.setMaxItems(String.valueOf(Integer.MAX_VALUE)); ListHostedZonesResult listHostedZonesResult = amazonRoute53Client.listHostedZones(listHostedZoneRequest); for(HostedZone hostedZone : listHostedZonesResult.getHostedZones()) { if (domain.endsWith(hostedZone.getName())) { return hostedZone; } } return null; }
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; }
String zoneName = dnsName + "."; if(zoneList.size()>0 && zoneName.equals(zoneList.get(0).getName()))