Hi Everyone,

I developed some java code in ODL-Helium that registered a listener to get 
notified when the openflowplugin received a OFPT_FLOW_REMOVED message or an 
Open Flow error message.  I'm trying to move this code to ODL-Boron-SR2 and I'm 
having a problem where I'm not being notified when flows are removed on the 
switch.


In Helium, my code looked like this:

    final MyListener listener = new MyListener();  // MyListener implements 
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowListener;

    final NotificationService notificationService = 
context.getSALService(org.opendaylight.controller.sal.binding.api.NotificationService.class);

    if (notificationService != null)

    {

        notificationService.registerNotificationListener(listener);

    }


This code has worked well in helium, but it doesn't work in Boron (the classes 
still appear to be available, but they've been deprecated)


In Helium, the notifications I'm interested in were defined in the controller 
project in the YANG file sal-flow.yang


By Boron,  the sal.flow.yang has been moved to the openflowplugin project and 
the switch-flow-removed notification has been deprecated.  What I'd like to 
understand is what's the best way to receive these events.


Here's what I've tried:


First attempt:

         final MyPktListener pktList = new MyPktListener(); // implements 
org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingListener

         final MyListener listener = MyListener();  // MyListener implements 
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowListener;


         final NotificationService srvc = 
OsgiUtils.findOsgiService(org.opendaylight.controller.md.sal.binding.api.NotificationService);

         if (srvc != null)
         {

                  srvc.registerNotificationListener(pktList)

                  srvc.registerNotificationListener(listener)

         }


  *        I get packet in events, but I'm not getting events to indicate a 
flow as aged out on the switch (I can see the message come up from OpenFlow)


2nd attempt (use the old Helium class, but I still don't get the events):

         final MyPktListener pktList = new MyPktListener(); // implements 
org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingListener

         final MyListener listener = MyListener();  // MyListener implements 
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowListener;


         final NotificationService srvc = 
OsgiUtils.findOsgiService(org.opendaylight.controller.sal.binding.api.NotificationService);

         if (srvc != null)
         {

                  srvc.registerNotificationListener(pktList)

                  srvc.registerNotificationListener(listener)

         }

I'm looked at the code in the samples directory in the openflowplugin (but no 
example for the flow-removed-on-switch event).  I've been unable to find a 
blueprint registration of a service that implements any of the 
NotificationService API's.

What am I missing.  This seems so basic I'm assuming I'm registering the wrong 
class/interface as a listener.

Does anyone have an example of Boron (or Beryllium) code that does this?

Thanks in advance,

Jim


_______________________________________________
openflowplugin-dev mailing list
[email protected]
https://lists.opendaylight.org/mailman/listinfo/openflowplugin-dev

Reply via email to