public class NativeResolver extends AbstractHostNameRemapper implements AdvancedHostResolver
AdvancedHostResolver
that provides native JVM lookup using InetAddress
.
This implementation does not provide any cache manipulation. Attempting to manipulate the DNS cache will result in a DEBUG-level
log statement and will not raise an exception. The DnsJavaResolver
provides support for cache
manipulation. If you absolutely need to manipulate the native JVM DNS cache, see
NativeCacheManipulatingResolver
for details.Constructor and Description |
---|
NativeResolver() |
Modifier and Type | Method and Description |
---|---|
void |
clearDNSCache()
Clears both the positive (successful DNS lookups) and negative (failed DNS lookups) cache.
|
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 resolveCopyright © 2017. All rights reserved.