Package io.netty.resolver.dns
Class NoopDnsCache
java.lang.Object
io.netty.resolver.dns.NoopDnsCache
- All Implemented Interfaces:
DnsCache
A noop DNS cache that actually never caches anything.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCache the resolution failure for a given hostname.cache
(String hostname, DnsRecord[] additional, InetAddress address, long originalTtl, EventLoop loop) Create a newDnsCacheEntry
and cache a resolved address for a given hostname.void
clear()
Clears all the resolved addresses cached by this resolver.boolean
Clears the resolved addresses of the specified host name from the cache of this resolver.List
<? extends DnsCacheEntry> Return the cached entries for the given hostname.toString()
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
NoopDnsCache
private NoopDnsCache()Private singleton constructor.
-
-
Method Details
-
clear
public void clear()Description copied from interface:DnsCache
Clears all the resolved addresses cached by this resolver. -
clear
Description copied from interface:DnsCache
Clears the resolved addresses of the specified host name from the cache of this resolver. -
get
Description copied from interface:DnsCache
Return the cached entries for the given hostname. -
cache
public DnsCacheEntry cache(String hostname, DnsRecord[] additional, InetAddress address, long originalTtl, EventLoop loop) Description copied from interface:DnsCache
Create a newDnsCacheEntry
and cache a resolved address for a given hostname.- Specified by:
cache
in interfaceDnsCache
- Parameters:
hostname
- the hostnameadditional
- the additional recordsaddress
- the resolved addressoriginalTtl
- the TTL as returned by the DNS serverloop
- theEventLoop
used to register the TTL timeout- Returns:
- The
DnsCacheEntry
corresponding to this cache entry.
-
cache
public DnsCacheEntry cache(String hostname, DnsRecord[] additional, Throwable cause, EventLoop loop) Description copied from interface:DnsCache
Cache the resolution failure for a given hostname. Be aware this won't be called with timeout / cancel / transport exceptions.- Specified by:
cache
in interfaceDnsCache
- Parameters:
hostname
- the hostnameadditional
- the additional recordscause
- the resolution failureloop
- theEventLoop
used to register the TTL timeout- Returns:
- The
DnsCacheEntry
corresponding to this cache entry, ornull
if this cache doesn't support caching failed responses.
-
toString
-