Don't use NotificationListener (ServiceHandler)
[transportpce.git] / networkmodel / src / main / java / org / opendaylight / transportpce / networkmodel / NetworkModelProvider.java
index d1ef447cb756fc213f5448b6426428917c9710a7..4158ab91b5dad66d318c2a8ec3fd375771cfc898 100644 (file)
@@ -25,9 +25,7 @@ import org.opendaylight.transportpce.networkmodel.service.NetworkModelService;
 import org.opendaylight.transportpce.networkmodel.util.TpceNetwork;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220922.Network;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220922.mapping.Mapping;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.servicehandler.rev201125.TransportpceServicehandlerListener;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.osgi.service.component.annotations.Activate;
@@ -50,7 +48,7 @@ public class NetworkModelProvider {
     private final NetConfTopologyListener topologyListener;
     private List<Registration> listeners;
     private TpceNetwork tpceNetwork;
-    private ListenerRegistration<TransportpceServicehandlerListener> serviceHandlerListenerRegistration;
+    private Registration serviceHandlerListenerRegistration;
     private NotificationService notificationService;
     private FrequenciesService frequenciesService;
     private PortMappingListener portMappingListener;
@@ -88,8 +86,8 @@ public class NetworkModelProvider {
                 InstanceIdentifiers.NETCONF_TOPOLOGY_II.child(Node.class)), topologyListener));
         listeners.add(dataBroker.registerDataTreeChangeListener(
                 DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION, MAPPING_II), portMappingListener));
-        TransportpceServicehandlerListener serviceHandlerListner = new ServiceHandlerListener(frequenciesService);
-        serviceHandlerListenerRegistration = notificationService.registerNotificationListener(serviceHandlerListner);
+        serviceHandlerListenerRegistration = notificationService.registerCompositeListener(
+            new ServiceHandlerListener(frequenciesService).getCompositeListener());
     }
 
         /**