Package org.platformlayer.service.dns.model

Examples of org.platformlayer.service.dns.model.DnsServer


  }

  @Override
  public void beforeCreateItem(ItemBase item) throws OpsException {
    if (item instanceof DnsServer) {
      DnsServer model = (DnsServer) item;

      model.dnsName = normalize(model.dnsName);
      if (Strings.isNullOrEmpty(model.dnsName)) {
        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

TOP

Related Classes of org.platformlayer.service.dns.model.DnsServer

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.