public interface AdvancedHostResolver extends HostResolver
HostResolver
. AdvancedHostResolvers should apply any remappings before attempting
to resolve the hostname in the HostResolver.resolve(String)
method.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.
|
Map<String,String> |
getHostRemappings()
Returns all host remappings in effect.
|
Collection<String> |
getOriginalHostnames(String remappedHost)
Returns the original address or addresses that are remapped to the specified remappedHost.
|
void |
remapHost(String originalHost,
String remappedHost)
Remaps an individual host.
|
void |
remapHosts(Map<String,String> hostRemappings)
Replaces the host remappings in the existing list of remappings (if any) with the specified remappings.
|
void |
removeHostRemapping(String originalHost)
Removes the specified host remapping.
|
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.
|
resolve
void remapHosts(Map<String,String> hostRemappings)
hostRemappings
- Map of <original hostname, remapped hostname>
void remapHost(String originalHost, String remappedHost)
originalHost
- Original host to remap. Must exactly match the requested hostname (not a domain or regular expression match).remappedHost
- hostname that will replace originalHostvoid removeHostRemapping(String originalHost)
originalHost
- currently-remapped hostnamevoid clearHostRemappings()
Map<String,String> getHostRemappings()
<original hostname, remapped hostname>
Collection<String> getOriginalHostnames(String remappedHost)
remappedHost
- remapped hostnamevoid clearDNSCache()
void setPositiveDNSCacheTimeout(int timeout, TimeUnit timeUnit)
timeout
- maximum lookup timetimeUnit
- units of the timeout valuevoid setNegativeDNSCacheTimeout(int timeout, TimeUnit timeUnit)
timeout
- maximum lookup timetimeUnit
- units of the timeout valueCopyright © 2016. All Rights Reserved.