Home / Type/ DnsCache Type — netty Architecture

DnsCache Type — netty Architecture

Architecture documentation for the DnsCache type/interface in DnsCache.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  adc06297_effa_6e0f_0ed8_e159d9c93a34["DnsCache"]
  3a7d49fb_671c_d2bc_186b_31d1c879bd11["DnsCache.java"]
  adc06297_effa_6e0f_0ed8_e159d9c93a34 -->|defined in| 3a7d49fb_671c_d2bc_186b_31d1c879bd11
  style adc06297_effa_6e0f_0ed8_e159d9c93a34 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

resolver-dns/src/main/java/io/netty/resolver/dns/DnsCache.java lines 27–76

public interface DnsCache {

    /**
     * Clears all the resolved addresses cached by this resolver.
     *
     * @see #clear(String)
     */
    void clear();

    /**
     * Clears the resolved addresses of the specified host name from the cache of this resolver.
     *
     * @return {@code 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
     */
    boolean clear(String hostname);

    /**
     * Return the cached entries for the given hostname.
     * @param hostname the hostname
     * @param additionals the additional records
     * @return the cached entries
     */
    List<? extends DnsCacheEntry> get(String hostname, DnsRecord[] additionals);

    /**
     * Create a new {@link DnsCacheEntry} and cache a resolved address for a given hostname.
     * @param hostname the hostname
     * @param additionals the additional records
     * @param address the resolved address
     * @param originalTtl the TTL as returned by the DNS server
     * @param loop the {@link EventLoop} used to register the TTL timeout
     * @return The {@link DnsCacheEntry} corresponding to this cache entry.
     */
    DnsCacheEntry cache(String hostname, DnsRecord[] additionals, InetAddress address, long originalTtl,
                        EventLoop loop);

    /**
     * Cache the resolution failure for a given hostname.
     * Be aware this <strong>won't</strong> be called with timeout / cancel / transport exceptions.
      *
     * @param hostname the hostname
     * @param additionals the additional records
     * @param cause the resolution failure
     * @param loop the {@link EventLoop} used to register the TTL timeout
     * @return The {@link DnsCacheEntry} corresponding to this cache entry, or {@code null} if this cache doesn't
     * support caching failed responses.
     */
    DnsCacheEntry cache(String hostname, DnsRecord[] additionals, Throwable cause, EventLoop loop);
}

Frequently Asked Questions

What is the DnsCache type?
DnsCache is a type/interface in the netty codebase, defined in resolver-dns/src/main/java/io/netty/resolver/dns/DnsCache.java.
Where is DnsCache defined?
DnsCache is defined in resolver-dns/src/main/java/io/netty/resolver/dns/DnsCache.java at line 27.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free