Package com.amazonaws.services.route53.infima.util

Examples of com.amazonaws.services.route53.infima.util.AnswerSet


  public List<String> listZone(final String source) {

    final List<String> nameList = new LinkedList<String>();

    final HostedZone zone = findZone(source);

    if (zone == null) {
      return nameList;
    }

    final ListResourceRecordSetsRequest request = new ListResourceRecordSetsRequest();

    request.setHostedZoneId(zone.getId());

    while (true) {

      final ListResourceRecordSetsResult result = amazonClient
          .listResourceRecordSets(request);
View Full Code Here


  }

  public void ensureCNAME(final String source, final String target)
      throws Exception {

    final HostedZone zone = findZone(source);

    Util.assertNotNull(zone, "missing zone for " + source);

    final String zoneId = zone.getId();

    final boolean isPresent;
    final ResourceRecordSet recordOld;
    {
      final ResourceRecordSet recordFound = findRecord(zoneId, source);
      if (recordFound == null) {
        isPresent = false;
        recordOld = makeRecordCNAME(source, target);
      } else {
        isPresent = true;
        recordOld = recordFound;
      }
    }

    final ResourceRecordSet recordNew = makeRecordCNAME(source, target);

    recordNew.setTTL(recordOld.getTTL());

    //

    final Collection<Change> changeList = new LinkedList<Change>();
    if (isPresent) {
      changeList.add(new Change(ChangeAction.DELETE, recordOld));
      changeList.add(new Change(ChangeAction.CREATE, recordNew));
    } else {
      changeList.add(new Change(ChangeAction.CREATE, recordNew));
    }

    final ChangeBatch changeRequest = new ChangeBatch();
    changeRequest.setComment("updated : " + new Date());
    changeRequest.setChanges(changeList);

    final ChangeResourceRecordSetsRequest request = new ChangeResourceRecordSetsRequest();
    request.setHostedZoneId(zone.getId());
    request.setChangeBatch(changeRequest);

    final ChangeResourceRecordSetsResult result = amazonClient
        .changeResourceRecordSets(request);
View Full Code Here

        // marshaller understands.
        String errorCode = parseErrorCode(node);
        if (errorCode == null || !errorCode.equals("HostedZoneAlreadyExists"))
            return null;

        HostedZoneAlreadyExistsException e = (HostedZoneAlreadyExistsException)super.unmarshall(node);
       
        return e;
    }
View Full Code Here

        // marshaller understands.
        String errorCode = parseErrorCode(node);
        if (errorCode == null || !errorCode.equals("HostedZoneAlreadyExists"))
            return null;

        HostedZoneAlreadyExistsException e = (HostedZoneAlreadyExistsException)super.unmarshall(node);
       
        return e;
    }
View Full Code Here

        // marshaller understands.
        String errorCode = parseErrorCode(node);
        if (errorCode == null || !errorCode.equals("HostedZoneAlreadyExists"))
            return null;

        HostedZoneAlreadyExistsException e = (HostedZoneAlreadyExistsException)super.unmarshall(node);
       
        return e;
    }
View Full Code Here

        // marshaller understands.
        String errorCode = parseErrorCode(node);
        if (errorCode == null || !errorCode.equals("HostedZoneNotEmpty"))
            return null;

        HostedZoneNotEmptyException e = (HostedZoneNotEmptyException)super.unmarshall(node);
       
        return e;
    }
View Full Code Here

        // marshaller understands.
        String errorCode = parseErrorCode(node);
        if (errorCode == null || !errorCode.equals("HostedZoneNotEmpty"))
            return null;

        HostedZoneNotEmptyException e = (HostedZoneNotEmptyException)super.unmarshall(node);
       
        return e;
    }
View Full Code Here

        // marshaller understands.
        String errorCode = parseErrorCode(node);
        if (errorCode == null || !errorCode.equals("InvalidArgument"))
            return null;

        InvalidArgumentException e = (InvalidArgumentException)super.unmarshall(node);
       
        return e;
    }
View Full Code Here

        // marshaller understands.
        String errorCode = parseErrorCode(node);
        if (errorCode == null || !errorCode.equals("InvalidChangeBatch"))
            return null;

        InvalidChangeBatchException e = (InvalidChangeBatchException)super.unmarshall(node);
       
        return e;
    }
View Full Code Here

        // marshaller understands.
        String errorCode = parseErrorCode(node);
        if (errorCode == null || !errorCode.equals("InvalidChangeBatch"))
            return null;

        InvalidChangeBatchException e = (InvalidChangeBatchException)super.unmarshall(node);
       
        return e;
    }
View Full Code Here

TOP

Related Classes of com.amazonaws.services.route53.infima.util.AnswerSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.