@Test public void testExpireWithToBigMinTTL() { EventLoopGroup group = new NioEventLoopGroup(1); try { EventLoop loop = group.next(); final DefaultDnsCache cache = new DefaultDnsCache(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE); assertNotNull(cache.cache("netty.io", null, NetUtil.LOCALHOST, 100, loop)); } finally { group.shutdownGracefully(); } }
@Override public DnsCacheEntry cache(String hostname, DnsRecord[] additionals, InetAddress address, long originalTtl, EventLoop loop) { checkNotNull(hostname, "hostname"); checkNotNull(address, "address"); checkNotNull(loop, "loop"); final DefaultDnsCacheEntry e = new DefaultDnsCacheEntry(hostname, address); if (maxTtl == 0 || !emptyAdditionals(additionals)) { return e; } cache0(e, Math.max(minTtl, Math.min(MAX_SUPPORTED_TTL_SECS, (int) Math.min(maxTtl, originalTtl))), loop); return e; }
DefaultDnsCache implements DnsCache { @Override public DnsCacheEntry cache(String hostname, DnsRecord[] additionals, InetAddress address, long originalTtl, EventLoop loop) { checkNotNull(hostname, "hostname"); checkNotNull(address, "address"); checkNotNull(loop, "loop"); final DefaultDnsCacheEntry e = new DefaultDnsCacheEntry(hostname, address); if (maxTtl == 0 || !emptyAdditionals(additionals)) { return e; } cache0(e, Math.max(minTtl, Math.min(MAX_SUPPORTED_TTL_SECS, (int) Math.min(maxTtl, originalTtl))), loop); return e; } }
DefaultDnsCache implements DnsCache { @Override public DnsCacheEntry cache(String hostname, DnsRecord[] additionals, InetAddress address, long originalTtl, EventLoop loop) { checkNotNull(hostname, "hostname"); checkNotNull(address, "address"); checkNotNull(loop, "loop"); final DefaultDnsCacheEntry e = new DefaultDnsCacheEntry(hostname, address); if (maxTtl == 0 || !emptyAdditionals(additionals)) { return e; } cache0(e, Math.max(minTtl, Math.min(MAX_SUPPORTED_TTL_SECS, (int) Math.min(maxTtl, originalTtl))), loop); return e; } DefaultDnsCache();  DefaultDnsCache(int minTtl, int maxTtl, int negativeTtl); }
DefaultDnsCache implements DnsCache { @Override public DnsCacheEntry cache(String hostname, DnsRecord[] additionals, InetAddress address, long originalTtl, EventLoop loop) { checkNotNull(hostname, "hostname"); checkNotNull(address, "address"); checkNotNull(loop, "loop"); final DefaultDnsCacheEntry e = new DefaultDnsCacheEntry(hostname, address); if (maxTtl == 0 || !emptyAdditionals(additionals)) { return e; } cache0(e, Math.max(minTtl, Math.min(MAX_SUPPORTED_TTL_SECS, (int) Math.min(maxTtl, originalTtl))), loop); return e; } DefaultDnsCache();  DefaultDnsCache(int minTtl, int maxTtl, int negativeTtl); int minTtl(); int maxTtl(); int negativeTtl(); @Override void clear(); @Override boolean clear(String hostname); @Override List<? extends DnsCacheEntry> get(String hostname, DnsRecord[] additionals); @Override DnsCacheEntry cache(String hostname, DnsRecord[] additionals,
                               InetAddress address, long originalTtl, EventLoop loop); @Override DnsCacheEntry cache(String hostname, DnsRecord[] additionals, Throwable cause, EventLoop loop); @Override String toString(); }
DefaultDnsCache implements DnsCache { @Override public DnsCacheEntry cache(String hostname, DnsRecord[] additionals, InetAddress address, long originalTtl, EventLoop loop) { checkNotNull(hostname, "hostname"); checkNotNull(address, "address"); checkNotNull(loop, "loop"); final DefaultDnsCacheEntry e = new DefaultDnsCacheEntry(hostname, address); if (maxTtl == 0 || !emptyAdditionals(additionals)) { return e; } cache0(e, Math.max(minTtl, Math.min(MAX_SUPPORTED_TTL_SECS, (int) Math.min(maxTtl, originalTtl))), loop); return e; } DefaultDnsCache();  DefaultDnsCache(int minTtl, int maxTtl, int negativeTtl); int minTtl(); int maxTtl(); int negativeTtl(); @Override void clear(); @Override boolean clear(String hostname); @Override List<? extends DnsCacheEntry> get(String hostname, DnsRecord[] additionals); @Override DnsCacheEntry cache(String hostname, DnsRecord[] additionals,
                               InetAddress address, long originalTtl, EventLoop loop); @Override DnsCacheEntry cache(String hostname, DnsRecord[] additionals, Throwable cause, EventLoop loop); @Override String toString();  }