public final class DefaultDnsCnameCache extends Object implements DnsCnameCache
DnsCnameCache.| Constructor and Description |
|---|
DefaultDnsCnameCache()
Create a cache that respects the TTL returned by the DNS server.
|
DefaultDnsCnameCache(int minTtl,
int maxTtl)
Create a cache.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cache(String hostname,
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(String hostname)
Clears the cached nameservers for the specified hostname.
|
String |
get(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 String get(String hostname)
DnsCnameCacheget in interface DnsCnameCachehostname - the hostnamenull if none.public void cache(String hostname, String cname, long originalTtl, EventLoop loop)
DnsCnameCachecache in interface DnsCnameCachehostname - the hostnamecname - the cname mapping.originalTtl - the TTL as returned by the DNS serverloop - the EventLoop used to register the TTL timeoutpublic void clear()
DnsCnameCacheclear in interface DnsCnameCacheDnsCnameCache.clear(String)public boolean clear(String hostname)
DnsCnameCacheclear in interface DnsCnameCachetrue if and only if there was an entry for the specified host name in the cache and
it has been removed by this methodCopyright © 2008–2025 The Netty Project. All rights reserved.