MCPcopy Create free account
hub / github.com/annmuor/jnode / store

Method store

jnode-core/src/jnode/report/ConnectionStatData.java:62–77  ·  view source on GitHub ↗
(FtnAddress ftnAddress, ConnectionStatDataElement element)

Source from the content-addressed store, hash-verified

60 }
61
62 public void store(FtnAddress ftnAddress, ConnectionStatDataElement element) {
63 synchronized (ConnectionStatData.class) {
64 List<ConnectionStatDataElement> elements = internalLoad();
65 int pos = findPos(ftnAddress, elements);
66 if (pos == -1) {
67 elements.add(element);
68 } else {
69 elements.set(pos, element);
70 }
71 try {
72 XMLSerializer.write(elements, statPath);
73 } catch (FileNotFoundException e) {
74 logger.l2(MessageFormat.format("file {0} not found, fail store data", statPath), e);
75 }
76 }
77 }
78
79 public int findPos(FtnAddress ftnAddress, List<ConnectionStatDataElement> elements) {
80 int pos = -1;

Callers 4

testStoreMethod · 0.95
testStore2Method · 0.95
handleMethod · 0.95
actionPerformedMethod · 0.80

Calls 7

internalLoadMethod · 0.95
findPosMethod · 0.95
writeMethod · 0.95
setMethod · 0.80
l2Method · 0.80
formatMethod · 0.80
addMethod · 0.45

Tested by 2

testStoreMethod · 0.76
testStore2Method · 0.76