Example usage for com.amazonaws.services.route53.model ResourceRecordSet getSetIdentifier

List of usage examples for com.amazonaws.services.route53.model ResourceRecordSet getSetIdentifier

Introduction

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

Prototype


public String getSetIdentifier() 

Source Link

Document

Resource record sets that have a routing policy other than simple: An identifier that differentiates among multiple resource record sets that have the same combination of name and type, such as multiple weighted resource record sets named acme.example.com that have a type of A.

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());
            }//from   w  ww  . ja  v a  2s. 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();
}