Example usage for com.amazonaws.services.route53.model ListResourceRecordSetsResult getNextRecordIdentifier

List of usage examples for com.amazonaws.services.route53.model ListResourceRecordSetsResult getNextRecordIdentifier

Introduction

In this page you can find the example usage for com.amazonaws.services.route53.model ListResourceRecordSetsResult getNextRecordIdentifier.

Prototype


public String getNextRecordIdentifier() 

Source Link

Document

Resource record sets that have a routing policy other than simple: If results were truncated for a given DNS name and type, the value of SetIdentifier for the next resource record set that has the current DNS name and type.

Usage

From source file:com.msi.dns53.server.query.ListResourceRecordSets.java

License:Apache License

@Override
public String marshall(MarshallStruct<ListResourceRecordSetsResult> input, HttpServletResponse resp)
        throws Exception {
    ListResourceRecordSetsResult result = input.getMainObject();

    XMLNode response = new XMLNode(DNS53Constants.LISTRESOURCERECORDSETSRESPONSE);
    response.addAttr(DNS53Constants.XMLNS, DNS53Constants.XMLNS_VALUE);
    if (result.getResourceRecordSets() != null) {
        XMLNode rrSet = QueryUtil.addNode(response, DNS53Constants.RESOURCERECORDSETS);
        for (ResourceRecordSet rrs : result.getResourceRecordSets()) {
            XMLNode rr = QueryUtil.addNode(rrSet, DNS53Constants.RESOURCERECORDSET);
            QueryUtil.addNode(rr, DNS53Constants.NAME, rrs.getName());
            QueryUtil.addNode(rr, DNS53Constants.TYPE, rrs.getType());
            QueryUtil.addNode(rr, DNS53Constants.TTL, rrs.getTTL());
            if (rrs.getSetIdentifier() != null) {
                QueryUtil.addNode(rr, DNS53Constants.SETIDENTIFIER, rrs.getSetIdentifier());
            }//  ww w.  j a  va2  s . c  o  m
            if (rrs.getWeight() != null && rrs.getWeight() != -1) {
                QueryUtil.addNode(rr, DNS53Constants.WEIGHT, rrs.getWeight());
            }
            if (rrs.getResourceRecords() != null && rrs.getResourceRecords().size() > 0) {
                XMLNode records = QueryUtil.addNode(rr, DNS53Constants.RESOURCERECORDS);
                for (ResourceRecord record : rrs.getResourceRecords()) {
                    XMLNode r = QueryUtil.addNode(records, DNS53Constants.RESOURCERECORD);
                    QueryUtil.addNode(r, DNS53Constants.VALUE, record.getValue());
                }
            }
        }
    }
    QueryUtil.addNode(response, DNS53Constants.ISTRUNCATED, result.getIsTruncated());
    QueryUtil.addNode(response, DNS53Constants.MAXITEMS, result.getMaxItems());
    if (result.getIsTruncated() && result.getNextRecordName() != null) {
        QueryUtil.addNode(response, DNS53Constants.NEXTRECORDNAME, result.getNextRecordName());
    }
    if (result.getIsTruncated() && result.getNextRecordType() != null) {
        QueryUtil.addNode(response, DNS53Constants.NEXTRECORDTYPE, result.getNextRecordType());
    }
    if (result.getIsTruncated() && result.getNextRecordIdentifier() != null) {
        QueryUtil.addNode(response, DNS53Constants.NEXTRECORDIDENTIFIER, result.getNextRecordIdentifier());
    }
    return response.toString();
}