gpt4 book ai didi

denominator.model.Zone类的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 08:01:31 26 4
gpt4 key购买 nike

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

Zone介绍

[英]A zone is a delegated portion of DNS. We use the word zone instead of domain, as denominator focuses on configuration aspects of DNS.
[中]区域是DNS的委派部分。我们使用单词zone而不是domain,因为分母关注DNS的配置方面。

代码示例

代码示例来源: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-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

/**
  * @param id    nullable, corresponds to {@link #id()}
  * @param name  corresponds to {@link #name()}
  * @param ttl   corresponds to {@link #ttl()}
  * @param email corresponds to {@link #email()}
  */
 public static Zone create(String id, String name, int ttl, String email) {
  return new Zone(id, name, ttl, email);
 }
}

代码示例来源: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-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

private String updateZone(String id, Zone zone) {
 awaitComplete(api, api.updateDomain(id, zone.email(), zone.ttl()));
 return 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-model

@Override
public boolean apply(Zone in) {
 return in != null && name.equals(in.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-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

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-model

/**
 * Represent a zone with a fake email and a TTL of 86400.
 *
 * @param name corresponds to {@link #name()}
 * @param id   nullable, corresponds to {@link #id()}
 * @deprecated Use {@link #create(String, String, int, String)}. This will be removed in version
 * 5.
 */
@Deprecated
public static Zone create(String name, String id) {
 return new Zone(id, name, 86400, "nil@" + 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-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

@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);
 }
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com