gpt4 book ai didi

org.xbill.DNS.Zone.getOrigin()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 06:52:49 30 4
gpt4 key购买 nike

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

Zone.getOrigin介绍

暂无

代码示例

代码示例来源:origin: OpenNMS/opennms

public void addZone(final Zone zone) {
  m_znames.put(zone.getOrigin(), zone);
}

代码示例来源:origin: org.echocat.jomon.net/common

public void addSecondaryZone(@Nonnull Zone zone) {
  _znames.put(zone.getOrigin(), zone);
}

代码示例来源:origin: org.echocat.jomon.net/common

public void addPrimaryZone(@Nonnull Zone zone) throws IOException {
  _znames.put(zone.getOrigin(), zone);
}

代码示例来源:origin: OpenNMS/opennms

public void addPrimaryZone(final String zname, final String zonefile) throws IOException {
  Name origin = null;
  if (zname != null)
    origin = Name.fromString(zname, Name.root);
  final Zone newzone = new Zone(origin, zonefile);
  m_znames.put(newzone.getOrigin(), newzone);
}

代码示例来源:origin: dnsjava/dnsjava

public void
addPrimaryZone(String zname, String zonefile) throws IOException {
  Name origin = null;
  if (zname != null)
    origin = Name.fromString(zname, Name.root);
  Zone newzone = new Zone(origin, zonefile);
  znames.put(newzone.getOrigin(), newzone);
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-registry

/**
 * Create the zones based on the zone count.
 *
 * @param conf        the Hadoop configuration.
 * @param subnetCount number of subnets to create reverse zones for.
 * @throws IOException if the DNSSEC key can not be read.
 */
@VisibleForTesting
protected void addSplitReverseZones(Configuration conf, int subnetCount)
  throws IOException {
 String subnet = conf.get(KEY_DNS_ZONE_SUBNET);
 String range = conf.get(KEY_DNS_SPLIT_REVERSE_ZONE_RANGE);
 // Add the split reverse zones
 for (int idx = 0; idx < subnetCount; idx++) {
  Name reverseLookupZoneName = getReverseZoneName(ReverseZoneUtils
    .getReverseZoneNetworkAddress(subnet, Integer.parseInt(range), idx));
  Zone reverseLookupZone = configureZone(reverseLookupZoneName, conf);
  zones.put(reverseLookupZone.getOrigin(), reverseLookupZone);
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-registry

Zone zone = new SecureableZone(Name.fromString(name),
  file.getAbsolutePath());
zones.putIfAbsent(zone.getOrigin(), zone);

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-registry

/**
 * Add the SOA record (describes the properties of the zone) to the authority
 * section of the response.
 *
 * @param response the response message.
 * @param zone     the DNS zone.
 */
private void addSOA(Message response, Zone zone, int flags) {
 RRset soa = zone.findExactMatch(zone.getOrigin(), Type.SOA);
 addRRset(soa.getName(), response, soa,
   Section.AUTHORITY, flags);
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-registry

/**
 * Initializes the registry based on available parameters in the hadoop
 * configuration.
 *
 * @param conf the hadoop configuration
 * @return the listener port
 * @throws IOException
 */
void initializeZones(Configuration conf) throws IOException {
 ttl = conf.getTimeDuration(KEY_DNS_TTL, 1L, TimeUnit.SECONDS);
 RecordCreatorFactory.setTtl(ttl);
 setDNSSECEnabled(conf);
 initializeZonesFromFiles(conf);
 Zone registryZone = configureZone(Name.fromString(domainName), conf);
 zones.put(registryZone.getOrigin(), registryZone);
 initializeReverseLookupZone(conf);
 StringBuilder builder = new StringBuilder();
 builder.append("DNS zones: ").append(System.lineSeparator());
 for (Map.Entry<Name, Zone> entry : zones.entrySet()) {
  builder.append(System.lineSeparator()).append(entry.getValue());
 }
 LOG.info(builder.toString());
}

代码示例来源:origin: org.jboss.resteasy/resteasy-eagledns-fork

log.debug("Got zone " + zone.getOrigin());
this.primaryZoneMap.put(zone.getOrigin(), new CachedPrimaryZone(zone, zoneProviderEntry.getValue()));

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-registry

/**
 * Sign a DNS record.
 *
 * @param zone   the zone reference
 * @param record the record to sign.
 * @throws DNSSEC.DNSSECException
 */
private void signSiteRecord(Zone zone, Record record)
  throws DNSSEC.DNSSECException {
 RRset rrset = zone.findExactMatch(record.getName(),
   record.getType());
 Calendar cal = Calendar.getInstance();
 Date inception = cal.getTime();
 cal.add(Calendar.YEAR, 1);
 Date expiration = cal.getTime();
 RRSIGRecord rrsigRecord =
   DNSSEC.sign(rrset, dnsKeyRecs.get(zone.getOrigin()),
     privateKey, inception, expiration);
 LOG.info("Adding {}", record);
 rrset.addRR(rrsigRecord);
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-registry

zone.findExactMatch(record.getName(), record.getType());
try {
 DNSKEYRecord dnskeyRecord = dnsKeyRecs.get(zone.getOrigin());
 RRSIGRecord rrsigRecord =
   DNSSEC.sign(rRset, dnskeyRecord, privateKey,

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-registry

/**
 * Initializes the reverse lookup zone (mapping IP to name).
 *
 * @param conf the Hadoop configuration.
 * @throws IOException if the DNSSEC key can not be read.
 */
private void initializeReverseLookupZone(Configuration conf)
  throws IOException {
 // Determine if the subnet should be split into
 // multiple reverse zones, this can be necessary in
 // network configurations where the hosts and containers
 // are part of the same subnet (i.e. the containers only use
 // part of the subnet).
 Boolean shouldSplitReverseZone = conf.getBoolean(KEY_DNS_SPLIT_REVERSE_ZONE,
   DEFAULT_DNS_SPLIT_REVERSE_ZONE);
 if (shouldSplitReverseZone) {
  int subnetCount = ReverseZoneUtils.getSubnetCountForReverseZones(conf);
  addSplitReverseZones(conf, subnetCount);
  // Single reverse zone
 } else {
  Name reverseLookupZoneName = getReverseZoneName(conf);
  if (reverseLookupZoneName == null) {
   // reverse lookup disabled
   return;
  }
  Zone reverseLookupZone = configureZone(reverseLookupZoneName, conf);
  zones.put(reverseLookupZone.getOrigin(), reverseLookupZone);
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-registry

Name zoneName = zone.getOrigin();
DNSKEYRecord dnskeyRecord = dnsKeyRecs.get(zoneName);
if (dnskeyRecord == null) {

代码示例来源:origin: org.jboss.resteasy/resteasy-eagledns-fork

log.warn("Unable to resolve hostname of nameserver " + record.getTarget() + " in zone " + zone.getOrigin() + " while processing AXFR request from " + s.getRemoteSocketAddress());
log.warn("AXFR request of zone " + zone.getOrigin() + " from " + s.getRemoteSocketAddress() + " refused!");
return errorMessage(query, Rcode.REFUSED);

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-registry

/**
 * Add a DS record associated with the input name.
 * @param zone  the zone.
 * @param name  the record name.
 * @param dClass the DNS class.
 * @param dsTtl the ttl value.
 * @param inception  the time of inception of the record.
 * @param expiration  the expiry time of the record.
 * @throws DNSSEC.DNSSECException if the addition of DS record fails.
 */
private void addDSRecord(Zone zone,
  Name name, int dClass, long dsTtl,
  Date inception,
  Date expiration) throws DNSSEC.DNSSECException {
 RRset rRset;
 RRSIGRecord rrsigRecord;
 DNSKEYRecord dnskeyRecord = dnsKeyRecs.get(zone.getOrigin());
 DSRecord dsRecord = new DSRecord(name, dClass,
   dsTtl, DSRecord.Digest.SHA1,
   dnskeyRecord);
 zone.addRecord(dsRecord);
 LOG.info("Adding {}", dsRecord);
 rRset = zone.findExactMatch(dsRecord.getName(), dsRecord.getType());
 rrsigRecord = DNSSEC.sign(rRset, dnskeyRecord, privateKey,
   inception, expiration);
 rRset.addRR(rrsigRecord);
}

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