Пример #1
0
  private Domain getDomain() {
    for (Domain domain : dnsApi.getDomainApi().list().concat()) {
      if (domain.getName().startsWith(ALT_NAME)) {
        return domain;
      }
    }

    throw new RuntimeException(ALT_NAME + " not found. Run CreateDomains example first.");
  }
Пример #2
0
  private void deleteRecords(Domain domain) throws TimeoutException {
    System.out.format("Delete Records%n");

    Set<RecordDetail> recordDetails =
        dnsApi.getRecordApiForDomain(domain.getId()).listByType("TXT").concat().toSet();
    Iterable<String> recordIds = Iterables.transform(recordDetails, GET_RECORD_ID);

    awaitComplete(dnsApi, dnsApi.getRecordApiForDomain(domain.getId()).delete(recordIds));

    System.out.format("  Deleted %s records", Iterables.size(recordDetails));
  }
Пример #3
0
  private void updateDomain() throws TimeoutException {
    System.out.format("Update Domain%n");

    int domainId = 0;

    Iterable<Domain> domains = dnsApi.getDomainApi().list().concat();

    for (Domain domain : domains) {
      if (domain.getName().equals(ALT_NAME)) {
        domainId = domain.getId();
      }
    }

    UpdateDomain updateDomain =
        UpdateDomain.builder()
            .email("jcloudie@" + ALT_NAME)
            .ttl(600001)
            .comment("Hello Domain Update")
            .build();

    awaitComplete(dnsApi, dnsApi.getDomainApi().update(domainId, updateDomain));

    System.out.format("  %s%n", dnsApi.getDomainApi().get(domainId));
  }
Пример #4
0
 public String apply(Domain domain) {
   return domain.getName();
 }