Don't use NotificationListener (NodeRegistration)
[transportpce.git] / networkmodel / src / main / java / org / opendaylight / transportpce / networkmodel / listeners / TcaListener.java
index ecfa36584faa228d07fa545506e706587f98bed5..6fc8ba60c10b87f82e74302f01f9c1baed7d7919 100644 (file)
@@ -8,21 +8,26 @@
 
 package org.opendaylight.transportpce.networkmodel.listeners;
 
-import org.opendaylight.yang.gen.v1.http.org.openroadm.tca.rev161014.OrgOpenroadmTcaListener;
+import java.util.Set;
+import org.opendaylight.mdsal.binding.api.NotificationService.CompositeListener;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.tca.rev161014.TcaNotification;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class TcaListener implements OrgOpenroadmTcaListener {
+public class TcaListener {
 
     private static final Logger LOG = LoggerFactory.getLogger(TcaListener.class);
 
+    public CompositeListener getCompositeListener() {
+        return new CompositeListener(Set.of(
+            new CompositeListener.Component<>(TcaNotification.class, this::onTcaNotification)));
+    }
+
     /**
      * Callback for tca-notification.
      * @param notification TcaNotification object
      */
-    @Override
-    public void onTcaNotification(TcaNotification notification) {
+    private void onTcaNotification(TcaNotification notification) {
         LOG.info("Notification {} received {}", TcaNotification.QNAME, notification);
     }