use of org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates in project bgpcep by opendaylight.
the class BmpRouterImpl method createRouterEntry.
private synchronized void createRouterEntry() {
Preconditions.checkState(isDatastoreWritable());
final DOMDataWriteTransaction wTx = this.domTxChain.newWriteOnlyTransaction();
wTx.put(LogicalDatastoreType.OPERATIONAL, this.routerYangIId, Builders.mapEntryBuilder().withNodeIdentifier(new NodeIdentifierWithPredicates(Router.QNAME, ROUTER_ID_QNAME, this.routerIp)).withChild(ImmutableNodes.leafNode(ROUTER_ID_QNAME, this.routerIp)).withChild(ImmutableNodes.leafNode(ROUTER_STATUS_QNAME, DOWN)).withChild(ImmutableNodes.mapNodeBuilder(Peer.QNAME).build()).build());
wTx.submit();
}
use of org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates in project bgpcep by opendaylight.
the class RibSupportUtilsTest method toYangPathKey.
@Test
public void toYangPathKey() {
final NodeIdentifierWithPredicates result = RibSupportUtils.toYangPathKey(SupportedTables.QNAME, AFI, SAFI);
assertEquals(NII_PATH.toString(), result.toString());
}
use of org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates in project bgpcep by opendaylight.
the class TableContext method createTable.
void createTable(final DOMDataWriteTransaction tx) {
final DataContainerNodeBuilder<NodeIdentifierWithPredicates, MapEntryNode> tb = ImmutableNodes.mapEntryBuilder();
tb.withNodeIdentifier((NodeIdentifierWithPredicates) this.tableId.getLastPathArgument());
tb.withChild(EMPTY_TABLE_ATTRIBUTES);
// tableId is keyed, but that fact is not directly visible from YangInstanceIdentifier, see BUG-2796
final NodeIdentifierWithPredicates tableKey = (NodeIdentifierWithPredicates) this.tableId.getLastPathArgument();
for (final Map.Entry<QName, Object> e : tableKey.getKeyValues().entrySet()) {
tb.withChild(ImmutableNodes.leafNode(e.getKey(), e.getValue()));
}
final ChoiceNode routes = this.tableSupport.emptyRoutes();
Verify.verifyNotNull(routes, "Null empty routes in %s", this.tableSupport);
tx.put(LogicalDatastoreType.OPERATIONAL, this.tableId, tb.withChild(ImmutableChoiceNodeBuilder.create(routes).withNodeIdentifier(new NodeIdentifier(TablesUtil.BMP_ROUTES_QNAME)).build()).build());
}
use of org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates in project bgpcep by opendaylight.
the class IdentifierUtilsTest method testPeerKey.
@Test
public void testPeerKey() throws Exception {
final NodeIdentifierWithPredicates result = IdentifierUtils.peerKey(YII_PEER);
assertEquals(NIWP_PEER, result);
}
use of org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates in project bgpcep by opendaylight.
the class IdentifierUtilsTest method testTableKey.
@Test
public void testTableKey() throws Exception {
final NodeIdentifierWithPredicates result = IdentifierUtils.tableKey(YII_TABLE);
assertEquals(NIWP_TABLE, result);
}
Aggregations