Ask is moving to Stack Overflow and! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode


opeflow plugin: How to get notification when switch connects

asked 2017-09-05 12:14:25 -0700


I am writing my first ODL application with the openflow plugin. I am working with carbon. I want to get a notification when a switch connects. I am trying the following code in the provider :

               WakeupOnNode wakeupListener = new WakeupOnNode();
    // final InstanceIdentifier<Table> instanceIdentifier = InstanceIdentifier.create(Node.class).augmentation(FlowCapableNode.class).child(Table.class);

    final InstanceIdentifier<Table> instanceIdentifier = InstanceIdentifier.builder(Nodes.class).child(Node.class).

    final DataTreeIdentifier<Table> dataTreeIdentifier = new DataTreeIdentifier(LogicalDatastoreType.OPERATIONAL, instanceIdentifier);

    this.dataBroker.registerDataTreeChangeListener(dataTreeIdentifier, wakeupListener);

But alas I see no notification appear in my WakeupOnNode listener.

( I took this code from the openflowplugin samples.) Where can I find some documentation on how to do this?

Thank you in advance for your help.


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-09-05 19:33:57 -0700

updated 2017-09-16 17:23:37 -0700

Actually this does work as advertised. I Had previously made a mistake. I have to build the project from the root.

   mvn clean install

Does it. I would like to know why I get MULTIPLE notifications when mininet connects.

To get rid of the MULTIPLE notifications issue :

     final InstanceIdentifier<Table> instanceIdentifier = InstanceIdentifier.builder(Nodes.class).child(Node.class)

    //final DataTreeIdentifier<Table> dataTreeIdentifier = new DataTreeIdentifier(LogicalDatastoreType.OPERATIONAL,
    //  instanceIdentifier);
    final DataTreeIdentifier<FlowCapableNode> dataTreeIdentifier = new DataTreeIdentifier(LogicalDatastoreType.OPERATIONAL, getWildcardPath());

    this.dataTreeChangeListenerRegistration = this.dataBroker.registerDataTreeChangeListener(dataTreeIdentifier,
edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-09-05 12:14:25 -0700

Seen: 163 times

Last updated: Sep 16 '17