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

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

Introduction

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

Prototype


public String getMaxItems() 

Source Link

Document

The maximum number of records you requested.

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  av  a2 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();
}