| 构造器和说明 |
|---|
DefaultDnsCache()
Create a cache that respects the TTL returned by the DNS server
and doesn't cache negative responses.
|
DefaultDnsCache(int minTtl,
int maxTtl,
int negativeTtl)
Create a cache.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
int |
maxTtl()
Returns the maximum TTL of the cached DNS resource records (in seconds).
|
int |
minTtl()
Returns the minimum TTL of the cached DNS resource records (in seconds).
|
int |
negativeTtl()
Returns the TTL of the cache for the failed DNS queries (in seconds).
|
java.lang.String |
toString() |
public DefaultDnsCache()
public DefaultDnsCache(int minTtl,
int maxTtl,
int negativeTtl)
minTtl - the minimum TTLmaxTtl - the maximum TTLnegativeTtl - the TTL for failed queriespublic int minTtl()
maxTtl()public int maxTtl()
minTtl()public int negativeTtl()
0, which
disables the cache for negative results.public void clear()
DnsCacheclear 在接口中 DnsCacheDnsCache.clear(String)public boolean clear(java.lang.String hostname)
DnsCachepublic java.util.List<? extends DnsCacheEntry> get(java.lang.String hostname, DnsRecord[] additionals)
DnsCachepublic DnsCacheEntry cache(java.lang.String hostname, DnsRecord[] additionals, java.net.InetAddress address, long originalTtl, EventLoop loop)
DnsCacheDnsCacheEntry and cache a resolved address for a given hostname.cache 在接口中 DnsCachehostname - 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.public DnsCacheEntry cache(java.lang.String hostname, DnsRecord[] additionals, java.lang.Throwable cause, EventLoop loop)
DnsCachecache 在接口中 DnsCachehostname - 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.public java.lang.String toString()
toString 在类中 java.lang.Object