Don't use NotificationListener (NodeRegistration)
[transportpce.git] / networkmodel / src / main / java / org / opendaylight / transportpce / networkmodel / listeners / DeOperationsListener.java
index c861c2f8e5c80aa94d73cf4c8024c32310fcc96c..3844e3f8b3a2a26f0c16f08c8e511543289a22a2 100644 (file)
@@ -8,22 +8,27 @@
 
 package org.opendaylight.transportpce.networkmodel.listeners;
 
-import org.opendaylight.yang.gen.v1.http.org.openroadm.de.operations.rev161014.OrgOpenroadmDeOperationsListener;
+import java.util.Set;
+import org.opendaylight.mdsal.binding.api.NotificationService.CompositeListener;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.de.operations.rev161014.RestartNotification;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class DeOperationsListener implements OrgOpenroadmDeOperationsListener {
+public class DeOperationsListener {
 
     private static final Logger LOG = LoggerFactory.getLogger(DeOperationsListener.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);
     }