DnsCache, backed by a ConcurrentMap.
If any additional DnsRecord is used, no caching takes place.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| 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 Throwable | |
| 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.
| |
| copyThrowable | back to summary |
|---|---|
| private static Throwable copyThrowable(Throwable error) | |
| 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 int | |
| private final String |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public InetAddress | |
| public Throwable | cause()
Implements io. |
| pack-priv DnsCacheEntry | |
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. |
| public int | |
| pack-priv String | |
| public String |
| address | back to summary |
|---|---|
| private final InetAddress address | |
| cause | back to summary |
|---|---|
| private final Throwable cause | |
| hash | back to summary |
|---|---|
| private final int hash | |
| 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) | |
| DefaultDnsCacheEntry | back to summary |
|---|---|
| private DefaultDnsCacheEntry(DefaultDnsCache. | |
| 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. | |
| copyIfNeeded | back to summary |
|---|---|
| pack-priv DnsCacheEntry copyIfNeeded() | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| hostname | back to summary |
|---|---|
| pack-priv String hostname() | |
| 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 List |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the object to be compared for equality with this list o)Overrides java. Implements java. |
| public DnsCacheEntry | get(int
index of the element to return index)Implements abstract java. Implements java. |
| public int | hashCode()
Overrides java. Implements java. |
| public int | size()
Implements abstract java. Implements java. |
| entries | back to summary |
|---|---|
| private final List<? extends DnsCacheEntry> entries | |
| DnsCacheEntryList | back to summary |
|---|---|
| pack-priv DnsCacheEntryList(List<? extends DnsCacheEntry> entries) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Implements java. Doc from java. Compares the specified object with this list for equality. Returns
| |
| get | back to summary |
|---|---|
| public DnsCacheEntry get(int index) Implements abstract java. Implements java. Doc from java. Returns the element at the specified position in this list.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements java. Doc from java. Returns the hash code value for this list.
| |
| size | back to summary |
|---|---|
| public int size() Implements abstract java. Implements java. Doc from java. Returns the number of elements in this list. If this list contains
more than
| |