use of org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction in project bgpcep by opendaylight.
the class BmpRouterPeerImpl method onStatsReports.
private synchronized void onStatsReports(final StatsReportsMessage statsReports) {
if (this.up) {
final DOMDataWriteTransaction wTx = this.domTxChain.newWriteOnlyTransaction();
wTx.merge(LogicalDatastoreType.OPERATIONAL, this.peerYangIId.node(Stats.QNAME), createStats(statsReports, statsReports.getPeerHeader().getTimestampSec()));
wTx.submit();
}
}
use of org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction in project bgpcep by opendaylight.
the class BmpRouterPeerImpl method onRouteMirror.
private synchronized void onRouteMirror(final RouteMirroringMessage mirror) {
final DOMDataWriteTransaction wTx = this.domTxChain.newWriteOnlyTransaction();
wTx.merge(LogicalDatastoreType.OPERATIONAL, this.peerYangIId.node(Mirrors.QNAME), createMirrors(mirror, mirror.getPeerHeader().getTimestampSec()));
wTx.submit();
}
use of org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction in project bgpcep by opendaylight.
the class BmpMonitoringStationImpl method createEmptyMonitor.
private synchronized void createEmptyMonitor() {
final DOMDataWriteTransaction wTx = this.domDataBroker.newWriteOnlyTransaction();
wTx.put(LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.builder().node(BmpMonitor.QNAME).node(Monitor.QNAME).nodeWithKey(Monitor.QNAME, MONITOR_ID_QNAME, this.monitorId.getValue()).build(), ImmutableNodes.mapEntryBuilder(Monitor.QNAME, MONITOR_ID_QNAME, this.monitorId.getValue()).addChild(ImmutableNodes.leafNode(MONITOR_ID_QNAME, this.monitorId.getValue())).addChild(ImmutableNodes.mapNodeBuilder(Router.QNAME).build()).build());
try {
wTx.submit().checkedGet();
} catch (final TransactionCommitFailedException e) {
LOG.error("Failed to initiate BMP Monitor {}.", this.monitorId.getValue(), e);
}
}
use of org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction in project bgpcep by opendaylight.
the class BmpRibInWriter method markTableUptodated.
private synchronized void markTableUptodated(final TablesKey tableTypes) {
final DOMDataWriteTransaction tx = this.chain.newWriteOnlyTransaction();
final TableContext ctxPre = this.tables.get(tableTypes);
tx.merge(LogicalDatastoreType.OPERATIONAL, ctxPre.getTableId().node(BMP_ATTRIBUTES_QNAME).node(ATTRIBUTES_UPTODATE_TRUE.getNodeType()), ATTRIBUTES_UPTODATE_TRUE);
tx.submit();
}
use of org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction in project controller by opendaylight.
the class SimpletxDomDelete method executeList.
@Override
public void executeList() {
final LogicalDatastoreType dsType = getDataStoreType();
final org.opendaylight.yangtools.yang.common.QName olId = QName.create(OuterList.QNAME, "id");
final YangInstanceIdentifier pid = YangInstanceIdentifier.builder().node(TestExec.QNAME).node(OuterList.QNAME).build();
DOMDataWriteTransaction tx = domDataBroker.newWriteOnlyTransaction();
long writeCnt = 0;
for (int l = 0; l < outerListElem; l++) {
YangInstanceIdentifier yid = pid.node(new NodeIdentifierWithPredicates(OuterList.QNAME, olId, l));
tx.delete(dsType, yid);
writeCnt++;
if (writeCnt == writesPerTx) {
try {
tx.submit().checkedGet();
txOk++;
} catch (final TransactionCommitFailedException e) {
LOG.error("Transaction failed: {}", e);
txError++;
}
tx = domDataBroker.newWriteOnlyTransaction();
writeCnt = 0;
}
}
if (writeCnt != 0) {
try {
tx.submit().checkedGet();
} catch (final TransactionCommitFailedException e) {
LOG.error("Transaction failed: {}", e);
}
}
}
Aggregations