Don't use NotificationListener (NodeRegistration)
[transportpce.git] / networkmodel / src / main / java / org / opendaylight / transportpce / networkmodel / listeners / TcaListener221.java
index 68cec92f4669821c4fb6b7e5f926c94af872c1b3..b3429c6878becee7d8e8a0e66df76ee43dfad21f 100644 (file)
@@ -8,21 +8,26 @@
 
 package org.opendaylight.transportpce.networkmodel.listeners;
 
-import org.opendaylight.yang.gen.v1.http.org.openroadm.tca.rev181019.OrgOpenroadmTcaListener;
+import java.util.Set;
+import org.opendaylight.mdsal.binding.api.NotificationService.CompositeListener;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.tca.rev181019.TcaNotification;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class TcaListener221 implements OrgOpenroadmTcaListener {
+public class TcaListener221 {
 
     private static final Logger LOG = LoggerFactory.getLogger(TcaListener221.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);
     }