public interface DnsCache
| 限定符和类型 | 方法和说明 |
|---|---|
DnsCacheEntry |
cache(java.lang.String hostname,
DnsRecord[] additionals,
java.net.InetAddress address,
long originalTtl,
EventLoop loop)
Create a new
DnsCacheEntry and cache a resolved address for a given hostname. |
DnsCacheEntry |
cache(java.lang.String hostname,
DnsRecord[] additionals,
java.lang.Throwable cause,
EventLoop loop)
Cache the resolution failure for a given hostname.
|
void |
clear()
Clears all the resolved addresses cached by this resolver.
|
boolean |
clear(java.lang.String hostname)
Clears the resolved addresses of the specified host name from the cache of this resolver.
|
java.util.List<? extends DnsCacheEntry> |
get(java.lang.String hostname,
DnsRecord[] additionals)
Return the cached entries for the given hostname.
|
void clear()
clear(String)boolean clear(java.lang.String hostname)
true if and only if there was an entry for the specified host name in the cache and
it has been removed by this methodjava.util.List<? extends DnsCacheEntry> get(java.lang.String hostname, DnsRecord[] additionals)
hostname - the hostnameadditionals - the additional recordsDnsCacheEntry cache(java.lang.String hostname, DnsRecord[] additionals, java.net.InetAddress address, long originalTtl, EventLoop loop)
DnsCacheEntry and cache a resolved address for a given hostname.hostname - the hostnameadditionals - the additional recordsaddress - the resolved addressoriginalTtl - the TTL as returned by the DNS serverloop - the EventLoop used to register the TTL timeoutDnsCacheEntry corresponding to this cache entry.DnsCacheEntry cache(java.lang.String hostname, DnsRecord[] additionals, java.lang.Throwable cause, EventLoop loop)
hostname - the hostnameadditionals - the additional recordscause - the resolution failureloop - the EventLoop used to register the TTL timeoutDnsCacheEntry corresponding to this cache entry, or null if this cache doesn't
support caching failed responses.