Interface AuthoritativeDnsServerCache

All Known Implementing Classes:
AuthoritativeDnsServerCacheAdapter, DefaultAuthoritativeDnsServerCache, DnsResolveContext.RedirectAuthoritativeDnsServerCache, NoopAuthoritativeDnsServerCache

public interface AuthoritativeDnsServerCache
Cache which stores the nameservers that should be used to resolve a specific hostname.
  • Method Summary

    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
    Clears all cached nameservers.
    boolean
    clear(String hostname)
    Clears the cached nameservers for the specified hostname.
    get(String hostname)
    Returns the cached nameservers that should be used to resolve the given hostname.
  • Method Details

    • get

      Returns the cached nameservers that should be used to resolve the given hostname. The returned DnsServerAddressStream may contain unresolved InetSocketAddresses that will be resolved when needed while resolving other domain names.
      Parameters:
      hostname - the hostname
      Returns:
      the cached entries or an null if none.
    • cache

      void cache(String hostname, InetSocketAddress address, long originalTtl, EventLoop loop)
      Caches a nameserver that should be used to resolve the given hostname.
      Parameters:
      hostname - the hostname
      address - the nameserver address (which may be unresolved).
      originalTtl - the TTL as returned by the DNS server
      loop - the EventLoop used to register the TTL timeout
    • clear

      void clear()
      Clears all cached nameservers.
      See Also:
    • clear

      boolean clear(String hostname)
      Clears the cached nameservers for the specified hostname.
      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