private ResourceRecordSet getResourceRecordSet(String domain, HostedZone hostedZone) { ListResourceRecordSetsRequest request = new ListResourceRecordSetsRequest(); request.setMaxItems(String.valueOf(Integer.MAX_VALUE)); request.setHostedZoneId(hostedZone.getId()); ListResourceRecordSetsResult listResourceRecordSetsResult = amazonRoute53Client.listResourceRecordSets(request); for(ResourceRecordSet rrs : listResourceRecordSetsResult.getResourceRecordSets()) { if (rrs.getName().equals(domain)) { return rrs; } } return null; }
/** * <p> * The first name in the lexicographic ordering of resource record sets that you want to list. * </p> * * @param startRecordName * The first name in the lexicographic ordering of resource record sets that you want to list. * @return Returns a reference to this object so that method calls can be chained together. */ public ListResourceRecordSetsRequest withStartRecordName(String startRecordName) { setStartRecordName(startRecordName); return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getHostedZoneId() == null) ? 0 : getHostedZoneId().hashCode()); hashCode = prime * hashCode + ((getStartRecordName() == null) ? 0 : getStartRecordName().hashCode()); hashCode = prime * hashCode + ((getStartRecordType() == null) ? 0 : getStartRecordType().hashCode()); hashCode = prime * hashCode + ((getStartRecordIdentifier() == null) ? 0 : getStartRecordIdentifier().hashCode()); hashCode = prime * hashCode + ((getMaxItems() == null) ? 0 : getMaxItems().hashCode()); return hashCode; }
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"); }
ListResourceRecordSetsResult result = r53Clinet_.listResourceRecordSets(new ListResourceRecordSetsRequest() .withHostedZoneId(zoneId) .withStartRecordName(source) );
/** * Constructs a new ListResourceRecordSetsRequest object. Callers should use the setter or fluent setter (with...) * methods to initialize any additional object members. * * @param hostedZoneId * The ID of the hosted zone that contains the resource record sets that you want to list. */ public ListResourceRecordSetsRequest(String hostedZoneId) { setHostedZoneId(hostedZoneId); }
ListResourceRecordSetsResult listResourceRecordSets = r53.listResourceRecordSets(new ListResourceRecordSetsRequest(zoneId));
/** * <p> * (Optional) The maximum number of resource records sets to include in the response body for this request. If the * response includes more than <code>maxitems</code> resource record sets, the value of the <code>IsTruncated</code> * element in the response is <code>true</code>, and the values of the <code>NextRecordName</code> and * <code>NextRecordType</code> elements in the response identify the first resource record set in the next group of * <code>maxitems</code> resource record sets. * </p> * * @param maxItems * (Optional) The maximum number of resource records sets to include in the response body for this request. * If the response includes more than <code>maxitems</code> resource record sets, the value of the * <code>IsTruncated</code> element in the response is <code>true</code>, and the values of the * <code>NextRecordName</code> and <code>NextRecordType</code> elements in the response identify the first * resource record set in the next group of <code>maxitems</code> resource record sets. * @return Returns a reference to this object so that method calls can be chained together. */ public ListResourceRecordSetsRequest withMaxItems(String maxItems) { setMaxItems(maxItems); return this; }
/** * <p> * The ID of the hosted zone that contains the resource record sets that you want to list. * </p> * * @param hostedZoneId * The ID of the hosted zone that contains the resource record sets that you want to list. * @return Returns a reference to this object so that method calls can be chained together. */ public ListResourceRecordSetsRequest withHostedZoneId(String hostedZoneId) { setHostedZoneId(hostedZoneId); return this; }
private ResourceRecordSet getResourceRecordSet(String domain, HostedZone hostedZone) { ListResourceRecordSetsRequest request = new ListResourceRecordSetsRequest(); request.setMaxItems(String.valueOf(Integer.MAX_VALUE)); request.setHostedZoneId(hostedZone.getId()); ListResourceRecordSetsResult listResourceRecordSetsResult = amazonRoute53Client.listResourceRecordSets(request); for(ResourceRecordSet rrs : listResourceRecordSetsResult.getResourceRecordSets()) { if (rrs.getName().equals(domain)) { return rrs; } } return null; }
return false; ListResourceRecordSetsRequest other = (ListResourceRecordSetsRequest) obj; if (other.getHostedZoneId() == null ^ this.getHostedZoneId() == null) return false; if (other.getHostedZoneId() != null && other.getHostedZoneId().equals(this.getHostedZoneId()) == false) return false; if (other.getStartRecordName() == null ^ this.getStartRecordName() == null) return false; if (other.getStartRecordName() != null && other.getStartRecordName().equals(this.getStartRecordName()) == false) return false; if (other.getStartRecordType() == null ^ this.getStartRecordType() == null) return false; if (other.getStartRecordType() != null && other.getStartRecordType().equals(this.getStartRecordType()) == false) return false; if (other.getStartRecordIdentifier() == null ^ this.getStartRecordIdentifier() == null) return false; if (other.getStartRecordIdentifier() != null && other.getStartRecordIdentifier().equals(this.getStartRecordIdentifier()) == false) return false; if (other.getMaxItems() == null ^ this.getMaxItems() == null) return false; if (other.getMaxItems() != null && other.getMaxItems().equals(this.getMaxItems()) == 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 (getHostedZoneId() != null) sb.append("HostedZoneId: ").append(getHostedZoneId()).append(","); if (getStartRecordName() != null) sb.append("StartRecordName: ").append(getStartRecordName()).append(","); if (getStartRecordType() != null) sb.append("StartRecordType: ").append(getStartRecordType()).append(","); if (getStartRecordIdentifier() != null) sb.append("StartRecordIdentifier: ").append(getStartRecordIdentifier()).append(","); if (getMaxItems() != null) sb.append("MaxItems: ").append(getMaxItems()); sb.append("}"); return sb.toString(); }
public Request<ListResourceRecordSetsRequest> marshall(ListResourceRecordSetsRequest listResourceRecordSetsRequest) { if (listResourceRecordSetsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<ListResourceRecordSetsRequest> request = new DefaultRequest<ListResourceRecordSetsRequest>(listResourceRecordSetsRequest, "AmazonRoute53"); request.setHttpMethod(HttpMethodName.GET); String uriResourcePath = "/2013-04-01/hostedzone/{Id}/rrset"; uriResourcePath = com.amazonaws.transform.PathMarshallers.NON_GREEDY.marshall(uriResourcePath, "Id", listResourceRecordSetsRequest.getHostedZoneId()); request.setResourcePath(uriResourcePath); if (listResourceRecordSetsRequest.getStartRecordName() != null) { request.addParameter("name", StringUtils.fromString(listResourceRecordSetsRequest.getStartRecordName())); } if (listResourceRecordSetsRequest.getStartRecordType() != null) { request.addParameter("type", StringUtils.fromString(listResourceRecordSetsRequest.getStartRecordType())); } if (listResourceRecordSetsRequest.getStartRecordIdentifier() != null) { request.addParameter("identifier", StringUtils.fromString(listResourceRecordSetsRequest.getStartRecordIdentifier())); } if (listResourceRecordSetsRequest.getMaxItems() != null) { request.addParameter("maxitems", StringUtils.fromString(listResourceRecordSetsRequest.getMaxItems())); } return request; }