DnsCache, backed by a ConcurrentMap.
If any additional DnsRecord is used, no caching takes place.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final int | |
| private final int | |
| private final Cache |
| Access | Constructor and Description |
|---|---|
| public | DefaultDnsCache()
Create a cache that respects the TTL returned by the DNS server and doesn't cache negative responses. |
| public | DefaultDnsCache(int
the minimum TTL minTtl, int the maximum TTL maxTtl, int the TTL for failed queries negativeTtl)Create a cache. |
| Modifier and Type | Method and Description |
|---|---|
| private static String | |
| public DnsCacheEntry | cache(String
the hostname hostname, DnsRecord[] the additional records additionals, InetAddress the resolved address address, long the TTL as returned by the DNS server originalTtl, EventLoop the loop)EventLoop used to register the TTL timeoutImplements io. DnsCacheEntry and cache a resolved address for a given hostname.
|
| public DnsCacheEntry | |
| public void | clear()
Implements io. |
| public boolean | clear(String hostname)
Implements io. |
| private static boolean | |
| public List | get(String
the hostname hostname, DnsRecord[] the additional records additionals)Implements io. |
| public int | |
| public int | |
| public int | |
| public String |
| maxTtl | back to summary |
|---|---|
| private final int maxTtl | |
| minTtl | back to summary |
|---|---|
| private final int minTtl | |
| negativeTtl | back to summary |
|---|---|
| private final int negativeTtl | |
| resolveCache | back to summary |
|---|---|
| private final Cache<DefaultDnsCache. | |
| DefaultDnsCache | back to summary |
|---|---|
| public DefaultDnsCache() Create a cache that respects the TTL returned by the DNS server and doesn't cache negative responses. | |
| DefaultDnsCache | back to summary |
|---|---|
| public DefaultDnsCache(int minTtl, int maxTtl, int negativeTtl) Create a cache.
| |
| appendDot | back to summary |
|---|---|
| private static String appendDot(String hostname) | |
| cache | back to summary |
|---|---|
| public DnsCacheEntry cache(String hostname, DnsRecord[] additionals, InetAddress address, long originalTtl, EventLoop loop) Implements io. Doc from io. Create a new
| |
| cache | back to summary |
|---|---|
| public DnsCacheEntry cache(String hostname, DnsRecord[] additionals, Throwable cause, EventLoop loop) Implements io. Doc from io. Cache the resolution failure for a given hostname. Be aware this won't be called with timeout / cancel / transport exceptions.
| |
| clear | back to summary |
|---|---|
| public void clear() Implements io. Doc from io. Clears all the resolved addresses cached by this resolver.
| |
| clear | back to summary |
|---|---|
| public boolean clear(String hostname) Implements io. Doc from io. Clears the resolved addresses of the specified host name from the cache of this resolver.
| |
| emptyAdditionals | back to summary |
|---|---|
| private static boolean emptyAdditionals(DnsRecord[] additionals) | |
| get | back to summary |
|---|---|
| public List Implements io. Doc from io. Return the cached entries for the given hostname.
| |
| maxTtl | back to summary |
|---|---|
| public int maxTtl() Returns the maximum TTL of the cached DNS resource records (in seconds).
| |
| minTtl | back to summary |
|---|---|
| public int minTtl() Returns the minimum TTL of the cached DNS resource records (in seconds).
| |
| negativeTtl | back to summary |
|---|---|
| public int negativeTtl() Returns the TTL of the cache for the failed DNS queries (in seconds). The default value is | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Modifier and Type | Field and Description |
|---|---|
| private final InetAddress | |
| private final Throwable | |
| private final String |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public InetAddress | |
| public Throwable | cause()
Implements io. |
| public String |
| address | back to summary |
|---|---|
| private final InetAddress address | |
| cause | back to summary |
|---|---|
| private final Throwable cause | |
| hostname | back to summary |
|---|---|
| private final String hostname | |
| DefaultDnsCacheEntry | back to summary |
|---|---|
| pack-priv DefaultDnsCacheEntry(String hostname, InetAddress address) | |
| DefaultDnsCacheEntry | back to summary |
|---|---|
| pack-priv DefaultDnsCacheEntry(String hostname, Throwable cause) | |
| address | back to summary |
|---|---|
| public InetAddress address() Implements io. Doc from io. Get the resolved address.
This may be null if the resolution failed, and in that case
| |
| cause | back to summary |
|---|---|
| public Throwable cause() Implements io. Doc from io. If the DNS query failed this will provide the rational. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |