public final class DefaultDnsCnameCache extends java.lang.Object implements DnsCnameCache
DnsCnameCache
.构造器和说明 |
---|
DefaultDnsCnameCache()
Create a cache that respects the TTL returned by the DNS server.
|
DefaultDnsCnameCache(int minTtl,
int maxTtl)
Create a cache.
|
限定符和类型 | 方法和说明 |
---|---|
void |
cache(java.lang.String hostname,
java.lang.String cname,
long originalTtl,
EventLoop loop)
Caches a cname entry that should be used for the given hostname.
|
void |
clear()
Clears all cached nameservers.
|
boolean |
clear(java.lang.String hostname)
Clears the cached nameservers for the specified hostname.
|
java.lang.String |
get(java.lang.String hostname)
Returns the cached cname for the given hostname.
|
public DefaultDnsCnameCache()
public DefaultDnsCnameCache(int minTtl, int maxTtl)
minTtl
- the minimum TTLmaxTtl
- the maximum TTLpublic java.lang.String get(java.lang.String hostname)
DnsCnameCache
get
在接口中 DnsCnameCache
hostname
- the hostnamenull
if none.public void cache(java.lang.String hostname, java.lang.String cname, long originalTtl, EventLoop loop)
DnsCnameCache
cache
在接口中 DnsCnameCache
hostname
- the hostnamecname
- the cname mapping.originalTtl
- the TTL as returned by the DNS serverloop
- the EventLoop
used to register the TTL timeoutpublic void clear()
DnsCnameCache
clear
在接口中 DnsCnameCache
DnsCnameCache.clear(String)
public boolean clear(java.lang.String hostname)
DnsCnameCache
clear
在接口中 DnsCnameCache
true
if and only if there was an entry for the specified host name in the cache and
it has been removed by this method