- public void clearTable(final DOMDataWriteTransaction tx, final YangInstanceIdentifier tableId) {
- final DataContainerNodeBuilder<NodeIdentifierWithPredicates, MapEntryNode> tb = ImmutableNodes.mapEntryBuilder();
- tb.withNodeIdentifier((NodeIdentifierWithPredicates)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) tableId.getLastPathArgument();
- for (final Entry<QName, Object> e : tableKey.getKeyValues().entrySet()) {
- tb.withChild(ImmutableNodes.leafNode(e.getKey(), e.getValue()));
- }
-
- final ChoiceNode routes = this.ribSupport.emptyRoutes();
- Verify.verifyNotNull(routes, "Null empty routes in %s", this.ribSupport);
- Verify.verify(Routes.QNAME.equals(routes.getNodeType()), "Empty routes have unexpected identifier %s, expected %s", routes.getNodeType(), Routes.QNAME);
-
- tx.put(LogicalDatastoreType.OPERATIONAL, tableId, tb.withChild(routes).build());
+ public void createEmptyTableStructure(final DOMDataTreeWriteTransaction tx, final YangInstanceIdentifier tableId) {
+ tx.put(LogicalDatastoreType.OPERATIONAL, tableId, this.ribSupport.emptyTable());