Wired up a NotificationPopListner that will notify the MD-SAL
[openflowplugin.git] / openflowplugin / src / main / java / org / opendaylight / openflowplugin / openflow / md / core / NotificationPopListener.java
1 package org.opendaylight.openflowplugin.openflow.md.core;
2
3 import java.util.List;
4
5 import org.opendaylight.openflowplugin.openflow.md.core.session.OFSessionUtil;
6 import org.opendaylight.openflowplugin.openflow.md.queue.PopListener;
7 import org.opendaylight.yangtools.yang.binding.Notification;
8
9 public class NotificationPopListener<T> implements PopListener<T> {
10
11
12     @Override
13     public void onPop(List<T> processedMessage) {
14         OFSessionUtil.getSessionManager().getTranslatorMapping();
15         for ( T message : processedMessage ) {
16             if(message instanceof Notification) {
17                 OFSessionUtil.getSessionManager().getNotificationProviderService().publish((Notification) message);
18             }
19         }
20
21     }
22
23 }