gpt4 book ai didi

org.xbill.DNS.Zone类的使用及代码示例

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

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

Zone介绍

暂无

代码示例

代码示例来源:origin: tiandawu/IotXmpp

Zone zone = new Zone(origin, file);
long end = System.currentTimeMillis();
if (axfr) {
  Iterator it = zone.AXFR();
  while (it.hasNext()) {
    System.out.println(it.next());
  Iterator it = zone.iterator();
  while (it.hasNext()) {
    System.out.println(it.next());

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

/**
 * Adds a Record to the Zone.
 * @param r The record to be added
 * @see Record
 */
@Override public void addRecord(Record r) {
 if (records == null) {
  records = new ArrayList<Record>();
 }
 super.addRecord(r);
 records.add(r);
}

代码示例来源:origin: apache/james-project

@Override
  public SetResponse answer(InvocationOnMock invocation) throws Throwable {
    Object[] arguments = invocation.getArguments();
    LOG.info("Cache.lookupRecords {}, {}, {}", arguments[0], arguments[1], arguments[2]);
    assert arguments[0] instanceof Name;
    assert arguments[1] instanceof Integer;
    return zone.findRecords((Name) arguments[0], (Integer) arguments[1]);
  }
}

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

@Override
public void exec(Zone zone, Record record) throws IOException {
 if (zone == null) {
  LOG.error("Unable to remove record because zone is null: {}", record);
  return;
 }
 zone.removeRecord(record);
 LOG.info("Removed {}", record);
 if (isDNSSECEnabled()) {
  RRset rRset = zone.findExactMatch(record.getName(), Type.DS);
  if (rRset != null) {
   zone.removeRecord(rRset.first());
  }
 }
}

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

@Nonnull
public static Zone zone(@Nonnull Name name, @Nullable Record... records) {
  try {
    return new Zone(name, records != null ? records : new Record[0]);
  } catch (final IOException e) {
    throw new IllegalArgumentException("Could not create a zone from " + name + " and " + Arrays.toString(records) + ".", e);
  }
}

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

if (zone != null) {
 try (CloseableLock lock = writeLock.lock()) {
  zone.addRecord(record);
  LOG.info("Registered {}", record);
  if (isDNSSECEnabled()) {
   Date expiration = cal.getTime();
   RRset rRset =
     zone.findExactMatch(record.getName(), record.getType());
   try {
    DNSKEYRecord dnskeyRecord = dnsKeyRecs.get(zone.getOrigin());
    RRSIGRecord rrsigRecord =
      DNSSEC.sign(rRset, dnskeyRecord, privateKey,

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

Iterator<?> nsIterator = zone.getNS().rrs();
    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);
Iterator<?> it = zone.AXFR();

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

/**
 * Adds a Record to the Zone
 * @param r The record to be added
 * @see Record
 */
public void
addRecord(Record r) {
  Name name = r.getName();
  int rtype = r.getRRsetType();
  synchronized (this) {
    RRset rrset = findRRset(name, rtype);
    if (rrset == null) {
      rrset = new RRset(r);
      addRRset(name, rrset);
    } else {
      rrset.addRR(r);
    }
  }
}

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

return errorMessage(query, Rcode.REFUSED);
@SuppressWarnings("unchecked")
final Iterator<RRset> it = zone.AXFR();
try {
  final DataOutputStream dataOut = new DataOutputStream(s.getOutputStream());

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

final Zone zone = new Zone(zoneName, new Record[] {
    new SOARecord(zoneName, DClass.IN, DEFAULT_TTL, zoneName, Name.fromString("admin." + name), 1, DEFAULT_TTL, DEFAULT_TTL, DEFAULT_TTL, DEFAULT_TTL),
    new NSRecord(zoneName, DClass.IN, DEFAULT_TTL, Name.fromString("resolver1.opendns.com.")),
  switch (entry.type()) {
    case "A":
      zone.addRecord(new ARecord(recordName, DClass.value(entry.dclass()), DEFAULT_TTL, InetAddressUtils.addr(entry.data())));
      break;
    case "AAAA":
      zone.addRecord(new AAAARecord(recordName, DClass.value(entry.dclass()), DEFAULT_TTL, InetAddressUtils.addr(entry.data())));
      break;
    case "CNAME":
      zone.addRecord(new CNAMERecord(recordName, DClass.value(entry.dclass()), DEFAULT_TTL, Name.fromString(entry.data())));
      break;
    case "NS":
      zone.addRecord(new NSRecord(recordName, DClass.value(entry.dclass()), DEFAULT_TTL, Name.fromString(entry.data())));
      break;
    case "MX":
      m = s_mxPattern.matcher(entry.data());
      if (m.matches()) {
        zone.addRecord(new MXRecord(recordName, DClass.value(entry.dclass()), DEFAULT_TTL, Integer.valueOf(m.group(1)), Name.fromString(m.group(2))));
      } else {
        LOG.error("Entry data '{}' does not match MX pattern", entry.data());
      zone.addRecord(new PTRRecord(recordName, DClass.value(entry.dclass()), DEFAULT_TTL, Name.fromString(entry.data())));
      break;
    case "SOA":
      m = s_soaPattern.matcher(entry.data());
      if (m.matches()) {

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

Zone axfrZone = new Zone(this.secondaryZone.getZoneName(),records.toArray(new Record[records.size()]));
if(!axfrZone.getSOA().getName().equals(this.secondaryZone.getZoneName())){
  log.warn("Invalid AXFR zone name in response when updating secondary zone " + this.secondaryZone.getZoneName() + ". Got zone name " + axfrZone.getSOA().getName() + " in respons.");
if(this.secondaryZone.getZoneCopy() == null || this.secondaryZone.getZoneCopy().getSOA().getSerial() != axfrZone.getSOA().getSerial()){
}else{
  log.info("Zone " + this.secondaryZone.getZoneName() + " is already up to date with serial " + axfrZone.getSOA().getSerial());
  this.zoneProvider.zoneChecked(secondaryZone);

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

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

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

private final void
addSOA(Message response, Zone zone) {
  response.addRecord(zone.getSOA(), Section.AUTHORITY);
}

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

SetResponse sr = zone.findRecords(base.getName(), Type.ANY);
BitSet bitMap = new BitSet();
bitMap.set(Type.NXT);
return new NXTRecord(base.getName(), DClass.IN, zone.getSOA().getMinimum(),
  queryRecord.getName(), bitMap);

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

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

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

private RRset findExactMatch(Name name, int type, int dclass, boolean glue) {
  Zone zone = findBestZone(name);
  if (zone != null) {
    return zone.findExactMatch(name, type);
  }
  return null;
}

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

try (CloseableLock lock = readLock.lock()) {
 if (zone != null) {
  sr = zone.findRecords(name, type);
 } else {
  rcode = Rcode.NOTAUTH;
 if (sr.isCNAME()) {
  CNAMERecord cname = sr.getCNAME();
  RRset rrset = zone.findExactMatch(cname.getName(), Type.CNAME);
  addRRset(name, response, rrset, Section.ANSWER, flags);
  if (iterations == 0) {

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

SOARecord soaRecord = zone.getSOA();
Iterator<?> iterator = zone.iterator();
    this.records.add(new DBRecord(record, zone.getSOA().getName(), this.ttl));

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