From 08d14bd2821233d6f2eb6f03e143745393f530bc Mon Sep 17 00:00:00 2001 From: Marian Adamjak Date: Fri, 24 Apr 2015 12:50:05 +0200 Subject: [PATCH] BUG 3057 - notify added event source by topics created before Change-Id: I97d49e830af6c360bb2d2b24880aa07e2e47c0a6 Signed-off-by: Marian Adamjak --- .../messagebus/app/impl/EventSourceTopology.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 10b9ec83cd..7771b82491 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){ -- 2.36.6