denominator.model.Zone.name()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(84)

本文整理了Java中denominator.model.Zone.name()方法的一些代码示例,展示了Zone.name()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Zone.name()方法的具体详情如下:
包路径:denominator.model.Zone
类名称:Zone
方法名:name

Zone.name介绍

[英]The origin or starting point for the zone in the DNS tree. Usually includes a trailing dot, ex. " netflix.com."

The name of a zone cannot be changed.
[中]DNS树中区域的原点或起点。通常包括一个尾随的点,例如“netflix.com”
无法更改区域的名称。

代码示例

代码示例来源:origin: com.netflix.denominator/denominator-model

@Override
public boolean apply(Zone in) {
 return in != null && name.equals(in.name());
}

代码示例来源:origin: com.netflix.denominator/denominator-model

@Override
public String toString() {
 StringBuilder builder = new StringBuilder();
 builder.append("Zone [");
 if (!name().equals(id())) {
  builder.append("id=").append(id()).append(", ");
 }
 builder.append("name=").append(name());
 builder.append(", ").append("ttl=").append(ttl());
 builder.append(", ").append("email=").append(email());
 builder.append("]");
 return builder.toString();
}

代码示例来源:origin: com.netflix.denominator/denominator-model

/**
 * @deprecated only use {@link #id()} when performing operations against a zone. This will be
 * removed in version 5.
 */
@Deprecated
public String idOrName() {
 return id() != null ? id() : name();
}

代码示例来源:origin: com.netflix.denominator/denominator-model

@Override
public int hashCode() {
 int result = 17;
 result = 31 * result + (id() != null ? id().hashCode() : 0);
 result = 31 * result + name().hashCode();
 result = 31 * result + ttl();
 result = 31 * result + email().hashCode();
 return result;
}

代码示例来源:origin: com.netflix.denominator/denominator-model

@Override
public boolean equals(Object obj) {
 if (obj instanceof Zone) {
  Zone other = (Zone) obj;
  return equal(id(), other.id())
      && name().equals(other.name())
      && ttl() == other.ttl()
      && email().equals(other.email());
 }
 return false;
}

代码示例来源:origin: com.netflix.denominator/denominator-clouddns

/**
 * CloudDNS doesn't expose the domain's ttl in the list api.
 */
private Zone zipWithSOA(Zone next) {
 Record soa = api.recordsByNameAndType(Integer.parseInt(next.id()), next.name(), "SOA").get(0);
 return Zone.create(next.id(), next.name(), soa.ttl, next.email());
}

代码示例来源:origin: com.netflix.denominator/denominator-core

@Override
public String put(Zone zone) {
 if (!data.containsKey(zone.name())) {
  Collection<ResourceRecordSet<?>>
    recordsInZone =
    new ConcurrentSkipListSet<ResourceRecordSet<?>>(TO_STRING);
  SOAData soaData = SOAData.builder().mname("ns1." + zone.name()).rname(zone.email())
    .serial(1).refresh(3600).retry(600).expire(604800).minimum(86400).build();
  recordsInZone.add(ResourceRecordSet.builder()
             .type("SOA")
             .name(zone.name())
             .ttl(zone.ttl())
             .add(soaData)
             .build());
  recordsInZone.add(ns(zone.name(), zone.ttl(), asList("ns1." + zone.name())));
  data.put(zone.name(), recordsInZone);
  return zone.name();
 for (Iterator<ResourceRecordSet<?>> i = data.get(zone.name()).iterator(); i.hasNext();) {
  ResourceRecordSet<?> rrset = i.next();
  if (rrset.type().equals("SOA")) {
   SOAData soaData = (SOAData) rrset.records().get(0);
   if (zone.email().equals(soaData.rname()) && zone.ttl() == rrset.ttl().intValue()) {
    return zone.name();
   data.get(zone.name()).add(soa(rrset, zone.email(), zone.ttl()));
 return zone.name();

代码示例来源:origin: com.netflix.denominator/denominator-clouddns

@Override
public String put(Zone zone) {
 if (zone.id() != null) {
  return updateZone(zone.id(), zone);
 }
 try {
  return awaitComplete(api, api.createDomain(zone.name(), zone.email(), zone.ttl()));
 } catch (IllegalStateException e) {
  if (e.getMessage().indexOf("already exists") == -1) {
   throw e;
  }
  String id = api.domainsByName(zone.name()).get(0).id();
  return updateZone(id, zone);
 }
}

相关文章