- java.lang.Object
-
- io.netty5.resolver.dns.NoopAuthoritativeDnsServerCache
-
- All Implemented Interfaces:
AuthoritativeDnsServerCache
public final class NoopAuthoritativeDnsServerCache extends Object implements AuthoritativeDnsServerCache
A noopAuthoritativeDnsServerCache
that actually never caches anything.
-
-
Field Summary
Fields Modifier and Type Field Description static NoopAuthoritativeDnsServerCache
INSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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
clear(String hostname)
Clears the cached nameservers for the specified hostname.DnsServerAddressStream
get(String hostname)
Returns the cached nameservers that should be used to resolve the given hostname.
-
-
-
Field Detail
-
INSTANCE
public static final NoopAuthoritativeDnsServerCache INSTANCE
-
-
Method Detail
-
get
public DnsServerAddressStream get(String hostname)
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
public void cache(String hostname, InetSocketAddress address, long originalTtl, EventLoop loop)
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:
AuthoritativeDnsServerCache.clear(String)
-
clear
public boolean clear(String hostname)
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
-
-