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

public final Class NoopDnsCache

extends Object
implements DnsCache
Class Inheritance
All Implemented Interfaces
io.netty.resolver.dns.DnsCache
Imports
io.netty.channel.EventLoop, io.netty.handler.codec.dns.DnsRecord, java.net.InetAddress, java.util.Collections, .List

A noop DNS cache that actually never caches anything.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
public static final NoopDnsCache

Constructor Summary

AccessConstructor and Description
private
NoopDnsCache()

Private singleton constructor.

Method Summary

Modifier and TypeMethod and Description
public DnsCacheEntry
cache(String
the hostname
hostname
,
DnsRecord[]
the additional records
additional
,
InetAddress
the resolved address
address
,
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.DnsCache.cache.

Create a new DnsCacheEntry and cache a resolved address for a given hostname.
public DnsCacheEntry
cache(String
the hostname
hostname
,
DnsRecord[]
the additional records
additional
,
Throwable
the resolution failure
cause
,
EventLoop
the EventLoop used to register the TTL timeout
loop
)

Implements io.netty.resolver.dns.DnsCache.cache.

Cache the resolution failure for a given hostname.
public void
clear()

Implements io.netty.resolver.dns.DnsCache.clear.

Clears all the resolved addresses cached by this resolver.
public boolean
clear(String hostname)

Implements io.netty.resolver.dns.DnsCache.clear.

Clears the resolved addresses of the specified host name from the cache of this resolver.
public List<? extends DnsCacheEntry>
get(String
the hostname
hostname
,
DnsRecord[]
the additional records
additionals
)

Implements io.netty.resolver.dns.DnsCache.get.

Return the cached entries for the given hostname.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

INSTANCEback to summary
public static final NoopDnsCache INSTANCE

Constructor Detail

NoopDnsCacheback to summary
private NoopDnsCache()

Private singleton constructor.

Method Detail

cacheback to summary
public DnsCacheEntry cache(String hostname, DnsRecord[] additional, InetAddress address, long originalTtl, EventLoop loop)

Implements io.netty.resolver.dns.DnsCache.cache.

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

Create a new DnsCacheEntry and cache a resolved address for a given hostname.

Parameters
hostname:String

the hostname

additional:DnsRecord[]

the additional records

address:InetAddress

the resolved address

originalTtl:long

the TTL as returned by the DNS server

loop:EventLoop

the EventLoop used to register the TTL timeout

Returns:DnsCacheEntry

The DnsCacheEntry corresponding to this cache entry.

Annotations
@Override
cacheback to summary
public DnsCacheEntry cache(String hostname, DnsRecord[] additional, Throwable cause, EventLoop loop)

Implements io.netty.resolver.dns.DnsCache.cache.

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

Cache the resolution failure for a given hostname. Be aware this won't be called with timeout / cancel / transport exceptions.

Parameters
hostname:String

the hostname

additional:DnsRecord[]

the additional records

cause:Throwable

the resolution failure

loop:EventLoop

the EventLoop used to register the TTL timeout

Returns:DnsCacheEntry

The DnsCacheEntry corresponding to this cache entry, or null if this cache doesn't support caching failed responses.

Annotations
@Override
clearback to summary
public void clear()

Implements io.netty.resolver.dns.DnsCache.clear.

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

Clears all the resolved addresses cached by this resolver.

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

Implements io.netty.resolver.dns.DnsCache.clear.

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

Clears the resolved addresses of the specified host name from the cache of this resolver.

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 List<? extends DnsCacheEntry> get(String hostname, DnsRecord[] additionals)

Implements io.netty.resolver.dns.DnsCache.get.

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

Return the cached entries for the given hostname.

Parameters
hostname:String

the hostname

additionals:DnsRecord[]

the additional records

Returns:List<? extends DnsCacheEntry>

the cached entries

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
io.netty.resolver.dns back to summary

private final Class NoopDnsCache.NoopDnsCacheEntry

extends Object
implements DnsCacheEntry
Class Inheritance
All Implemented Interfaces
io.netty.resolver.dns.DnsCacheEntry

Field Summary

Modifier and TypeField and Description
private final InetAddress

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public InetAddress
address()

Implements io.netty.resolver.dns.DnsCacheEntry.address.

Get the resolved address.
public Throwable
cause()

Implements io.netty.resolver.dns.DnsCacheEntry.cause.

If the DNS query failed this will provide the rational.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

addressback to summary
private final InetAddress address

Constructor Detail

NoopDnsCacheEntryback to summary
pack-priv NoopDnsCacheEntry(InetAddress address)

Method Detail

addressback to summary
public InetAddress address()

Implements io.netty.resolver.dns.DnsCacheEntry.address.

Doc from io.netty.resolver.dns.DnsCacheEntry.address.

Get the resolved address.

This may be null if the resolution failed, and in that case cause() will describe the failure.

Returns:InetAddress

the resolved address.

Annotations
@Override
causeback to summary
public Throwable cause()

Implements io.netty.resolver.dns.DnsCacheEntry.cause.

Doc from io.netty.resolver.dns.DnsCacheEntry.cause.

If the DNS query failed this will provide the rational.

Returns:Throwable

the rational for why the DNS query failed, or null if the query hasn't failed.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override