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

x33g5p2x  于2022-01-23 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(172)

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

Lookup.setCache介绍

暂无

代码示例

代码示例来源:origin: JZ-Darkal/AndroidHttpCapture

lookup.setCache(cache);

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

@Nonnull
protected Lookup createLookupFor(@Nonnull String query, @Nonnegative int type) {
  final Lookup lookup;
  try {
    lookup = new Lookup(query, type);
  } catch (final TextParseException e) {
    throw new IllegalArgumentException("Could not parse query: " + query, e);
  }
  final Resolver resolver = _resolver;
  lookup.setResolver(resolver != null ? resolver : getDefaultResolver());
  lookup.setCache(null);
  return lookup;
}

代码示例来源:origin: com.helger/ph-httpclient

@Nonnull
protected Lookup createLookup (@Nonnull final String sHost) throws TextParseException
{
 final Lookup aDNSLookup = new Lookup (sHost, Type.ANY);
 try
 {
  aDNSLookup.setResolver (new SimpleResolver ());
 }
 catch (final UnknownHostException ex)
 {
  // Shit happens - no special resolver needed
 }
 // No cache!
 aDNSLookup.setCache (null);
 return aDNSLookup;
}

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

private static boolean resolve(final Name name,
                  final Resolver resolver,
                  final int type) {
    final Lookup lookup = new Lookup(name, type);
    // NMS-9238: Do not use a cache when looking up the record,
    // that kind of defeats the purpose of this monitor :)
    lookup.setCache(null);
    lookup.setResolver(resolver);

    final Record[] records = lookup.run();

    if (records == null) {
      return false;
    }

    return Arrays.stream(records)
           .filter(r -> r.getType() == type)
           .count() > 0;
  }
}

代码示例来源:origin: sir-barchable/barchomat

public List<InetAddress> getAllAddresses(String hostName) throws UnknownHostException {
    Lookup lookup;
    try {
      lookup = new Lookup(hostName, Type.A);
      lookup.setCache(null);
      lookup.setResolver(new SimpleResolver(server));
    } catch (TextParseException e) {
      throw new UnknownHostException(hostName);
    }

    List<InetAddress> addresses = new ArrayList<>();

    Record[] a = lookup.run();
    if (a == null || a.length == 0) {
      throw new UnknownHostException(hostName);
    }

    for (Record record : a) {
      addresses.add(((ARecord) record).getAddress());
    }

    return addresses;
  }
}

代码示例来源:origin: net.lightbody.bmp/browsermob-core

lookup.setCache(cache);

代码示例来源:origin: misakuo/Dream-Catcher

lookup.setCache(cache);

代码示例来源:origin: org.nhind/agent

lu.setCache(new Cache(DClass.IN));

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_http

try {
  Lookup lookup = new Lookup(host, Type.A);
  lookup.setCache(lookupCache);
  if (timeoutMs > 0) {
    resolver.setTimeout(timeoutMs / 1000, timeoutMs % 1000);

代码示例来源:origin: org.apache.james/james-server-dnsservice-dnsjava

l.setCache(cache);
l.setResolver(resolver);
l.setCredibility(dnsCredibility);

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

l.setCache(cache);
l.setResolver(resolver);
l.setCredibility(dnsCredibility);

相关文章