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

Method addRRset

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

Adds an RRset to the Cache. @param rrset The RRset to be added @param cred The credibility of these records @see RRset

(RRset rrset, int cred)

Source from the content-addressed store, hash-verified

348 * @see RRset
349 */
350public synchronized void
351addRRset(RRset rrset, int cred) {
352 long ttl = rrset.getTTL();
353 Name name = rrset.getName();
354 int type = rrset.getType();
355 Element element = findElement(name, type, 0);
356 if (ttl == 0) {
357 if (element != null && element.compareCredibility(cred) <= 0)
358 removeElement(name, type);
359 } else {
360 if (element != null && element.compareCredibility(cred) <= 0)
361 element = null;
362 if (element == null) {
363 CacheRRset crrset;
364 if (rrset instanceof CacheRRset)
365 crrset = (CacheRRset) rrset;
366 else
367 crrset = new CacheRRset(rrset, cred, maxcache);
368 addElement(name, crrset);
369 }
370 }
371}
372
373/**
374 * Adds a negative entry to the Cache.

Callers 2

addRecordMethod · 0.95
addMessageMethod · 0.95

Calls 7

findElementMethod · 0.95
compareCredibilityMethod · 0.95
removeElementMethod · 0.95
addElementMethod · 0.95
getNameMethod · 0.65
getTypeMethod · 0.65
getTTLMethod · 0.45

Tested by

no test coverage detected