public abstract class BasicHostResolver extends java.lang.Object implements AdvancedHostResolver
AdvancedHostResolver that throws UnsupportedOperationException on all methods except HostResolver.resolve(String).
Use this class to supply a HostResolver to BrowserUpProxy.setHostNameResolver(AdvancedHostResolver)
if you do not need AdvancedHostResolver functionality.| Constructor and Description |
|---|
BasicHostResolver() |
| Modifier and Type | Method and Description |
|---|---|
void |
clearDNSCache()
Clears both the positive (successful DNS lookups) and negative (failed DNS lookups) cache.
|
void |
clearHostRemappings()
Removes all hostname remappings.
|
java.util.Map<java.lang.String,java.lang.String> |
getHostRemappings()
Returns all host remappings in effect.
|
java.util.Collection<java.lang.String> |
getOriginalHostnames(java.lang.String remappedHost)
Returns the original address or addresses that are remapped to the specified remappedHost.
|
void |
remapHost(java.lang.String originalHost,
java.lang.String remappedHost)
Remaps an individual host.
|
void |
remapHosts(java.util.Map<java.lang.String,java.lang.String> hostRemappings)
Replaces the host remappings in the existing list of remappings (if any) with the specified remappings.
|
void |
removeHostRemapping(java.lang.String originalHost)
Removes the specified host remapping.
|
void |
setNegativeDNSCacheTimeout(int timeout,
java.util.concurrent.TimeUnit timeUnit)
Sets the negative (failed DNS lookup) timeout when making DNS lookups.
|
void |
setPositiveDNSCacheTimeout(int timeout,
java.util.concurrent.TimeUnit timeUnit)
Sets the positive (successful DNS lookup) timeout when making DNS lookups.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitresolvepublic void remapHosts(java.util.Map<java.lang.String,java.lang.String> hostRemappings)
AdvancedHostResolverremapHosts in interface AdvancedHostResolverhostRemappings - Map of <original hostname, remapped hostname>public void remapHost(java.lang.String originalHost,
java.lang.String remappedHost)
AdvancedHostResolverremapHost in interface AdvancedHostResolveroriginalHost - Original host to remap. Must exactly match the requested hostname (not a domain or regular expression match).remappedHost - hostname that will replace originalHostpublic void removeHostRemapping(java.lang.String originalHost)
AdvancedHostResolverremoveHostRemapping in interface AdvancedHostResolveroriginalHost - currently-remapped hostnamepublic void clearHostRemappings()
AdvancedHostResolverclearHostRemappings in interface AdvancedHostResolverpublic java.util.Map<java.lang.String,java.lang.String> getHostRemappings()
AdvancedHostResolvergetHostRemappings in interface AdvancedHostResolver<original hostname, remapped hostname>public java.util.Collection<java.lang.String> getOriginalHostnames(java.lang.String remappedHost)
AdvancedHostResolvergetOriginalHostnames in interface AdvancedHostResolverremappedHost - remapped hostnamepublic void clearDNSCache()
AdvancedHostResolverclearDNSCache in interface AdvancedHostResolverpublic void setPositiveDNSCacheTimeout(int timeout,
java.util.concurrent.TimeUnit timeUnit)
AdvancedHostResolversetPositiveDNSCacheTimeout in interface AdvancedHostResolvertimeout - maximum lookup timetimeUnit - units of the timeout valuepublic void setNegativeDNSCacheTimeout(int timeout,
java.util.concurrent.TimeUnit timeUnit)
AdvancedHostResolversetNegativeDNSCacheTimeout in interface AdvancedHostResolvertimeout - maximum lookup timetimeUnit - units of the timeout value