BUG-2399: handle new ModificationTypes 01/27101/2
authorRobert Varga <rovarga@cisco.com>
Thu, 17 Sep 2015 02:41:28 +0000 (04:41 +0200)
committerRobert Varga <nite@hq.sk>
Thu, 17 Sep 2015 16:05:58 +0000 (16:05 +0000)
The set of possible modification types has expanded with automatic
structural container lifecycle. Account for the new types in our
switch statements.

Change-Id: I7e6a78acfb87c9f5916ec83e7f10b9e271c24093
Signed-off-by: Robert Varga <rovarga@cisco.com>
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AdjRibOutListener.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/EffectiveRibInWriter.java

index d1fcc0ba0e8ec4837b77d92c1b4aa488ebcbdd2c..c1b57205c60527b0a027f1f7829dc2d20b2b5808 100644 (file)
@@ -90,9 +90,11 @@ final class AdjRibOutListener implements DOMDataTreeChangeListener {
                         LOG.debug("Skipping unmodified route {}", route.getIdentifier());
                         continue;
                     case DELETE:
+                    case DISAPPEARED:
                         // FIXME: we can batch deletions into a single batch
                         update = withdraw((MapEntryNode) route.getDataBefore().get());
                         break;
+                    case APPEARED:
                     case SUBTREE_MODIFIED:
                     case WRITE:
                         update = advertise((MapEntryNode) route.getDataAfter().get());
index dfaaeea77f7c61ed3f16703f627b688c0fc8c727..ae0df9c5ffd0552235a4132dffd41e458a91b371 100644 (file)
@@ -84,11 +84,13 @@ final class EffectiveRibInWriter implements AutoCloseable {
             final YangInstanceIdentifier routeId = ribSupport.routePath(routesPath, route.getIdentifier());
             switch (route.getModificationType()) {
             case DELETE:
+            case DISAPPEARED:
                 tx.delete(LogicalDatastoreType.OPERATIONAL, routeId);
                 break;
             case UNMODIFIED:
                 // No-op
                 break;
+            case APPEARED:
             case SUBTREE_MODIFIED:
             case WRITE:
                 tx.put(LogicalDatastoreType.OPERATIONAL, routeId, route.getDataAfter().get());
@@ -125,6 +127,7 @@ final class EffectiveRibInWriter implements AutoCloseable {
                 final YangInstanceIdentifier childPath = tablePath.node(child.getIdentifier());
                 switch (child.getModificationType()) {
                 case DELETE:
+                case DISAPPEARED:
                     tx.delete(LogicalDatastoreType.OPERATIONAL, tablePath.node(child.getIdentifier()));
                     break;
                 case UNMODIFIED:
@@ -139,6 +142,7 @@ final class EffectiveRibInWriter implements AutoCloseable {
                         tx.put(LogicalDatastoreType.OPERATIONAL, childPath, child.getDataAfter().get());
                     }
                     break;
+                case APPEARED:
                 case WRITE:
                     tx.put(LogicalDatastoreType.OPERATIONAL, childPath, child.getDataAfter().get());
                     // Routes are special, as they may end up being filtered. The previous put conveniently
@@ -232,6 +236,7 @@ final class EffectiveRibInWriter implements AutoCloseable {
 
             switch (root.getModificationType()) {
             case DELETE:
+            case DISAPPEARED:
                 // delete the corresponding effective table
                 tx.delete(LogicalDatastoreType.OPERATIONAL, effectiveTablePath(peerKey, tableKey));
                 break;
@@ -241,6 +246,7 @@ final class EffectiveRibInWriter implements AutoCloseable {
             case UNMODIFIED:
                 LOG.info("Ignoring spurious notification on {} data {}", rootPath, table);
                 break;
+            case APPEARED:
             case WRITE:
                 writeTable(tx, peerKey, tableKey, table);
                 break;