Update clearTable method name to createEmptyTableStructure 51/34251/12
authorClaudio D. Gasparini <cgaspari@cisco.com>
Mon, 8 Feb 2016 11:40:54 +0000 (12:40 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 26 Feb 2016 10:22:49 +0000 (10:22 +0000)
Update clearTable method name to createEmptyTableStructure which
is more appropiate

Change-Id: I5992773e169edb538bac655a833149dda1220c3c
Signed-off-by: Claudio D. Gasparini <cgaspari@cisco.com>
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AdjRibInWriter.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/EffectiveRibInWriter.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/RIBSupportContextImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/TableContext.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/spi/RIBSupportContext.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/AdjRibsInWriterTest.java

index f4f738e118ea98aec8a03323c2c2f50e726d77b3..c6af52253e2063a35fc5918bf6c5408fceb880d9 100644 (file)
@@ -176,7 +176,7 @@ final class AdjRibInWriter {
         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());
@@ -192,7 +192,7 @@ final class AdjRibInWriter {
                 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));
         }
     }
 
index f3a01c9a544e95d1f4722b3d1415717e05ebbff1..38931ff1320c820e544dad70d5b654859db9865d 100644 (file)
@@ -194,7 +194,7 @@ final class EffectiveRibInWriter implements AutoCloseable {
 
             // 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());
         }
index b9213aa5eabfa4557fc55ec891477a18a4440dee..edff5a1bfe08f72eaaa397c69cf1c84b5f1d98a8 100644 (file)
@@ -50,8 +50,7 @@ class RIBSupportContextImpl extends RIBSupportContext {
     }
 
     @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);
index 086c145d814123040b016b4dd475ac42f325f0ec..e90be4620aaccb4b899fa4eb6d506685dfa96255 100644 (file)
@@ -37,8 +37,8 @@ final class TableContext {
     }
 
 
-    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) {
index 9c25bdaf19b4d2a48d8a2c2b02fce69a38a3ab0f..25a108471039fac47b021c13720a50a2648a5e19 100644 (file)
@@ -25,12 +25,12 @@ public abstract class RIBSupportContext {
 
     /**
      *
-     * 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.
index c095d35b862d884725ce271ecbe8427b782ffc2f..0516f81e606d786664354adeb7d1c8e4b26762ed 100644 (file)
@@ -72,7 +72,7 @@ public class AdjRibsInWriterTest {
         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);