Don't use NotificationListener (NodeRegistration)
[transportpce.git] / networkmodel / src / main / java / org / opendaylight / transportpce / networkmodel / listeners / DeOperationsListener221.java
index 61961c3d55006821d8a2f3da1da82d76a0305f4d..0a8fd0f657e4e7d3401750044f3eac9fa4262856 100644 (file)
@@ -8,22 +8,27 @@
 
 package org.opendaylight.transportpce.networkmodel.listeners;
 
-import org.opendaylight.yang.gen.v1.http.org.openroadm.de.operations.rev181019.OrgOpenroadmDeOperationsListener;
+import java.util.Set;
+import org.opendaylight.mdsal.binding.api.NotificationService.CompositeListener;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.de.operations.rev181019.RestartNotification;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class DeOperationsListener221 implements OrgOpenroadmDeOperationsListener {
+public class DeOperationsListener221 {
 
     private static final Logger LOG = LoggerFactory.getLogger(DeOperationsListener221.class);
 
+    public CompositeListener getCompositeListener() {
+        return new CompositeListener(Set.of(
+            new CompositeListener.Component<>(RestartNotification.class, this::onRestartNotification)));
+    }
+
     /**
      * Callback for restart-notification.
      *
      * @param notification RestartNotification object
      */
-    @Override
-    public void onRestartNotification(RestartNotification notification) {
+    private void onRestartNotification(RestartNotification notification) {
         LOG.info("Notification {} received {}", RestartNotification.QNAME, notification);
     }