From: Asad Ahmed Date: Thu, 12 Dec 2013 22:05:27 +0000 (-0800) Subject: Notifying listeners when a subnet gets added X-Git-Tag: jenkins-controller-bulk-release-prepare-only-2-1~200^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=dca98296c2c94ae9b01f88c1faa6922fd03bbc5d;hp=--cc Notifying listeners when a subnet gets added or removed Change-Id: Ieea5d9df6ed0fea1276c239365625c0d158f658e Signed-off-by: Asad Ahmed --- dca98296c2c94ae9b01f88c1faa6922fd03bbc5d diff --git a/opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java b/opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java index 217b8d4690..41c783618d 100644 --- a/opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java +++ b/opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java @@ -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); } }