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

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

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

Lookup.getDefaultResolver介绍

暂无

代码示例

代码示例来源:origin: org.apache.james.jspf/apache-jspf-resolver

/**
 * Default Constructor.
 * Uses the DNSJava static DefaultResolver
 */
public DNSServiceXBillImpl(Logger logger) {
  this(logger, Lookup.getDefaultResolver());
}

代码示例来源:origin: org.apache.james.jdkim/apache-jdkim-library

public DNSPublicKeyRecordRetriever() {
  this(Lookup.getDefaultResolver());
}

代码示例来源:origin: org.mobicents.javax.sip/mobicents-jain-sip-ext

@Override
public void setDNSTimeout(int timeout) {
  Lookup.getDefaultResolver().setTimeout(timeout);
  Lookup.getDefaultResolver().setTimeout(timeout, 0);
  dnsTimeout = timeout;
  if(logger.isInfoEnabled()) {
    logger.info("DefaultDNSLookupPerformer will be using timeout of " + dnsTimeout + " seconds ");
  }
}

代码示例来源:origin: org.mobicents.javax.sip/mobicents-jain-sip-ext

public DefaultDNSLookupPerformer() {
  // https://code.google.com/p/jain-sip/issues/detail?id=162
  dnsTimeout = DEFAULT_DNS_TIMEOUT_SECONDS;
  Lookup.getDefaultResolver().setTimeout(dnsTimeout, 0);
}

代码示例来源:origin: org.mobicents.javax.sip/mobicents-jain-sip-ext

public List<Record> performSRVLookup(String replacement) {
  if(logger.isDebugEnabled()) {
    logger.debug("doing SRV lookup for replacement " + replacement);
  }
  Record[] srvRecords = null;
  try {
    Lookup lookup = new Lookup(replacement, Type.SRV);
    lookup.getDefaultResolver().setTimeout(dnsTimeout);
    lookup.getDefaultResolver().setTimeout(dnsTimeout, 0);
    srvRecords = lookup.run();
  } catch (TextParseException e) {
    logger.error("Impossible to parse the parameters for dns lookup",e);
  }
  if(srvRecords != null && srvRecords.length > 0) {
    return Arrays.asList(srvRecords);	
  }
  return new ArrayList<Record>(0);
}

代码示例来源: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: org.mobicents.javax.sip/mobicents-jain-sip-ext

try {
  Lookup lookup = new Lookup(domain, Type.NAPTR);
  lookup.getDefaultResolver().setTimeout(dnsTimeout);
  lookup.getDefaultResolver().setTimeout(dnsTimeout, 0);
  naptrRecords = lookup.run();
} catch (TextParseException e) {

代码示例来源:origin: org.mobicents.javax.sip/mobicents-jain-sip-ext

lookup.getDefaultResolver().setTimeout(dnsTimeout);
lookup.getDefaultResolver().setTimeout(dnsTimeout, 0);
Record[] aRecords = lookup.run();
if(logger.isDebugEnabled()) {
lookup.getDefaultResolver().setTimeout(dnsTimeout);
lookup.getDefaultResolver().setTimeout(dnsTimeout, 0);
Record[] aaaaRecords = lookup.run();
if(logger.isDebugEnabled()) {

代码示例来源:origin: com.spotify/dns

public DnsSrvResolver build() {
 // NOTE: this sucks, but is the only reasonably sane way to set a timeout in dnsjava...
 // the effect of doing this is to set a global timeout for all Lookup instances - except
 // those that potentially get a new Resolver assigned via the setResolver method... Since
 // Lookup instances are mostly encapsulated in this library, we should be fine.
 int timeoutSecs = checkedCast(MILLISECONDS.toSeconds(dnsLookupTimeoutMillis));
 int millisRemainder = checkedCast(dnsLookupTimeoutMillis - SECONDS.toMillis(timeoutSecs));
 Lookup.getDefaultResolver().setTimeout(timeoutSecs, millisRemainder);
 LookupFactory lookupFactory = new SimpleLookupFactory();
 if (cacheLookups) {
  lookupFactory = new CachingLookupFactory(lookupFactory);
 }
 DnsSrvResolver result = new XBillDnsSrvResolver(lookupFactory);
 if (reporter != null) {
  result = new MeteredDnsSrvResolver(result, reporter);
 }
 if (retainData) {
  result = new RetainingDnsSrvResolver(result, retentionDurationMillis);
 }
 return result;
}

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

this.dclass = dclass;
synchronized (Lookup.class) {
  this.resolver = getDefaultResolver();
  this.searchPath = getDefaultSearchPath();
  this.cache = getDefaultCache(dclass);

代码示例来源:origin: org.littleshoot/dnsjava

this.dclass = dclass;
synchronized (Lookup.class) {
  this.resolver = getDefaultResolver();
  this.searchPath = getDefaultSearchPath();
  this.cache = getDefaultCache(dclass);

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

this.dclass = dclass;
synchronized (Lookup.class) {
  this.resolver = getDefaultResolver();
  this.searchPath = getDefaultSearchPath();
  this.cache = getDefaultCache(dclass);

代码示例来源:origin: net.sf.dnsjava-osgi/dnsjava-osgi

this.dclass = dclass;
synchronized (Lookup.class) {
  this.resolver = getDefaultResolver();
  this.searchPath = getDefaultSearchPath();
  this.cache = getDefaultCache(dclass);

代码示例来源:origin: github/elasticsearch-srv-discovery

parent_resolver = parent_resolver == null ? Lookup.getDefaultResolver() : parent_resolver;

代码示例来源:origin: com.helger/peppol-commons

aNewResolver.addResolver (Lookup.getDefaultResolver ());

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

@Before
public void setUp() throws Exception {
  dnsServer = new TestableDNSServer();
  DefaultConfigurationBuilder db = new DefaultConfigurationBuilder();
  db.load(new ByteArrayInputStream(DNS_SERVER_CONFIG));
  dnsServer.configure(db);
  dnsServer.init();
  defaultCache = Lookup.getDefaultCache(DClass.IN);
  defaultResolver = Lookup.getDefaultResolver();
  defaultSearchPaths = Lookup.getDefaultSearchPath();
  Lookup.setDefaultCache(null, DClass.IN);
  Lookup.setDefaultResolver(null);
  Lookup.setDefaultSearchPath(new Name[]{});
  dnsServer.setResolver(null);
  mockedCache = mock(Cache.class);
}

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

@Before
public void setUp() throws Exception {
  dnsServer = new TestableDNSServer();
  DefaultConfigurationBuilder db = new DefaultConfigurationBuilder();
  db.load(new ByteArrayInputStream(DNS_SERVER_CONFIG));
  dnsServer.configure(db);
  dnsServer.init();
  defaultCache = Lookup.getDefaultCache(DClass.IN);
  defaultResolver = Lookup.getDefaultResolver();
  defaultSearchPaths = Lookup.getDefaultSearchPath();
  Lookup.setDefaultCache(null, DClass.IN);
  Lookup.setDefaultResolver(null);
  Lookup.setDefaultSearchPath(new Name[]{});
  dnsServer.setResolver(null);
  mockedCache = mock(Cache.class);
}

代码示例来源:origin: org.apache.james/apache-jspf

Lookup.getDefaultResolver().setTimeout(timeOut);
Lookup query = new Lookup(request.getHostname(), dnsJavaType);

相关文章