Package org.jclouds.dynect.v3.domain

Examples of org.jclouds.dynect.v3.domain.Record$Builder


  
   static List<UpdateRecord> toUpdateRecordList(Map<String, Record> idsToRecords) {
      List<UpdateRecord> updateRecords = Lists.newArrayList();

      for (String recordId: idsToRecords.keySet()) {
         Record record = idsToRecords.get(recordId);
        
         UpdateRecord updateRecord = new UpdateRecord();
         updateRecord.id = recordId;
         updateRecord.name = record.getName();
         updateRecord.ttl = record.getTTL().isPresent() ? record.getTTL().get() : null;
         updateRecord.data = record.getData();
         updateRecord.priority = record.getPriority();
         updateRecord.comment = record.getComment();
        
         updateRecords.add(updateRecord);
      }
     
      return updateRecords;
View Full Code Here


      domainId = domain.getId();
   }  

   @Test(dependsOnMethods = "testCreateDomain")
   public void testCreateRecords() throws Exception {
      Record createMXRecord = Record.builder()
            .type("MX")
            .name(JCLOUDS_EXAMPLE)
            .data("mail." + JCLOUDS_EXAMPLE)
            .comment("MX Record")
            .priority(11235)
            .build();
     
      Record createARecord = Record.builder()
            .type("A")
            .name(JCLOUDS_EXAMPLE)
            .data("10.0.0.1")
            .build();
     
      Record createSRVRecord = Record.builder()
            .type("SRV")
            .name("_sip._tcp." + JCLOUDS_EXAMPLE)
            .ttl(86400)
            .data("1 3443 sip." + JCLOUDS_EXAMPLE) // weight port target
            .priority(11235)
View Full Code Here

      assertTrue(record.getUpdated().before(now));
   }

   @Test(dependsOnMethods = "testGetRecord")
   public void testUpdateRecord() throws Exception {     
      Record record = Record.builder()
            .name("_sip._udp." + JCLOUDS_EXAMPLE)
            .ttl(86401)
            .data("1 3444 sip." + JCLOUDS_EXAMPLE) // weight port target
            .priority(12358)
            .comment("Updated Protocol to UDP")
View Full Code Here

   }

   private void createDomains() throws TimeoutException {
      System.out.format("Create Domains%n");

      Record createMXRecord = Record.builder()
            .name(NAME)
            .type("MX")
            .data("mail." + NAME)
            .priority(11235)
            .build();

      Record createARecord = Record.builder()
            .name(NAME)
            .type("A")
            .data("10.0.0.1")
            .build();
View Full Code Here

   }

   private RecordDetail createReverseDNSRecords(NodeMetadata node) throws TimeoutException {
      System.out.format("Create Reverse DNS Records%n");

      Record createPTRRecordIPv4 = Record.builder()
            .name(NAME)
            .type("PTR")
            .data(node.getPublicAddresses().iterator().next())
            .ttl(11235)
            .build();
View Full Code Here

   }

   private void updateReverseDNSRecords(NodeMetadata node, RecordDetail recordDetail) throws TimeoutException {
      System.out.format("Update Reverse DNS Records%n");

      Record updatePTRRecord = recordDetail.getRecord().toBuilder().comment("Hello Cloud DNS").build();
      Map<String, Record> idsToRecords = ImmutableMap.of(recordDetail.getId(), updatePTRRecord);

      awaitComplete(dnsApi, reverseDNSApi.update(node.getUri(), idsToRecords));

      System.out.format("  %s%n", reverseDNSApi.get(node.getUri(), recordDetail.getId()));
View Full Code Here

   private void updateRecord(Domain domain) throws TimeoutException {
      System.out.format("Update Record%n");

      RecordDetail recordDetail = dnsApi.getRecordApiForDomain(domain.getId()).getByNameAndTypeAndData(NAME, "A", "10.0.0.1");
      Record updateRecord = recordDetail.getRecord().toBuilder().data("10.0.1.0").build();

      awaitComplete(dnsApi, dnsApi.getRecordApiForDomain(domain.getId()).update(recordDetail.getId(), updateRecord));

      System.out.format("  %s%n", dnsApi.getRecordApiForDomain(domain.getId()).get(recordDetail.getId()));
   }
View Full Code Here

         if (domain.getName().equals(ALT_NAME)) {
            domainId = domain.getId();
         }
      }

      Record createTXTRecord = Record.builder()
            .name(ALT_NAME)
            .type("TXT")
            .data("This is a TXT record")
            .build();

      Record createARecord = Record.builder()
            .name(ALT_NAME)
            .type("A")
            .data("10.0.0.2")
            .build();
View Full Code Here

   static List<UpdateRecord> toUpdateRecordList(Map<String, Record> idsToRecords) {
      List<UpdateRecord> updateRecords = Lists.newArrayList();

      for (Map.Entry<String, Record> entry : idsToRecords.entrySet()) {
         String recordId = entry.getKey();
         Record record = entry.getValue();
        
         UpdateRecord updateRecord = new UpdateRecord();
         updateRecord.id = recordId;
         updateRecord.name = record.getName();
         updateRecord.ttl = record.getTTL().isPresent() ? record.getTTL().get() : null;
         updateRecord.data = record.getData();
         updateRecord.priority = record.getPriority();
         updateRecord.comment = record.getComment();
        
         updateRecords.add(updateRecord);
      }
     
      return updateRecords;
View Full Code Here

               .endpoint(endpoint)
               .build(),
            HttpResponse.builder().statusCode(OK.getStatusCode()).payload(payloadFromResource("/record-create-response.json")).build())
            .getRecordApi(3650908);

      Record createMXRecord = Record.builder()
            .type("MX")
            .name(JCLOUDS_EXAMPLE)
            .data("mail." + JCLOUDS_EXAMPLE)
            .comment("MX Record")
            .priority(11235)
            .build();
     
      Record createARecord = Record.builder()
            .type("A")
            .name(JCLOUDS_EXAMPLE)
            .data("10.0.0.1")
            .build();
     
View Full Code Here

TOP

Related Classes of org.jclouds.dynect.v3.domain.Record$Builder

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.