Merge "Notifying listeners when a subnet gets added or removed"
authorAlessandro Boch <aboch@cisco.com>
Fri, 13 Dec 2013 07:20:34 +0000 (07:20 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 13 Dec 2013 07:20:34 +0000 (07:20 +0000)
opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java

index 217b8d4..41c7836 100644 (file)
@@ -475,6 +475,16 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
             status = updateConfig(conf, isAdding);
             if(!status.isSuccess()) {
                 updateDatabase(conf, (!isAdding));
+            } else {
+                // update the listeners
+                Subnet subnetCurr = subnets.get(conf.getIPAddress());
+                Subnet subnet;
+                if (subnetCurr == null) {
+                    subnet = new Subnet(conf);
+                } else {
+                    subnet = subnetCurr.clone();
+                }
+                notifySubnetChange(subnet, isAdding);
             }
         }