Class NoopDnsCache

  • All Implemented Interfaces:
    DnsCache

    public final class NoopDnsCache
    extends java.lang.Object
    implements DnsCache
    A noop DNS cache that actually never caches anything.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      DnsCacheEntry cache​(java.lang.String hostname, DnsRecord[] additional, java.lang.Throwable cause, EventLoop loop)
      Cache the resolution failure for a given hostname.
      DnsCacheEntry cache​(java.lang.String hostname, DnsRecord[] additional, java.net.InetAddress address, long originalTtl, EventLoop loop)
      Create a new DnsCacheEntry and cache a resolved address for a given hostname.
      void clear()
      Clears all the resolved addresses cached by this resolver.
      boolean clear​(java.lang.String hostname)
      Clears the resolved addresses of the specified host name from the cache of this resolver.
      java.util.List<? extends DnsCacheEntry> get​(java.lang.String hostname, DnsRecord[] additionals)
      Return the cached entries for the given hostname.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • clear

        public boolean clear​(java.lang.String hostname)
        Description copied from interface: DnsCache
        Clears the resolved addresses of the specified host name from the cache of this resolver.
        Specified by:
        clear in interface DnsCache
        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
      • get

        public java.util.List<? extends DnsCacheEntry> get​(java.lang.String hostname,
                                                           DnsRecord[] additionals)
        Description copied from interface: DnsCache
        Return the cached entries for the given hostname.
        Specified by:
        get in interface DnsCache
        Parameters:
        hostname - the hostname
        additionals - the additional records
        Returns:
        the cached entries
      • cache

        public DnsCacheEntry cache​(java.lang.String hostname,
                                   DnsRecord[] additional,
                                   java.net.InetAddress address,
                                   long originalTtl,
                                   EventLoop loop)
        Description copied from interface: DnsCache
        Create a new DnsCacheEntry and cache a resolved address for a given hostname.
        Specified by:
        cache in interface DnsCache
        Parameters:
        hostname - the hostname
        additional - the additional records
        address - the resolved address
        originalTtl - the TTL as returned by the DNS server
        loop - the EventLoop used to register the TTL timeout
        Returns:
        The DnsCacheEntry corresponding to this cache entry.
      • cache

        public DnsCacheEntry cache​(java.lang.String hostname,
                                   DnsRecord[] additional,
                                   java.lang.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 interface DnsCache
        Parameters:
        hostname - the hostname
        additional - the additional records
        cause - the resolution failure
        loop - the EventLoop used to register the TTL timeout
        Returns:
        The DnsCacheEntry corresponding to this cache entry, or null if this cache doesn't support caching failed responses.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object