use of org.onosproject.store.service.AtomicCounter in project onos by opennetworkinglab.
the class CounterCommand method doExecute.
@Override
protected void doExecute() {
StorageService storageService = get(StorageService.class);
AtomicCounter counter = storageService.getAtomicCounter(name);
if (outputJson()) {
ObjectMapper mapper = new ObjectMapper();
ObjectNode counterJsonNode = mapper.createObjectNode();
counterJsonNode.put("value", counter.get());
print("%s", counterJsonNode);
} else {
print("%d", counter.get());
}
}
Aggregations