idb.nodeWithKey(instanceIdentifierKey.getNodeType(), instanceIdentifierKey.getKeyValues());
TableContext ctx = new TableContext(rs, idb.build());
- ctx.clearTable(tx);
+ ctx.createEmptyTableStructure(tx);
tx.merge(LogicalDatastoreType.OPERATIONAL, ctx.getTableId().node(Attributes.QNAME).node(ATTRIBUTES_UPTODATE_FALSE.getNodeType()), ATTRIBUTES_UPTODATE_FALSE);
LOG.debug("Created table instance {}", ctx.getTableId());
tt.withChild(ImmutableNodes.leafNode(e.getKey(), e.getValue()));
}
tx.put(LogicalDatastoreType.OPERATIONAL, newPeerPath.node(PEER_TABLES).node(supTablesKey), tt.build());
- rs.clearTable(tx, newPeerPath.node(EMPTY_ADJRIBOUT.getIdentifier()).node(TABLES).node(instanceIdentifierKey));
+ rs.createEmptyTableStructure(tx, newPeerPath.node(EMPTY_ADJRIBOUT.getIdentifier()).node(TABLES).node(instanceIdentifierKey));
}
}
// Create an empty table
LOG.trace("Create Empty table", tablePath);
- ribSupport.clearTable(tx, tablePath);
+ ribSupport.createEmptyTableStructure(tx, tablePath);
processTableChildren(tx, ribSupport.getRibSupport(), peerKey, tablePath, table.getChildNodes());
}
}
@Override
- public void clearTable(final DOMDataWriteTransaction tx, final YangInstanceIdentifier tableId) {
- //TODO: Change this method name to createTable which is more appropriate
+ public void createEmptyTableStructure(final DOMDataWriteTransaction tx, final YangInstanceIdentifier tableId) {
final DataContainerNodeBuilder<NodeIdentifierWithPredicates, MapEntryNode> tb = ImmutableNodes.mapEntryBuilder();
tb.withNodeIdentifier((NodeIdentifierWithPredicates)tableId.getLastPathArgument());
tb.withChild(EMPTY_TABLE_ATTRIBUTES);
}
- void clearTable(final DOMDataWriteTransaction tx) {
- this.tableSupport.clearTable(tx, this.tableId);
+ void createEmptyTableStructure(final DOMDataWriteTransaction tx) {
+ this.tableSupport.createEmptyTableStructure(tx, this.tableId);
}
void removeTable(final DOMDataWriteTransaction tx) {
/**
*
- * Clears specified Rib table using supplied transaction.
+ * Create specified Rib table structure using supplied transaction.
*
* @param tx Transaction to to be used
* @param tableId Instance Identifier of table to be cleared.
*/
- public abstract void clearTable(DOMDataWriteTransaction tx, YangInstanceIdentifier tableId);
+ public abstract void createEmptyTableStructure(DOMDataWriteTransaction tx, YangInstanceIdentifier tableId);
/**
* Removes supplied routes from RIB table using supplied transaction.
Mockito.doNothing().when(this.tx).put(Mockito.eq(LogicalDatastoreType.OPERATIONAL), Mockito.any(YangInstanceIdentifier.class), Mockito.any(NormalizedNode.class));
Mockito.doNothing().when(this.tx).merge(Mockito.eq(LogicalDatastoreType.OPERATIONAL), Mockito.any(YangInstanceIdentifier.class), Mockito.any(NormalizedNode.class));
Mockito.doReturn(this.context).when(this.registry).getRIBSupportContext(Mockito.any(TablesKey.class));
- Mockito.doNothing().when(this.context).clearTable(Mockito.eq(this.tx), Mockito.any(YangInstanceIdentifier.class));
+ Mockito.doNothing().when(this.context).createEmptyTableStructure(Mockito.eq(this.tx), Mockito.any(YangInstanceIdentifier.class));
this.writer.transform(new PeerId(this.peerIp), this.registry, this.tableTypes, false);