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

Method addRecord

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

Adds a record to the Cache. @param r The record to be added @param cred The credibility of the record @param o The source of the record (this could be a Message, for example) @see Record

(Record r, int cred, Object o)

Source from the content-addressed store, hash-verified

324 * @see Record
325 */
326public synchronized void
327addRecord(Record r, int cred, Object o) {
328 Name name = r.getName();
329 int type = r.getRRsetType();
330 if (!Type.isRR(type))
331 return;
332 Element element = findElement(name, type, cred);
333 if (element == null) {
334 CacheRRset crrset = new CacheRRset(r, cred, maxcache);
335 addRRset(crrset, cred);
336 } else if (element.compareCredibility(cred) == 0) {
337 if (element instanceof CacheRRset) {
338 CacheRRset crrset = (CacheRRset) element;
339 crrset.addRR(r);
340 }
341 }
342}
343
344/**
345 * Adds an RRset to the Cache.

Callers 1

CacheMethod · 0.95

Calls 7

isRRMethod · 0.95
findElementMethod · 0.95
addRRsetMethod · 0.95
compareCredibilityMethod · 0.95
getRRsetTypeMethod · 0.80
addRRMethod · 0.80
getNameMethod · 0.65

Tested by

no test coverage detected