Package com.browserup.bup.proxy.dns
Class NativeResolver
- java.lang.Object
-
- com.browserup.bup.proxy.dns.AbstractHostNameRemapper
-
- com.browserup.bup.proxy.dns.NativeResolver
-
- All Implemented Interfaces:
AdvancedHostResolver,HostResolver
- Direct Known Subclasses:
NativeCacheManipulatingResolver
public class NativeResolver extends AbstractHostNameRemapper implements AdvancedHostResolver
AnAdvancedHostResolverthat provides native JVM lookup usingInetAddress. 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. TheDnsJavaResolverprovides support for cache manipulation. If you absolutely need to manipulate the native JVM DNS cache, seeNativeCacheManipulatingResolverfor details.
-
-
Constructor Summary
Constructors Constructor Description NativeResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearDNSCache()Clears both the positive (successful DNS lookups) and negative (failed DNS lookups) cache.java.util.Collection<java.net.InetAddress>resolveRemapped(java.lang.String remappedHost)Resolves the specified remapped host.voidsetNegativeDNSCacheTimeout(int timeout, java.util.concurrent.TimeUnit timeUnit)Sets the negative (failed DNS lookup) timeout when making DNS lookups.voidsetPositiveDNSCacheTimeout(int timeout, java.util.concurrent.TimeUnit timeUnit)Sets the positive (successful DNS lookup) timeout when making DNS lookups.-
Methods inherited from class com.browserup.bup.proxy.dns.AbstractHostNameRemapper
applyRemapping, clearHostRemappings, getHostRemappings, getOriginalHostnames, remapHost, remapHosts, removeHostRemapping, resolve
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.browserup.bup.proxy.dns.AdvancedHostResolver
clearHostRemappings, getHostRemappings, getOriginalHostnames, remapHost, remapHosts, removeHostRemapping
-
Methods inherited from interface com.browserup.bup.proxy.dns.HostResolver
resolve
-
-
-
-
Method Detail
-
clearDNSCache
public void clearDNSCache()
Description copied from interface:AdvancedHostResolverClears both the positive (successful DNS lookups) and negative (failed DNS lookups) cache.- Specified by:
clearDNSCachein interfaceAdvancedHostResolver
-
setPositiveDNSCacheTimeout
public void setPositiveDNSCacheTimeout(int timeout, java.util.concurrent.TimeUnit timeUnit)Description copied from interface:AdvancedHostResolverSets the positive (successful DNS lookup) timeout when making DNS lookups. Note: The timeUnit parameter does not guarantee the specified precision; implementations may need to reduce precision, depending on the underlying DNS implementation. For example, the Oracle JVM's DNS cache only supports timeouts in whole seconds, so specifying a timeout of 1200ms will result in a timeout of 1 second.- Specified by:
setPositiveDNSCacheTimeoutin interfaceAdvancedHostResolver- Parameters:
timeout- maximum lookup timetimeUnit- units of the timeout value
-
setNegativeDNSCacheTimeout
public void setNegativeDNSCacheTimeout(int timeout, java.util.concurrent.TimeUnit timeUnit)Description copied from interface:AdvancedHostResolverSets the negative (failed DNS lookup) timeout when making DNS lookups. Note: The timeUnit parameter does not guarantee the specified precision; implementations may need to reduce precision, depending on the underlying DNS implementation. For example, the Oracle JVM's DNS cache only supports timeouts in whole seconds, so specifying a timeout of 1200ms will result in a timeout of 1 second.- Specified by:
setNegativeDNSCacheTimeoutin interfaceAdvancedHostResolver- Parameters:
timeout- maximum lookup timetimeUnit- units of the timeout value
-
resolveRemapped
public java.util.Collection<java.net.InetAddress> resolveRemapped(java.lang.String remappedHost)
Description copied from class:AbstractHostNameRemapperResolves the specified remapped host. Subclasses should provide resolution by implementing this method, rather than overridingHostResolver.resolve(String).- Specified by:
resolveRemappedin classAbstractHostNameRemapper- Parameters:
remappedHost- remapped hostname to resolve- Returns:
- resolved InetAddresses, or an empty list if no addresses were found
-
-