}
public List<ResourceRecordSet> getResourceRecords(String awsZoneId) {
List<ResourceRecordSet> resourceRecords = Lists.newArrayList();
ListResourceRecordSetsResult previous = null;
while (true) {
ListResourceRecordSetsRequest request = new ListResourceRecordSetsRequest(awsZoneId);
if (previous != null) {
request.setStartRecordIdentifier(previous.getNextRecordIdentifier());
request.setStartRecordName(previous.getNextRecordName());
request.setStartRecordType(previous.getNextRecordType());
}
ListResourceRecordSetsResult response = restClient.listResourceRecordSets(request);
for (ResourceRecordSet resourceRecordSet : response.getResourceRecordSets()) {
resourceRecords.add(resourceRecordSet);
}
if (!Objects.equal(response.isTruncated(), Boolean.TRUE)) {
break;
}
previous = response;
}
return resourceRecords;