AuthoritativeDnsServerCache, backed by a ConcurrentMap.
| Modifier and Type | Field and Description |
|---|---|
| private final Comparator | |
| private final int | |
| private final int | |
| private final Cache |
| Access | Constructor and Description |
|---|---|
| public | DefaultAuthoritativeDnsServerCache()
Create a cache that respects the TTL returned by the DNS server. |
| public | DefaultAuthoritativeDnsServerCache(int
the minimum TTL minTtl, int the maximum TTL maxTtl, Comparator<InetSocketAddress> the comparator)Comparator to order the InetSocketAddress for a hostname or null
if insertion order should be used.Create a cache. |
| Modifier and Type | Method and Description |
|---|---|
| public void | cache(String
the hostname hostname, InetSocketAddress the nameserver address (which may be unresolved). address, long the TTL as returned by the DNS server originalTtl, EventLoop the loop)EventLoop used to register the TTL timeoutImplements io. |
| public void | clear()
Implements io. |
| public boolean | clear(String hostname)
Implements io. |
| public DnsServerAddressStream | get(String
the hostname hostname)Implements io. |
| public String |
| comparator | back to summary |
|---|---|
| private final Comparator<InetSocketAddress> comparator | |
| maxTtl | back to summary |
|---|---|
| private final int maxTtl | |
| minTtl | back to summary |
|---|---|
| private final int minTtl | |
| resolveCache | back to summary |
|---|---|
| private final Cache<InetSocketAddress> resolveCache | |
| DefaultAuthoritativeDnsServerCache | back to summary |
|---|---|
| public DefaultAuthoritativeDnsServerCache() Create a cache that respects the TTL returned by the DNS server. | |
| DefaultAuthoritativeDnsServerCache | back to summary |
|---|---|
| public DefaultAuthoritativeDnsServerCache(int minTtl, int maxTtl, Comparator<InetSocketAddress> comparator) Create a cache.
| |
| cache | back to summary |
|---|---|
| public void cache(String hostname, InetSocketAddress address, long originalTtl, EventLoop loop) Implements io. Doc from io. Caches a nameserver that should be used to resolve the given hostname.
| |
| clear | back to summary |
|---|---|
| public void clear() Implements io. Doc from io. Clears all cached nameservers.
| |
| clear | back to summary |
|---|---|
| public boolean clear(String hostname) Implements io. Doc from io. Clears the cached nameservers for the specified hostname.
| |
| get | back to summary |
|---|---|
| public DnsServerAddressStream get(String hostname) Implements io. Doc from io. Returns the cached nameservers that should be used to resolve the given hostname. The returned
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |