Ask Your Question

How does topology-manager create a node?

asked 2014-06-16 18:11:39 -0700

zedyuang gravatar image

updated 2014-06-17 10:58:46 -0700


When there is a switch connecting to the controller, a session would be created and an onSessionAdded() function would be called in SalRegistrationManager. (For MD-SAL openflowplugin and openflowjava development)

In onSessionAdded(), it will publish the NodeUpdated in the end. However, how does topology-manager or other listeners takeover this notification? How can I know how many listeners on the NodeUpdated and what are they?

In topology-manager, how does it create a node and store it into database after receiving this notification?

I hope I can get some details about the logic.


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-06-16 22:20:37 -0700


updated 2014-06-18 01:59:56 -0700

In case of AD-SAL based stack -- Look for the class, it overrides the listener method updateNode() from, that will be called by openflowplugin whenever new switch connects to the controller.

This method further calls all the listener application above the AD-SAL. To subscribe for this event notification, application needs to override methods in and also need to set this class as a interface in the applications class. As of now is being implemented by ConnectionManager,StatisticsManager and SwitchManager, you can explore the file of any of these module to get more details.

In case of MD-SAL based stack - Every module who wants to subscribe for notification events from plugin should register its listener implementation with notification service. For example lets have a look at inventory-manager (MD-SAL) module. In start() method of it's registering NodeChangeCommiter class instance to the notification service.

this.listenerRegistration = this.notificationService.registerNotificationListener(this.changeCommiter);

NodeChangeCommiter implements all the notification methods of OpendaylightInventoryListener. So whenever plugin publish any DTO to SAL using NotificationService, it will invoke the related notification method of the concern subscriber/s. I believe which notification will be invoked is dependent on what DTO is being published to SAL notification service. As you mentioned in your question, In case of node add event, plugin publishes NodeUpdate DTO to the notification service,

        publishService.publish(nodeAdded(ofSwitch, features,nodeRef));

nodeAdded returns

private NodeUpdated nodeAdded(ModelDrivenSwitch sw, GetFeaturesOutput features, NodeRef nodeRef) {

So notification service will invoke following notification listener method of OpendaylightInventoryListener

void onNodeUpdated(NodeUpdated notification);
edit flag offensive delete publish link more


Thank you for your answer. I look into, but it seems that this service is for openflow 1.0 plugin on AD-SAL. Actually, I am working on the MD-SAL openflowplugin and library. What about this case?

zedyuang ( 2014-06-17 10:26:05 -0700 )edit

@zedyuang, I updated my answer with details of how it works in case of MD-SAL.

Anil Vishnoi ( 2014-06-18 02:00:57 -0700 )edit

I really appreciate it. But, how does MD-SAL relate the "publishService.publish(NodeUpdated nodeAdded)" to OpendaylightInventoryListener?

zedyuang ( 2014-06-18 17:40:56 -0700 )edit
Login/Signup to Answer

Question Tools



Asked: 2014-06-16 18:11:39 -0700

Seen: 554 times

Last updated: Jun 18 '14