@Override public void cache(String hostname, String cname, long originalTtl, EventLoop loop) { checkNotNull(hostname, "hostname"); checkNotNull(cname, "cname"); checkNotNull(loop, "loop"); cache.cache(hostname, cname, Math.max(minTtl, (int) Math.min(maxTtl, originalTtl)), loop); }
@Override public void cache(String hostname, InetSocketAddress address, long originalTtl, EventLoop loop) { checkNotNull(hostname, "hostname"); checkNotNull(address, "address"); checkNotNull(loop, "loop"); if (PlatformDependent.javaVersion() >= 7 && address.getHostString() == null) { // We only cache addresses that have also a host string as we will need it later when trying to replace // unresolved entries in the cache. return; } resolveCache.cache(hostname, address, Math.max(minTtl, (int) Math.min(maxTtl, originalTtl)), loop); }
@Override public void cache(String hostname, InetSocketAddress address, long originalTtl, EventLoop loop) { checkNotNull(hostname, "hostname"); checkNotNull(address, "address"); checkNotNull(loop, "loop"); if (PlatformDependent.javaVersion() >= 7 && address.getHostString() == null) { // We only cache addresses that have also a host string as we will need it later when trying to replace // unresolved entries in the cache. return; } resolveCache.cache(hostname, address, Math.max(minTtl, (int) Math.min(maxTtl, originalTtl)), loop); }
@Override public DnsCacheEntry cache(String hostname, DnsRecord[] additionals, InetAddress address, long originalTtl, EventLoop loop) { checkNotNull(hostname, "hostname"); checkNotNull(address, "address"); checkNotNull(loop, "loop"); DefaultDnsCacheEntry e = new DefaultDnsCacheEntry(hostname, address); if (maxTtl == 0 || !emptyAdditionals(additionals)) { return e; } resolveCache.cache(appendDot(hostname), e, Math.max(minTtl, (int) Math.min(maxTtl, originalTtl)), loop); return e; }
@Override public DnsCacheEntry cache(String hostname, DnsRecord[] additionals, InetAddress address, long originalTtl, EventLoop loop) { checkNotNull(hostname, "hostname"); checkNotNull(address, "address"); checkNotNull(loop, "loop"); DefaultDnsCacheEntry e = new DefaultDnsCacheEntry(hostname, address); if (maxTtl == 0 || !emptyAdditionals(additionals)) { return e; } resolveCache.cache(appendDot(hostname), e, Math.max(minTtl, (int) Math.min(maxTtl, originalTtl)), loop); return e; }
@Override public DnsCacheEntry cache(String hostname, DnsRecord[] additionals, Throwable cause, EventLoop loop) { checkNotNull(hostname, "hostname"); checkNotNull(cause, "cause"); checkNotNull(loop, "loop"); DefaultDnsCacheEntry e = new DefaultDnsCacheEntry(hostname, cause); if (negativeTtl == 0 || !emptyAdditionals(additionals)) { return e; } resolveCache.cache(appendDot(hostname), e, negativeTtl, loop); return e; }
@Override public DnsCacheEntry cache(String hostname, DnsRecord[] additionals, Throwable cause, EventLoop loop) { checkNotNull(hostname, "hostname"); checkNotNull(cause, "cause"); checkNotNull(loop, "loop"); DefaultDnsCacheEntry e = new DefaultDnsCacheEntry(hostname, cause); if (negativeTtl == 0 || !emptyAdditionals(additionals)) { return e; } resolveCache.cache(appendDot(hostname), e, negativeTtl, loop); return e; }
@Override public void cache(String hostname, String cname, long originalTtl, EventLoop loop) { checkNotNull(hostname, "hostname"); checkNotNull(cname, "cname"); checkNotNull(loop, "loop"); cache.cache(hostname, cname, Math.max(minTtl, (int) Math.min(maxTtl, originalTtl)), loop); }
@Override public void cache(String hostname, InetSocketAddress address, long originalTtl, EventLoop loop) { checkNotNull(hostname, "hostname"); checkNotNull(address, "address"); checkNotNull(loop, "loop"); if (PlatformDependent.javaVersion() >= 7 && address.getHostString() == null) { // We only cache addresses that have also a host string as we will need it later when trying to replace // unresolved entries in the cache. return; } resolveCache.cache(hostname, address, Math.max(minTtl, (int) Math.min(maxTtl, originalTtl)), loop); }
@Override public DnsCacheEntry cache(String hostname, DnsRecord[] additionals, InetAddress address, long originalTtl, EventLoop loop) { checkNotNull(hostname, "hostname"); checkNotNull(address, "address"); checkNotNull(loop, "loop"); DefaultDnsCacheEntry e = new DefaultDnsCacheEntry(hostname, address); if (maxTtl == 0 || !emptyAdditionals(additionals)) { return e; } resolveCache.cache(appendDot(hostname), e, Math.max(minTtl, (int) Math.min(maxTtl, originalTtl)), loop); return e; }
@Override public DnsCacheEntry cache(String hostname, DnsRecord[] additionals, Throwable cause, EventLoop loop) { checkNotNull(hostname, "hostname"); checkNotNull(cause, "cause"); checkNotNull(loop, "loop"); DefaultDnsCacheEntry e = new DefaultDnsCacheEntry(hostname, cause); if (negativeTtl == 0 || !emptyAdditionals(additionals)) { return e; } resolveCache.cache(appendDot(hostname), e, negativeTtl, loop); return e; }