public class DnsJavaResolver extends AbstractHostNameRemapper implements AdvancedHostResolver
AdvancedHostResolver
that uses dnsjava to perform DNS lookups. This implementation provides full
cache manipulation capabilities.Constructor and Description |
---|
DnsJavaResolver() |
Modifier and Type | Method and Description |
---|---|
void |
clearDNSCache()
Clears both the positive (successful DNS lookups) and negative (failed DNS lookups) cache.
|
protected Collection<InetAddress> |
resolveHostByType(String host,
int type)
Resolves the specified host using dnsjava, retrieving addresses of the specified type.
|
Collection<InetAddress> |
resolveRemapped(String remappedHost)
Resolves the specified remapped host.
|
void |
setNegativeDNSCacheTimeout(int timeout,
TimeUnit timeUnit)
Sets the negative (failed DNS lookup) timeout when making DNS lookups.
|
void |
setPositiveDNSCacheTimeout(int timeout,
TimeUnit timeUnit)
Sets the positive (successful DNS lookup) timeout when making DNS lookups.
|
applyRemapping, clearHostRemappings, getHostRemappings, getOriginalHostnames, remapHost, remapHosts, removeHostRemapping, resolve
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clearHostRemappings, getHostRemappings, getOriginalHostnames, remapHost, remapHosts, removeHostRemapping
resolve
public void clearDNSCache()
AdvancedHostResolver
clearDNSCache
in interface AdvancedHostResolver
public void setPositiveDNSCacheTimeout(int timeout, TimeUnit timeUnit)
AdvancedHostResolver
setPositiveDNSCacheTimeout
in interface AdvancedHostResolver
timeout
- maximum lookup timetimeUnit
- units of the timeout valuepublic void setNegativeDNSCacheTimeout(int timeout, TimeUnit timeUnit)
AdvancedHostResolver
setNegativeDNSCacheTimeout
in interface AdvancedHostResolver
timeout
- maximum lookup timetimeUnit
- units of the timeout valuepublic Collection<InetAddress> resolveRemapped(String remappedHost)
AbstractHostNameRemapper
HostResolver.resolve(String)
.resolveRemapped
in class AbstractHostNameRemapper
remappedHost
- remapped hostname to resolveprotected Collection<InetAddress> resolveHostByType(String host, int type)
host
- hostname to resolvetype
- one of Type
, typically Type.A
(IPv4) or Type.AAAA
(IPv6).Copyright © 2016. All Rights Reserved.