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

Method addRR

src/main/java/core/org/xbill/DNS/RRset.java:68–95  ·  view source on GitHub ↗

Adds a Record to an RRset

(Record r)

Source from the content-addressed store, hash-verified

66
67/** Adds a Record to an RRset */
68public synchronized void
69addRR(Record r) {
70 if (rrs.size() == 0) {
71 safeAddRR(r);
72 return;
73 }
74 Record first = first();
75 if (!r.sameRRset(first))
76 throw new IllegalArgumentException("record does not match " +
77 "rrset");
78
79 if (r.getTTL() != first.getTTL()) {
80 if (r.getTTL() > first.getTTL()) {
81 r = r.cloneRecord();
82 r.setTTL(first.getTTL());
83 } else {
84 for (int i = 0; i < rrs.size(); i++) {
85 Record tmp = (Record) rrs.get(i);
86 tmp = tmp.cloneRecord();
87 tmp.setTTL(r.getTTL());
88 rrs.set(i, tmp);
89 }
90 }
91 }
92
93 if (!rrs.contains(r))
94 safeAddRR(r);
95}
96
97/** Deletes a Record from an RRset */
98public synchronized void

Callers 4

addRecordMethod · 0.95
getSectionRRsetsMethod · 0.95
CacheRRsetMethod · 0.80
addRecordMethod · 0.80

Calls 11

safeAddRRMethod · 0.95
firstMethod · 0.95
getTTLMethod · 0.95
cloneRecordMethod · 0.95
setTTLMethod · 0.95
sameRRsetMethod · 0.80
sizeMethod · 0.45
getTTLMethod · 0.45
getMethod · 0.45
setMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected