Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
void |
cache(String hostname,
DnsRecord[] additionals,
InetAddress address,
long originalTtl,
EventLoop loop)
Cache a resolved address for a given hostname.
|
void |
cache(String hostname,
DnsRecord[] additionals,
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(String hostname)
Clears the resolved addresses of the specified host name from the cache of this resolver.
|
List<DnsCacheEntry> |
get(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).
|
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()
DnsCache
clear
in interface DnsCache
DnsCache.clear(String)
public boolean clear(String hostname)
DnsCache
public List<DnsCacheEntry> get(String hostname, DnsRecord[] additionals)
DnsCache
public void cache(String hostname, DnsRecord[] additionals, InetAddress address, long originalTtl, EventLoop loop)
DnsCache
public void cache(String hostname, DnsRecord[] additionals, Throwable cause, EventLoop loop)
DnsCache
Copyright © 2008–2017 The Netty Project. All rights reserved.