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

Method addNegative

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

Adds a negative entry to the Cache. @param name The name of the negative entry @param type The type of the negative entry @param soa The SOA record to add to the negative cache entry, or null. The negative cache ttl is derived from the SOA. @param cred The credibility of the negative entry

(Name name, int type, SOARecord soa, int cred)

Source from the content-addressed store, hash-verified

379 * @param cred The credibility of the negative entry
380 */
381public synchronized void
382addNegative(Name name, int type, SOARecord soa, int cred) {
383 long ttl = 0;
384 if (soa != null)
385 ttl = soa.getTTL();
386 Element element = findElement(name, type, 0);
387 if (ttl == 0) {
388 if (element != null && element.compareCredibility(cred) <= 0)
389 removeElement(name, type);
390 } else {
391 if (element != null && element.compareCredibility(cred) <= 0)
392 element = null;
393 if (element == null)
394 addElement(name, new NegativeElement(name, type,
395 soa, cred,
396 maxncache));
397 }
398}
399
400/**
401 * Finds all matching sets or something that causes the lookup to stop.

Callers 1

addMessageMethod · 0.95

Calls 5

findElementMethod · 0.95
compareCredibilityMethod · 0.95
removeElementMethod · 0.95
addElementMethod · 0.95
getTTLMethod · 0.45

Tested by

no test coverage detected