Implemented processing of Bridge Update 62/19762/1
authorSharad Mishra <sharad.d.mishra@intel.com>
Wed, 6 May 2015 18:17:53 +0000 (11:17 -0700)
committerSharad Mishra <sharad.d.mishra@intel.com>
Wed, 6 May 2015 18:17:53 +0000 (11:17 -0700)
Change-Id: I5d3c212950a37df81fc717b77f0b36fb826a969a
Signed-off-by: Sharad Mishra <sharad.d.mishra@intel.com>
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/OvsdbDataChangeListener.java

index fc540d51ccc0f46940e1f6a89ad7db6743f9ffbe..c96fee1a2f78b81737fb5f1e2d9f38227e7feea8 100644 (file)
@@ -317,8 +317,23 @@ public class OvsdbDataChangeListener implements DataChangeListener, AutoCloseabl
 
     private void processBridgeUpdate(
             AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changes) {
-        // TODO Auto-generated method stub
-
+        LOG.info("processBridgeUpdate - Received changes : {}", changes);
+        
+        for (Map.Entry<InstanceIdentifier<?>, DataObject> updatedBridge : changes.getUpdatedData().entrySet()) {
+            if(updatedBridge.getKey() instanceof OvsdbBridgeAugmentation){
+                LOG.info("Processing update on a bridge : {}",updatedBridge);
+                Node bridgeParentNode  = getNode(changes.getUpdatedData(), updatedBridge);
+                if(bridgeParentNode == null){
+                    // Logging this warning, to catch any change in southbound plugin behavior
+                    LOG.warn("Parent Node for bridge is not found. Bridge creation must provide the Node "
+                            + "details in create Data Changes. This condition should not occure" );
+                    continue;
+                }
+                LOG.debug("Process bridge {} update on Node : {}", updatedBridge.getValue(),bridgeParentNode);
+                ovsdbUpdate(bridgeParentNode, updatedBridge.getValue(),
+                        OvsdbInventoryListener.OvsdbType.BRIDGE, Action.ADD);
+            }
+        }
     }
 
     private void processBridgeDeletion(