Package com.dyn.client.v3.traffic

Examples of com.dyn.client.v3.traffic.DynTrafficApi


      checkNotNull(rdata.getTxtdata(), "rdata.txtdata cannot be null for SPFRecord: %s", record);
      return record;
   }

   private Record<SRVData> checkSRVRecord(Record<SRVData> record) {
      SRVData rdata = record.getRData();
      checkNotNull(rdata.getPriority(), "rdata.priority cannot be null for SRVRecord: %s", record);
      checkNotNull(rdata.getWeight(), "rdata.weight cannot be null for SRVRecord: %s", record);
      checkNotNull(rdata.getPort(), "rdata.port cannot be null for SRVRecord: %s", record);
      checkNotNull(rdata.getTarget(), "rdata.target cannot be null for SRVRecord: %s", record);
      return record;
   }
View Full Code Here


      checkNotNull(rdata.getTarget(), "rdata.target cannot be null for SRVRecord: %s", record);
      return record;
   }

   private Record<SSHFPData> checkSSHFPRecord(Record<SSHFPData> record) {
      SSHFPData rdata = record.getRData();
      checkNotNull(rdata.getAlgorithm(), "rdata.algorithm cannot be null for SSHFPRecord: %s", record);
      checkNotNull(rdata.getType(), "rdata.type cannot be null for SSHFPRecord: %s", record);
      checkNotNull(rdata.getFingerprint(), "rdata.fingerprint cannot be null for SSHFPRecord: %s", record);
      return record;
   }
View Full Code Here

      checkNotNull(rdata.getFingerprint(), "rdata.fingerprint cannot be null for SSHFPRecord: %s", record);
      return record;
   }

   private Record<TXTData> checkTXTRecord(Record<TXTData> record) {
      TXTData rdata = record.getRData();
      checkNotNull(rdata.getTxtdata(), "rdata.txtdata cannot be null for TXTRecord: %s", record);
      return record;
   }
View Full Code Here

   }

   @SuppressWarnings("unchecked")
   @Override
   public <R extends HttpRequest> R bindToRequest(R request, Object arg) {
      HttpRedirect in = HttpRedirect.class.cast(checkNotNull(arg, "redirect to create"));
      URI path = uriBuilder(request.getEndpoint()).build(in.getDelegate());
      return (R) request.toBuilder()
                        .endpoint(path)
                        .payload(json.toJson(ImmutableMap.of(
                            "code", in.getCode(), "keep_uri", in.getKeepUri(), "url", in.getUrl()))).build();
   }
View Full Code Here

   }

   @SuppressWarnings("unchecked")
   @Override
   public <R extends HttpRequest> R bindToRequest(R request, Object arg) {
      HttpRedirect in = HttpRedirect.class.cast(checkNotNull(arg, "redirect to create"));
      URI path = uriBuilder(request.getEndpoint()).build(in.getDelegate());
      return (R) request.toBuilder()
                        .endpoint(path)
                        .payload(json.toJson(ImmutableMap.of(
                            "code", in.getCode(), "keep_uri", in.getKeepUri(), "url", in.getUrl()))).build();
   }
View Full Code Here

      checkNotNull(zone.getFQDN(), "FQDN cannot be null for a Zone: %s", zone);
      checkNotNull(zone.getSerial(), "Serial cannot be null for a Zone: %s", zone);
   }

   private void getAndVerifyRedirect(String redirectName, int code, String keepUri, String url) {
      HttpRedirect redirect = api.getHttpRedirectApiForZone(fqdn).getHttpRedirect(redirectName);
      checkNotNull(redirect, "redirect was null for Zone: %s", fqdn);
      assertEquals(redirect.getFqdn(), redirectName);
      assertEquals(redirect.getCode(), code);
      assertEquals(redirect.getKeepUri(), keepUri);
      assertEquals(redirect.getUrl(), url);
   }
View Full Code Here

      Thread.sleep(3000); // FIXME - figure out delays
      getAndVerifyRedirect(redirectName, 302, "Y", "http://foo.com/");
      Job job = api().scheduleDelete(redirectName);
      assertEquals(job.getStatus(), Status.SUCCESS);
      assertEquals(api.getJob(job.getId()), job);
      HttpRedirect redirect = api.getHttpRedirectApiForZone(fqdn).getHttpRedirect(redirectName);
      checkState(redirect == null, "redirect was now null for Zone: %s", fqdn);
   }
View Full Code Here

   }

   @Test
   protected void testListAndGetRecords() {
      for (String zone : zoneApi().list()) {
         RecordApi api = api(zone);
         ImmutableList<RecordId> records = api.list().toList();
         getAnonymousLogger().info("zone: " + zone + " record count: " + records.size());

         for (RecordId recordId : records) {
            Record<? extends Map<String, Object>> record;
            if ("AAAA".equals(recordId.getType())) {
               record = checkAAAARecord(api.getAAAA(recordId.getFQDN(), recordId.getId()));
            } else if ("A".equals(recordId.getType())) {
               record = checkARecord(api.getA(recordId.getFQDN(), recordId.getId()));
            } else if ("CNAME".equals(recordId.getType())) {
               record = checkCNAMERecord(api.getCNAME(recordId.getFQDN(), recordId.getId()));
            } else if ("MX".equals(recordId.getType())) {
               record = checkMXRecord(api.getMX(recordId.getFQDN(), recordId.getId()));
            } else if ("NS".equals(recordId.getType())) {
               record = checkNSRecord(api.getNS(recordId.getFQDN(), recordId.getId()));
            } else if ("PTR".equals(recordId.getType())) {
               record = checkPTRRecord(api.getPTR(recordId.getFQDN(), recordId.getId()));
            } else if ("SOA".equals(recordId.getType())) {
               record = checkSOARecord(api.getSOA(recordId.getFQDN(), recordId.getId()));
            } else if ("SPF".equals(recordId.getType())) {
               record = checkSPFRecord(api.getSPF(recordId.getFQDN(), recordId.getId()));
            } else if ("SRV".equals(recordId.getType())) {
               record = checkSRVRecord(api.getSRV(recordId.getFQDN(), recordId.getId()));
            } else if ("SSHFP".equals(recordId.getType())) {
               record = checkSSHFPRecord(api.getSSHFP(recordId.getFQDN(), recordId.getId()));
            } else if ("TXT".equals(recordId.getType())) {
               record = checkTXTRecord(api.getTXT(recordId.getFQDN(), recordId.getId()));
            } else {
               record = api.get(recordId);
            }
            assertEquals(record, recordId);
            checkRecord(record);
         }
      }
View Full Code Here

   // TODO: currently our parsing of annotations on expected() ignores
   // @Transform
   @Override
   protected Function<HttpResponse, FluentIterable<String>> parser(Injector i) {
      return compose(new ExtractLastPathComponent(), super.parser(i));
   }
View Full Code Here

   // TODO: currently our parsing of annotations on expected() ignores
   // @Transform
   @Override
   protected Function<HttpResponse, FluentIterable<String>> parser(Injector i) {
      return compose(new ExtractLastPathComponent(), super.parser(i));
   }
View Full Code Here

TOP

Related Classes of com.dyn.client.v3.traffic.DynTrafficApi

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.