public abstract class AbstractHostNameRemapper extends Object implements AdvancedHostResolver
resolveRemapped(String)
instead of HostResolver.resolve(String)
, which takes the remapped host as the input parameter.Constructor and Description |
---|
AbstractHostNameRemapper() |
Modifier and Type | Method and Description |
---|---|
String |
applyRemapping(String originalHost)
Applies this class's host name remappings to the specified original host, returning the remapped host name (if any), or the originalHost
if there is no remapped host name.
|
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.
|
Collection<InetAddress> |
resolve(String originalHost)
Retrieves the remapped hostname and resolves it using
resolveRemapped(String) . |
abstract Collection<InetAddress> |
resolveRemapped(String remappedHost)
Resolves the specified remapped host.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clearDNSCache, setNegativeDNSCacheTimeout, setPositiveDNSCacheTimeout
public void remapHosts(Map<String,String> hostRemappings)
AdvancedHostResolver
remapHosts
in interface AdvancedHostResolver
hostRemappings
- Map of <original hostname, remapped hostname>
public void remapHost(String originalHost, String remappedHost)
AdvancedHostResolver
remapHost
in interface AdvancedHostResolver
originalHost
- 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(String originalHost)
AdvancedHostResolver
removeHostRemapping
in interface AdvancedHostResolver
originalHost
- currently-remapped hostnamepublic void clearHostRemappings()
AdvancedHostResolver
clearHostRemappings
in interface AdvancedHostResolver
public Map<String,String> getHostRemappings()
AdvancedHostResolver
getHostRemappings
in interface AdvancedHostResolver
<original hostname, remapped hostname>
public Collection<String> getOriginalHostnames(String remappedHost)
AdvancedHostResolver
getOriginalHostnames
in interface AdvancedHostResolver
remappedHost
- remapped hostnamepublic String applyRemapping(String originalHost)
originalHost
- original host name to resolvepublic abstract Collection<InetAddress> resolveRemapped(String remappedHost)
HostResolver.resolve(String)
.remappedHost
- remapped hostname to resolvepublic Collection<InetAddress> resolve(String originalHost)
resolveRemapped(String)
.resolve
in interface HostResolver
originalHost
- original hostname to resolveCopyright © 2016. All Rights Reserved.