YangInstanceIdentifier testResultPid = testResultsPid.node(new NodeIdentifierWithPredicates(TEST_RESULT_QNAME, resultNode.getIdentifier().getKeyValues()));
private CharSequence convertToRestconfIdentifierWithPredicates(final NodeIdentifierWithPredicates argument, final ListSchemaNode node, final DOMMountPoint mount) { final QName nodeType = argument.getNodeType(); final CharSequence nodeIdentifier = this.toRestconfIdentifier(nodeType, mount); final Map<QName, Object> keyValues = argument.getKeyValues();
YangInstanceIdentifier yid = pid.node(new NodeIdentifierWithPredicates(OuterList.QNAME, element.getIdentifier().getKeyValues()));
pid.node(new NodeIdentifierWithPredicates(OuterList.QNAME, element.getIdentifier().getKeyValues()));
for (Entry<QName, Object> entry : ((NodeIdentifierWithPredicates) arg).getKeyValues().entrySet()) { sb.append('['); appendQName(sb, entry.getKey(), lastModule);
for (Entry<QName, Object> entry : ((NodeIdentifierWithPredicates) arg).getKeyValues().entrySet()) { sb.append('['); appendQName(sb, entry.getKey(), lastModule);
writeIdentifierWithNamespacePrefix(element, textContent, pathArgument.getNodeType(), prefixes); if (pathArgument instanceof NodeIdentifierWithPredicates) { final Map<QName, Object> predicates = ((NodeIdentifierWithPredicates) pathArgument).getKeyValues(); for (final QName keyValue : predicates.keySet()) { final String predicateValue = String.valueOf(predicates.get(keyValue));
new YangInstanceIdentifier.NodeIdentifierWithPredicates( QNameFactory.create(qNameToString(context, pathArgument.getNodeType())), toAttributesMap(context, pathArgument.getAttributeList()));
final Set<QName> qnames = node.getIdentifier().getKeyValues().keySet();
final Set<QName> qnames = node.getIdentifier().getKeyValues().keySet();
pid.node(new NodeIdentifierWithPredicates(OuterList.QNAME, element.getIdentifier().getKeyValues()));
new NodeIdentifierWithPredicates(Rib.QNAME, RIB_ID_QNAME, this.ribId .getValue())) .addChild(ImmutableNodes.leafNode(RIB_ID_QNAME, this.ribId .getValue())) .addChild(ImmutableNodes.mapNodeBuilder(Peer.QNAME).build())
final Set<QName> qnames = node.getIdentifier().getKeyValues().keySet();
.node(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.yangpush.rev150105.push.updates.PushUpdate.QNAME).build(); NodeIdentifierWithPredicates p = new NodeIdentifierWithPredicates( QName.create(PushUpdates.QNAME, "push-update"), QName.create(PushUpdates.QNAME, "subscription-id"), YangInstanceIdentifier yid = pid.node(new NodeIdentifierWithPredicates(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.yangpush.rev150105.push.updates.PushUpdate.QNAME, men.getIdentifier().getKeyValues())); tx.merge(LogicalDatastoreType.CONFIGURATION, yid, men);
writeQName(nodeIdentifierWithPredicates.getNodeType()); writeKeyValueMap(nodeIdentifierWithPredicates.getKeyValues()); break;
/** * Create new table instance * * @param tableTypes * @param yangTableRootIId * @param tx * @param registry * @return */ private ImmutableMap.Builder<TablesKey, TableContext> createTableInstance(final Set<TablesKey> tableTypes, final YangInstanceIdentifier yangTableRootIId, final DOMDataWriteTransaction tx, final RIBExtensionConsumerContext ribExtensions, final BindingCodecTree tree) { final ImmutableMap.Builder<TablesKey, TableContext> tb = ImmutableMap.builder(); for (final TablesKey k : tableTypes) { final RIBSupport rs = ribExtensions.getRIBSupport(k); if (rs == null) { LOG.warn("No support for table type {}, skipping it", k); continue; } final InstanceIdentifierBuilder idb = YangInstanceIdentifier.builder(yangTableRootIId); final NodeIdentifierWithPredicates key = TablesUtil.toYangTablesKey(k); idb.nodeWithKey(key.getNodeType(), key.getKeyValues()); final TableContext ctx = new TableContext(rs, idb.build(), tree); ctx.createTable(tx); tx.put(LogicalDatastoreType.OPERATIONAL, ctx.getTableId().node(BMP_ATTRIBUTES_QNAME).node(ATTRIBUTES_UPTODATE_FALSE.getNodeType()), ATTRIBUTES_UPTODATE_FALSE); LOG.debug("Created table instance {}", ctx.getTableId()); tb.put(k, ctx); } return tb; }
YangInstanceIdentifier yid = pid.node(new NodeIdentifierWithPredicates(OuterList.QNAME, element.getIdentifier().getKeyValues()));
YangInstanceIdentifier yid = pid.node(new NodeIdentifierWithPredicates(OuterList.QNAME, olId, l));
@Override public void writePathArgument(final PathArgument pathArgument) throws IOException { byte type = PathArgumentTypes.getSerializablePathArgumentType(pathArgument); output.writeByte(type); switch(type) { case PathArgumentTypes.NODE_IDENTIFIER: NodeIdentifier nodeIdentifier = (NodeIdentifier) pathArgument; writeQName(nodeIdentifier.getNodeType()); break; case PathArgumentTypes.NODE_IDENTIFIER_WITH_PREDICATES: NodeIdentifierWithPredicates nodeIdentifierWithPredicates = (NodeIdentifierWithPredicates) pathArgument; writeQName(nodeIdentifierWithPredicates.getNodeType()); writeKeyValueMap(nodeIdentifierWithPredicates.getKeyValues()); break; case PathArgumentTypes.NODE_IDENTIFIER_WITH_VALUE : NodeWithValue<?> nodeWithValue = (NodeWithValue<?>) pathArgument; writeQName(nodeWithValue.getNodeType()); writeObject(nodeWithValue.getValue()); break; case PathArgumentTypes.AUGMENTATION_IDENTIFIER : AugmentationIdentifier augmentationIdentifier = (AugmentationIdentifier) pathArgument; // No Qname in augmentation identifier writeQNameSet(augmentationIdentifier.getPossibleChildNames()); break; default : throw new IllegalStateException("Unknown node identifier type is found : " + pathArgument.getClass().toString() ); } }
private void startLocRib(final TablesKey key, final PolicyDatabase pd) { LOG.debug("Creating LocRib table for {}", key); // create locRibWriter for each table final DOMDataWriteTransaction tx = this.domChain.newWriteOnlyTransaction(); final DataContainerNodeBuilder<NodeIdentifierWithPredicates, MapEntryNode> table = ImmutableNodes.mapEntryBuilder(); table.withNodeIdentifier(RibSupportUtils.toYangTablesKey(key)); table.withChild(EMPTY_TABLE_ATTRIBUTES); final NodeIdentifierWithPredicates tableKey = RibSupportUtils.toYangTablesKey(key); final InstanceIdentifierBuilder tableId = YangInstanceIdentifier.builder(this.yangRibId.node(LocRib.QNAME).node(Tables.QNAME)); tableId.nodeWithKey(tableKey.getNodeType(), tableKey.getKeyValues()); for (final Entry<QName, Object> e : tableKey.getKeyValues().entrySet()) { table.withChild(ImmutableNodes.leafNode(e.getKey(), e.getValue())); } final ChoiceNode routes = this.ribContextRegistry.getRIBSupportContext(key).getRibSupport().emptyRoutes(); table.withChild(routes); tx.put(LogicalDatastoreType.OPERATIONAL, tableId.build(), table.build()); try { tx.submit().checkedGet(); } catch (final TransactionCommitFailedException e1) { LOG.error("Failed to initiate LocRIB for key {}", key, e1); } PathSelectionMode pathSelectionStrategy = this.bestPathSelectionStrategies.get(key); if (pathSelectionStrategy == null) { pathSelectionStrategy = BasePathSelectionModeFactory.createBestPathSelectionStrategy(); } this.locRibs.add(LocRibWriter.create(this.ribContextRegistry, key, createPeerChain(this), getYangRibId(), this.localAs, getService(), pd, this.cacheDisconnectedPeers, pathSelectionStrategy, this.renderStats.getLocRibRouteCounter().init(key))); }