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

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

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

Zone.create介绍

[英]Represent a zone when its #id() is its name.
[中]当#id()是一个区域的名称时,表示该区域。

代码示例

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

/**
 * Represent a zone when its {@link #id() id} is its name.
 *
 * @param name corresponds to {@link #name()} and {@link #id()}
 * @deprecated Use {@link #create(String, String, int, String)}. This will be removed in version
 * 5.
 */
@Deprecated
public static Zone create(String name) {
 return create(name, name);
}

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

MockZoneApi(Map<String, Collection<ResourceRecordSet<?>>> data) {
 this.data = data;
 put(Zone.create("denominator.io.", "denominator.io.", 86400, "nil@denominator.io."));
}

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

protected Zone build(JsonReader reader) throws IOException {
  String name = null, id = null, email = null;
  while (reader.hasNext()) {
   String nextName = reader.nextName();
   if (nextName.equals("id")) {
    id = reader.nextString();
   } else if (nextName.equals("name")) {
    name = reader.nextString();
   } else if (nextName.equals("emailAddress")) {
    email = reader.nextString();
   } else {
    reader.skipValue();
   }
  }
  return Zone.create(id, name, /* CloudDNS doesn't return ttl in the list api. */ 0, email);
 }
}

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

@Override
public Zone next() {
 Entry<String, Collection<ResourceRecordSet<?>>> next = delegate.next();
 String name = next.getKey();
 Iterator<ResourceRecordSet<?>> soas =
   filter(next.getValue().iterator(), nameAndTypeEqualTo(name, "SOA"));
 checkState(soas.hasNext(), "SOA record for zone %s was not present", name);
 ResourceRecordSet<SOAData> soa = (ResourceRecordSet<SOAData>) soas.next();
 SOAData soaData = soa.records().get(0);
 return Zone.create(name, name, soa.ttl(), soaData.rname());
}

代码示例来源: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());
}

相关文章