DnsResolver implementation.
| Modifier and Type | Field and Description |
|---|---|
| private final Map | dnsMap
In-memory collection that will hold the associations between a host name and an array of InetAddress instances. |
| private static final Logger | LOG
Logger associated to this class. |
| Access | Constructor and Description |
|---|---|
| public | InMemoryDnsResolver()
Builds a DNS resolver that will resolve the host names against a collection held in-memory. |
| Modifier and Type | Method and Description |
|---|---|
| public void | add(final String
The host name to be associated with the given IP. host, final InetAddress... array of IP addresses to be resolved by this DNS overrider to the given
host name. ips)Associates the given array of IP addresses to the given host in this DNS overrider. |
| public InetAddress[] | resolve(final String
The host name to be resolved by this resolver. host)Implements org. |
| public String | resolveCanonicalHostname(final String host)
Implements org. |
| dnsMap | back to summary |
|---|---|
| private final Map<String, InetAddress[]> dnsMap In-memory collection that will hold the associations between a host name and an array of InetAddress instances. | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG Logger associated to this class. | |
| InMemoryDnsResolver | back to summary |
|---|---|
| public InMemoryDnsResolver() Builds a DNS resolver that will resolve the host names against a collection held in-memory. | |
| add | back to summary |
|---|---|
| public void add(final String host, final InetAddress... ips) Associates the given array of IP addresses to the given host in this DNS overrider. The IP addresses are assumed to be already resolved.
| |
| resolve | back to summary |
|---|---|
| public InetAddress[] resolve(final String host) throws UnknownHostException Implements org. Doc from org. Returns the IP address for the specified host name, or null if the given host is not recognized or the associated IP address cannot be used to build an InetAddress instance.
| |
| resolveCanonicalHostname | back to summary |
|---|---|
| public String resolveCanonicalHostname(final String host) throws UnknownHostException Implements org. Doc from org. Gets the fully qualified domain name for given host name.
| |