Top Description Fields Constructors Methods
io.netty.resolver.dns

public final Class DefaultDnsCnameCache

extends Object
implements DnsCnameCache
Class Inheritance
All Implemented Interfaces
io.netty.resolver.dns.DnsCnameCache
Imports
io.netty.channel.EventLoop, io.netty.util.AsciiString, java.util.List

Default implementation of a DnsCnameCache.

Field Summary

Modifier and TypeField and Description
private final Cache<String>
private final int
private final int

Constructor Summary

AccessConstructor and Description
public
DefaultDnsCnameCache()

Create a cache that respects the TTL returned by the DNS server.

public
DefaultDnsCnameCache(int
the minimum TTL
minTtl
,
int
the maximum TTL
maxTtl
)

Create a cache.

Method Summary

Modifier and TypeMethod and Description
public void
cache(String
the hostname
hostname
,
String
the cname mapping.
cname
,
long
the TTL as returned by the DNS server
originalTtl
,
EventLoop
the EventLoop used to register the TTL timeout
loop
)

Implements io.netty.resolver.dns.DnsCnameCache.cache.

Caches a cname entry that should be used for the given hostname.
public void
clear()

Implements io.netty.resolver.dns.DnsCnameCache.clear.

Clears all cached nameservers.
public boolean
clear(String hostname)

Implements io.netty.resolver.dns.DnsCnameCache.clear.

Clears the cached nameservers for the specified hostname.
public String
get(String
the hostname
hostname
)

Implements io.netty.resolver.dns.DnsCnameCache.get.

Returns the cached cname for the given hostname.
pack-priv int
pack-priv int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cacheback to summary
private final Cache<String> cache
maxTtlback to summary
private final int maxTtl
minTtlback to summary
private final int minTtl

Constructor Detail

DefaultDnsCnameCacheback to summary
public DefaultDnsCnameCache()

Create a cache that respects the TTL returned by the DNS server.

DefaultDnsCnameCacheback to summary
public DefaultDnsCnameCache(int minTtl, int maxTtl)

Create a cache.

Parameters
minTtl:int

the minimum TTL

maxTtl:int

the maximum TTL

Method Detail

cacheback to summary
public void cache(String hostname, String cname, long originalTtl, EventLoop loop)

Implements io.netty.resolver.dns.DnsCnameCache.cache.

Doc from io.netty.resolver.dns.DnsCnameCache.cache.

Caches a cname entry that should be used for the given hostname.

Parameters
hostname:String

the hostname

cname:String

the cname mapping.

originalTtl:long

the TTL as returned by the DNS server

loop:EventLoop

the EventLoop used to register the TTL timeout

Annotations
@Override
clearback to summary
public void clear()

Implements io.netty.resolver.dns.DnsCnameCache.clear.

Doc from io.netty.resolver.dns.DnsCnameCache.clear.

Clears all cached nameservers.

Annotations
@Override
clearback to summary
public boolean clear(String hostname)

Implements io.netty.resolver.dns.DnsCnameCache.clear.

Doc from io.netty.resolver.dns.DnsCnameCache.clear.

Clears the cached nameservers for the specified hostname.

Returns:boolean

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

Annotations
@Override
getback to summary
public String get(String hostname)

Implements io.netty.resolver.dns.DnsCnameCache.get.

Doc from io.netty.resolver.dns.DnsCnameCache.get.

Returns the cached cname for the given hostname.

Parameters
hostname:String

the hostname

Returns:String

the cached entries or an null if none.

Annotations
@SuppressWarnings:unchecked
@Override
maxTtlback to summary
pack-priv int maxTtl()
minTtlback to summary
pack-priv int minTtl()