Interface DnsCache

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      DnsCacheEntry cache​(java.lang.String hostname, DnsRecord[] additionals, java.lang.Throwable cause, EventLoop loop)
      Cache the resolution failure for a given hostname.
      DnsCacheEntry cache​(java.lang.String hostname, DnsRecord[] additionals, 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.
    • Method Detail

      • clear

        void clear()
        Clears all the resolved addresses cached by this resolver.
        See Also:
        clear(String)
      • clear

        boolean clear​(java.lang.String hostname)
        Clears the resolved addresses of the specified host name from the cache of this resolver.
        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

        java.util.List<? extends DnsCacheEntry> get​(java.lang.String hostname,
                                                    DnsRecord[] additionals)
        Return the cached entries for the given hostname.
        Parameters:
        hostname - the hostname
        additionals - the additional records
        Returns:
        the cached entries
      • cache

        DnsCacheEntry cache​(java.lang.String hostname,
                            DnsRecord[] additionals,
                            java.net.InetAddress address,
                            long originalTtl,
                            EventLoop loop)
        Create a new DnsCacheEntry and cache a resolved address for a given hostname.
        Parameters:
        hostname - the hostname
        additionals - 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

        DnsCacheEntry cache​(java.lang.String hostname,
                            DnsRecord[] additionals,
                            java.lang.Throwable cause,
                            EventLoop loop)
        Cache the resolution failure for a given hostname. Be aware this won't be called with timeout / cancel / transport exceptions.
        Parameters:
        hostname - the hostname
        additionals - 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.