Home / Class/ TestDnsCache Class — netty Architecture

TestDnsCache Class — netty Architecture

Architecture documentation for the TestDnsCache class in DnsNameResolverTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  e718a74f_2c80_b4ee_16ae_9c9c2ccd8449["TestDnsCache"]
  a522ba1b_7e05_723d_0457_5085cd62d3eb["DnsNameResolverTest.java"]
  e718a74f_2c80_b4ee_16ae_9c9c2ccd8449 -->|defined in| a522ba1b_7e05_723d_0457_5085cd62d3eb
  8de78b96_8178_df5a_31b9_4ea9b6066653["TestDnsCache()"]
  e718a74f_2c80_b4ee_16ae_9c9c2ccd8449 -->|method| 8de78b96_8178_df5a_31b9_4ea9b6066653
  7d02bf28_bd2a_fb23_1635_06d01547aca1["clear()"]
  e718a74f_2c80_b4ee_16ae_9c9c2ccd8449 -->|method| 7d02bf28_bd2a_fb23_1635_06d01547aca1
  f68a278a_d1e5_7598_a2d3_c261c81029bc["get()"]
  e718a74f_2c80_b4ee_16ae_9c9c2ccd8449 -->|method| f68a278a_d1e5_7598_a2d3_c261c81029bc
  a1351976_5641_8ead_2862_52affd483f01["DnsCacheEntry()"]
  e718a74f_2c80_b4ee_16ae_9c9c2ccd8449 -->|method| a1351976_5641_8ead_2862_52affd483f01

Relationship Graph

Source Code

resolver-dns/src/test/java/io/netty/resolver/dns/DnsNameResolverTest.java lines 2314–2350

    private static final class TestDnsCache implements DnsCache {
        final DnsCache cache;
        final Map<String, List<? extends DnsCacheEntry>> cacheHits =
                new HashMap<String, List<? extends DnsCacheEntry>>();

        TestDnsCache(DnsCache cache) {
            this.cache = cache;
        }

        @Override
        public void clear() {
            cache.clear();
        }

        @Override
        public boolean clear(String hostname) {
            return cache.clear(hostname);
        }

        @Override
        public List<? extends DnsCacheEntry> get(String hostname, DnsRecord[] additionals) {
            List<? extends DnsCacheEntry> cached = cache.get(hostname, additionals);
            cacheHits.put(hostname, cached);
            return cached;
        }

        @Override
        public DnsCacheEntry cache(String hostname, DnsRecord[] additionals, InetAddress address,
                                   long originalTtl, EventLoop loop) {
            return cache.cache(hostname, additionals, address, originalTtl, loop);
        }

        @Override
        public DnsCacheEntry cache(String hostname, DnsRecord[] additionals, Throwable cause, EventLoop loop) {
            return cache.cache(hostname, additionals, cause, loop);
        }
    }

Frequently Asked Questions

What is the TestDnsCache class?
TestDnsCache is a class in the netty codebase, defined in resolver-dns/src/test/java/io/netty/resolver/dns/DnsNameResolverTest.java.
Where is TestDnsCache defined?
TestDnsCache is defined in resolver-dns/src/test/java/io/netty/resolver/dns/DnsNameResolverTest.java at line 2314.

Analyze Your Own Codebase

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

Try Supermodel Free