Example usage for com.amazonaws.services.route53.model ListHostedZonesByNameRequest ListHostedZonesByNameRequest

List of usage examples for com.amazonaws.services.route53.model ListHostedZonesByNameRequest ListHostedZonesByNameRequest

Introduction

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

Prototype

ListHostedZonesByNameRequest

Source Link

Usage

From source file:io.kodokojo.service.aws.Route53DnsManager.java

License:Open Source License

private HostedZone getHostedZone() {
    ListHostedZonesByNameRequest listHostedZonesByNameRequest = new ListHostedZonesByNameRequest();
    listHostedZonesByNameRequest.setDNSName(domainName);
    ListHostedZonesByNameResult result = client.listHostedZonesByName(listHostedZonesByNameRequest);

    Iterator<HostedZone> iterator = result.getHostedZones().iterator();
    HostedZone hostedZone = null;//from w ww. j  a  v a  2 s .  c  o m
    while (hostedZone == null && iterator.hasNext()) {
        HostedZone currentZone = iterator.next();
        hostedZone = currentZone.getName().equals(domainName) ? currentZone : null;
    }
    return hostedZone;
}