MCPcopy Create free account
hub / github.com/DeNA/PacketProxy / CacheRRset

Class CacheRRset

src/main/java/core/org/xbill/DNS/Cache.java:38–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38private static class CacheRRset extends RRset implements Element {
39 private static final long serialVersionUID = 5971755205903597024L;
40
41 int credibility;
42 int expire;
43
44 public
45 CacheRRset(Record rec, int cred, long maxttl) {
46 super();
47 this.credibility = cred;
48 this.expire = limitExpire(rec.getTTL(), maxttl);
49 addRR(rec);
50 }
51
52 public
53 CacheRRset(RRset rrset, int cred, long maxttl) {
54 super(rrset);
55 this.credibility = cred;
56 this.expire = limitExpire(rrset.getTTL(), maxttl);
57 }
58
59 public final boolean
60 expired() {
61 int now = (int)(System.currentTimeMillis() / 1000);
62 return (now >= expire);
63 }
64
65 public final int
66 compareCredibility(int cred) {
67 return credibility - cred;
68 }
69
70 public String
71 toString() {
72 StringBuffer sb = new StringBuffer();
73 sb.append(super.toString());
74 sb.append(" cl = ");
75 sb.append(credibility);
76 return sb.toString();
77 }
78}
79
80private static class NegativeElement implements Element {
81 int type;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected