Debian Codegraph @

minidns-client/src/main/java/org/minidns/cache/FullLruCache.java

raw
1 /*
2 * Copyright 2015-2020 the original author or authors
3 *
4 * This software is licensed under the Apache License, Version 2.0,
5 * the GNU Lesser General Public License version 2 or later ("LGPL")
6 * and the WTFPL.
7 * You may choose either license to govern your use of this software only
8 * upon the condition that you accept all of the terms of either
9 * the Apache License 2.0, the LGPL 2.1+ or the WTFPL.
10 */
11 package org.minidns.cache;
12
13 import org.minidns.dnsmessage.Question;
14 import org.minidns.dnsname.DnsName;
15 import org.minidns.record.Data;
16 import org.minidns.record.Record;
17
18 /**
19 * An <b>insecure</b> variant of {@link LruCache} also using all the data found in the sections of an answer.
20 */
21 public class FullLruCache extends ExtendedLruCache {
22
23 public FullLruCache() {
24 this(DEFAULT_CACHE_SIZE);
25 }
26
27 public FullLruCache(int capacity) {
28 super(capacity);
29 }
30
31 public FullLruCache(int capacity, long maxTTL) {
32 super(capacity, maxTTL);
33 }
34
35 @Override
36 protected boolean shouldGather(Record<? extends Data> extraRecord, Question question, DnsName authoritativeZone) {
37 return true;
38 }
39 }