Package io.netty.resolver.dns
Class AuthoritativeDnsServerCacheAdapter
java.lang.Object
io.netty.resolver.dns.AuthoritativeDnsServerCacheAdapter
- All Implemented Interfaces:
AuthoritativeDnsServerCache
final class AuthoritativeDnsServerCacheAdapter
extends Object
implements AuthoritativeDnsServerCache
AuthoritativeDnsServerCache
implementation which delegates all operations to a wrapped DnsCache
.
This implementation is only present to preserve a upgrade story.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
cache
(String hostname, InetSocketAddress address, long originalTtl, EventLoop loop) Caches a nameserver that should be used to resolve the given hostname.void
clear()
Clears all cached nameservers.boolean
Clears the cached nameservers for the specified hostname.Returns the cached nameservers that should be used to resolve the given hostname.
-
Field Details
-
EMPTY
-
cache
-
-
Constructor Details
-
AuthoritativeDnsServerCacheAdapter
AuthoritativeDnsServerCacheAdapter(DnsCache cache)
-
-
Method Details
-
get
Description copied from interface:AuthoritativeDnsServerCache
Returns the cached nameservers that should be used to resolve the given hostname. The returnedDnsServerAddressStream
may contain unresolvedInetSocketAddress
es that will be resolved when needed while resolving other domain names.- Specified by:
get
in interfaceAuthoritativeDnsServerCache
- Parameters:
hostname
- the hostname- Returns:
- the cached entries or an
null
if none.
-
cache
Description copied from interface:AuthoritativeDnsServerCache
Caches a nameserver that should be used to resolve the given hostname.- Specified by:
cache
in interfaceAuthoritativeDnsServerCache
- Parameters:
hostname
- the hostnameaddress
- the nameserver address (which may be unresolved).originalTtl
- the TTL as returned by the DNS serverloop
- theEventLoop
used to register the TTL timeout
-
clear
public void clear()Description copied from interface:AuthoritativeDnsServerCache
Clears all cached nameservers.- Specified by:
clear
in interfaceAuthoritativeDnsServerCache
- See Also:
-
clear
Description copied from interface:AuthoritativeDnsServerCache
Clears the cached nameservers for the specified hostname.- Specified by:
clear
in interfaceAuthoritativeDnsServerCache
- Returns:
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
-