I copied some code from the openflow samples (learning switch) to get notified when a switch connects but now, alas, I get many notifications. Here's my code to register a listener:
WakeupOnNode wakeupListener = new WakeupOnNode(s);
final InstanceIdentifier<Table> instanceIdentifier = InstanceIdentifier.builder(Nodes.class).child(Node.class).
augmentation(FlowCapableNode.class).child(Table.class).build();
final DataTreeIdentifier<Table> dataTreeIdentifier =
new DataTreeIdentifier(LogicalDatastoreType.OPERATIONAL, instanceIdentifier);
this.dataTreeChangeListenerRegistration = this.dataBroker.registerDataTreeChangeListener(dataTreeIdentifier, wakeupListener);
I see multiple notifications in the listener. Not sure why this happens. Perhaps I need to listen on some other identifier (?)
Thanks in advance for any help.
Ranga