Example usage for com.amazonaws.services.route53.model ListHostedZonesResult getNextMarker

List of usage examples for com.amazonaws.services.route53.model ListHostedZonesResult getNextMarker

Introduction

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

Prototype


public String getNextMarker() 

Source Link

Document

If IsTruncated is true, the value of NextMarker identifies the first hosted zone in the next group of hosted zones.

Usage

From source file:com.github.blacklocus.rdsecho.utl.Route53Find.java

License:Open Source License

public Iterable<HostedZone> hostedZones(final Predicate<HostedZone> predicate) {
    return new PagingIterable<HostedZone>(new Supplier<Iterable<HostedZone>>() {

        String nextMarker = null;
        boolean isTruncated = true;

        @Override/*from w  w  w .j  a  v a2s  .  co m*/
        public Iterable<HostedZone> get() {
            if (isTruncated) {
                ListHostedZonesRequest request = new ListHostedZonesRequest().withMarker(nextMarker);
                ListHostedZonesResult result = route53.listHostedZones();
                nextMarker = result.getNextMarker();
                isTruncated = result.isTruncated();
                return Iterables.filter(result.getHostedZones(), predicate);

            } else {
                return Collections.emptyList();
            }
        }
    });
}

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

License:Apache License

@Override
public String marshall(MarshallStruct<ListHostedZonesResult> input, HttpServletResponse resp) throws Exception {
    logger.debug("Marshalling the result into xml.");
    ListHostedZonesResult result = input.getMainObject();
    XMLNode response = new XMLNode(DNS53Constants.LISTHOSTEDZONESRESPONSE);
    response.addAttr(DNS53Constants.XMLNS, DNS53Constants.XMLNS_VALUE);
    if (result.getHostedZones() != null && result.getHostedZones().size() > 0) {
        XMLNode hzs = QueryUtil.addNode(response, DNS53Constants.HOSTEDZONES);
        for (HostedZone hostedZone : result.getHostedZones()) {
            DNS53QueryUtil.marshallHostedZone(hostedZone, hzs);
        }/*from  w w  w. ja  v a2  s  . c  om*/
    }
    QueryUtil.addNode(response, DNS53Constants.MARKER, result.getMarker());
    QueryUtil.addNode(response, DNS53Constants.ISTRUNCATED, result.getIsTruncated());
    QueryUtil.addNode(response, DNS53Constants.NEXTMARKER, result.getNextMarker());
    QueryUtil.addNode(response, DNS53Constants.MAXITEMS, result.getMaxItems());
    logger.debug("Returning the response xml to AbstractHeaderAction.");
    return response.toString();
}