Package io.netty.resolver.dns
Interface AuthoritativeDnsServerCache
-
- All Known Implementing Classes:
DefaultAuthoritativeDnsServerCache,NoopAuthoritativeDnsServerCache
public interface AuthoritativeDnsServerCacheCache which stores the nameservers that should be used to resolve a specific hostname.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcache(java.lang.String hostname, java.net.InetSocketAddress address, long originalTtl, EventLoop loop)Caches a nameserver that should be used to resolve the given hostname.voidclear()Clears all cached nameservers.booleanclear(java.lang.String hostname)Clears the cached nameservers for the specified hostname.DnsServerAddressStreamget(java.lang.String hostname)Returns the cached nameservers that should be used to resolve the given hostname.
-
-
-
Method Detail
-
get
DnsServerAddressStream get(java.lang.String hostname)
Returns the cached nameservers that should be used to resolve the given hostname. The returnedDnsServerAddressStreammay contain unresolvedInetSocketAddresses that will be resolved when needed while resolving other domain names.- Parameters:
hostname- the hostname- Returns:
- the cached entries or an
nullif none.
-
cache
void cache(java.lang.String hostname, java.net.InetSocketAddress address, long originalTtl, EventLoop loop)Caches a nameserver that should be used to resolve the given hostname.- Parameters:
hostname- the hostnameaddress- the nameserver address (which may be unresolved).originalTtl- the TTL as returned by the DNS serverloop- theEventLoopused to register the TTL timeout
-
clear
void clear()
Clears all cached nameservers.- See Also:
clear(String)
-
clear
boolean clear(java.lang.String hostname)
Clears the cached nameservers for the specified hostname.- Returns:
trueif and only if there was an entry for the specified host name in the cache and it has been removed by this method
-
-