use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.data.change.counter.rev160315.data.change.counter.CounterBuilder in project bgpcep by opendaylight.
the class TopologyDataChangeCounter method putCount.
private void putCount(final long totalCount) {
final WriteTransaction wTx = this.transactionChain.newWriteOnlyTransaction();
final Counter counter = new CounterBuilder().setId(this.counterId).setCount(Uint32.valueOf(totalCount)).build();
wTx.put(LogicalDatastoreType.OPERATIONAL, this.counterInstanceId, counter);
wTx.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
public void onSuccess(final CommitInfo result) {
LOG.debug("Data change count update stored");
}
@Override
public void onFailure(final Throwable trw) {
LOG.error("Failed to store Data change count");
}
}, MoreExecutors.directExecutor());
}
Aggregations