Package org.platformlayer.dns.model

Examples of org.platformlayer.dns.model.DnsRecord


    Machine machine = instanceHelpers.getMachine(nginxService);

    String address = machine.getNetworkPoint().getBestAddress(NetworkPoint.forPublicInternet());

    DnsRecord record = new DnsRecord();
    record.setDnsName(nginxFrontend.hostname);
    record.getAddress().add(address);

    Tag parentTag = Tag.buildParentTag(nginxFrontend.getKey());
    record.getTags().add(parentTag);
    Tag uniqueTag = UniqueTag.build(nginxService, nginxFrontend);
    record.getTags().add(uniqueTag);

    record.key = PlatformLayerKey.fromId(nginxFrontend.hostname);

    return record;
  }
View Full Code Here


        throw new IllegalArgumentException("dnsName must be specified");
      }
    }

    if (item instanceof DnsRecord) {
      DnsRecord model = (DnsRecord) item;

      model.dnsName = normalize(model.dnsName);
      if (Strings.isNullOrEmpty(model.dnsName)) {
        throw new IllegalArgumentException("dnsName must be specified");
      }

      if (Strings.isNullOrEmpty(model.recordType)) {
        model.recordType = "A";
      }

      if (model.recordType.equals("A")) {
        // OK
      } else {
        throw new IllegalArgumentException("Record type not supported: " + model.recordType);
      }
    }

    if (item instanceof DnsZone) {
      DnsZone model = (DnsZone) item;

      model.dnsName = normalize(model.dnsName);
      if (Strings.isNullOrEmpty(model.dnsName)) {
        model.dnsName = normalize(model.getId());
      }
    }

    super.beforeCreateItem(item);
  }
View Full Code Here

        // int column = event.getColumn();
        // if (column == 2) {
        // // Ignore the jobs column
        // return;
        // }
        DnsRecord domainName = event.getValue();
        if (domainName == null) {
          return;
        }

        onRowClick(domainName);
View Full Code Here

      List<EndpointInfo> endpoints = EndpointInfo.findEndpoints(endpoint.getTags(), destinationPort);
      if (endpoints.isEmpty()) {
        throw new OpsException("Cannot find endpoint for port: " + destinationPort);
      }

      DnsRecord record = new DnsRecord();
      record.setDnsName(dnsName);
      for (EndpointInfo endpointInfo : endpoints) {
        record.getAddress().add(endpointInfo.publicIp);
      }

      record.getTags().add(parentTag);
      record.setKey(PlatformLayerKey.fromId(dnsName));
      // endpoint.getId();
      // UniqueKey.build(endpoint, "dns").key;

      try {
        platformLayerClient.putItemByTag((ItemBase) record, parentTag);
View Full Code Here

TOP

Related Classes of org.platformlayer.dns.model.DnsRecord

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.