aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/measite/minidns/DNSCache.java
blob: 14a3a77692ae4f9cc7d35c3b22fabf82471716d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package de.measite.minidns;

/**
 * Cache for DNS Entries. Implementations must be thread safe.
 */
public interface DNSCache {

    /**
     * Add an an dns answer/response for a given dns question. Implementations
     * should honor the ttl / receive timestamp.
     * @param q The question.
     * @param message The dns message.
     */
    void put(Question q, DNSMessage message);

    /**
     * Request a cached dns response.
     * @param q The dns question.
     * @return The dns message.
     */
    DNSMessage get(Question q);

}