001/*
002 * Copyright 2015-2020 the original author or authors
003 *
004 * This software is licensed under the Apache License, Version 2.0,
005 * the GNU Lesser General Public License version 2 or later ("LGPL")
006 * and the WTFPL.
007 * You may choose either license to govern your use of this software only
008 * upon the condition that you accept all of the terms of either
009 * the Apache License 2.0, the LGPL 2.1+ or the WTFPL.
010 */
011package org.minidns.cache;
012
013import org.minidns.dnsmessage.Question;
014import org.minidns.dnsname.DnsName;
015import org.minidns.record.Data;
016import org.minidns.record.Record;
017
018/**
019 * An <b>insecure</b> variant of {@link LruCache} also using all the data found in the sections of an answer.
020 */
021public class FullLruCache extends ExtendedLruCache {
022
023    public FullLruCache() {
024        this(DEFAULT_CACHE_SIZE);
025    }
026
027    public FullLruCache(int capacity) {
028        super(capacity);
029    }
030
031    public FullLruCache(int capacity, long maxTTL) {
032        super(capacity, maxTTL);
033    }
034
035    @Override
036    protected boolean shouldGather(Record<? extends Data> extraRecord, Question question, DnsName authoritativeZone) {
037        return true;
038    }
039}