Implemented processing of Bridge Update
[ovsdb.git] / 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(