From: Tony Tkacik Date: Mon, 4 May 2015 12:04:58 +0000 (+0000) Subject: Merge "BUG 3057 - notify added event source by topics created before" X-Git-Tag: release/beryllium~617 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=1447e0132075bbd3013aa41b98384a373bd82d1a;hp=f412b1da773035f89f5c686ef8a849d084752cb6 Merge "BUG 3057 - notify added event source by topics created before" --- diff --git a/opendaylight/md-sal/messagebus-impl/src/main/java/org/opendaylight/controller/messagebus/app/impl/EventSourceTopology.java b/opendaylight/md-sal/messagebus-impl/src/main/java/org/opendaylight/controller/messagebus/app/impl/EventSourceTopology.java index b879eacda0..6140a78ba5 100644 --- a/opendaylight/md-sal/messagebus-impl/src/main/java/org/opendaylight/controller/messagebus/app/impl/EventSourceTopology.java +++ b/opendaylight/md-sal/messagebus-impl/src/main/java/org/opendaylight/controller/messagebus/app/impl/EventSourceTopology.java @@ -78,10 +78,10 @@ public class EventSourceTopology implements EventAggregatorService, EventSourceR .child(TopologyTypes.class) .augmentation(TopologyTypes1.class); - private final Map> topicListenerRegistrations = + private final Map> topicListenerRegistrations = new ConcurrentHashMap<>(); private final Map> routedRpcRegistrations = - new ConcurrentHashMap<>();; + new ConcurrentHashMap<>(); private final DataBroker dataBroker; private final RpcRegistration aggregatorRpcReg; @@ -205,12 +205,16 @@ public class EventSourceTopology implements EventAggregatorService, EventSourceR } public void register(final EventSource eventSource){ - NodeKey nodeKey = eventSource.getSourceNodeKey(); + NodeKey nodeKey = eventSource.getSourceNodeKey(); final KeyedInstanceIdentifier sourcePath = EVENT_SOURCE_TOPOLOGY_PATH.child(Node.class, nodeKey); RoutedRpcRegistration reg = rpcRegistry.addRoutedRpcImplementation(EventSourceService.class, eventSource); reg.registerPath(NodeContext.class, sourcePath); routedRpcRegistrations.put(nodeKey,reg); insert(sourcePath); + + for(EventSourceTopic est : topicListenerRegistrations.keySet()){ + est.notifyNode(EVENT_SOURCE_TOPOLOGY_PATH.child(Node.class, nodeKey)); + } } public void unRegister(final EventSource eventSource){