Interface D creation. NetworkModel->ServiceHandler
[transportpce.git] / servicehandler / src / main / java / org / opendaylight / transportpce / servicehandler / impl / ServicehandlerProvider.java
index 028229dca74ee0f087d10f1cff0189b37b391c15..d8662c68db7cb1176e5db77da786a11d8e5312d3 100644 (file)
@@ -13,12 +13,13 @@ import org.opendaylight.mdsal.binding.api.NotificationPublishService;
 import org.opendaylight.mdsal.binding.api.NotificationService;
 import org.opendaylight.mdsal.binding.api.RpcProviderService;
 import org.opendaylight.transportpce.pce.service.PathComputationService;
-import org.opendaylight.transportpce.renderer.NetworkModelWavelengthService;
 import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations;
+import org.opendaylight.transportpce.servicehandler.listeners.NetworkModelListenerImpl;
 import org.opendaylight.transportpce.servicehandler.listeners.PceListenerImpl;
 import org.opendaylight.transportpce.servicehandler.listeners.RendererListenerImpl;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev190624.TransportpcePceListener;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev171017.TransportpceRendererListener;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkmodel.rev201116.TransportpceNetworkmodelListener;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.TransportpcePceListener;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev201125.TransportpceRendererListener;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.OrgOpenroadmServiceService;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.concepts.ObjectRegistration;
@@ -38,10 +39,10 @@ public class ServicehandlerProvider {
     private final DataBroker dataBroker;
     private final RpcProviderService rpcService;
     private final NotificationService notificationService;
-    private final NetworkModelWavelengthService networkModelWavelengthService;
     private final NotificationPublishService notificationPublishService;
     private ListenerRegistration<TransportpcePceListener> pcelistenerRegistration;
     private ListenerRegistration<TransportpceRendererListener> rendererlistenerRegistration;
+    private ListenerRegistration<TransportpceNetworkmodelListener> networkmodellistenerRegistration;
     private ObjectRegistration<OrgOpenroadmServiceService> rpcRegistration;
     private PathComputationService pathComputationService;
     private RendererServiceOperations rendererServiceOperations;
@@ -49,14 +50,12 @@ public class ServicehandlerProvider {
     public ServicehandlerProvider(final DataBroker dataBroker, RpcProviderService rpcProviderService,
             NotificationService notificationService, PathComputationService pathComputationService,
             RendererServiceOperations rendererServiceOperations,
-            NetworkModelWavelengthService networkModelWavelengthService,
             NotificationPublishService notificationPublishService) {
         this.dataBroker = dataBroker;
         this.rpcService = rpcProviderService;
         this.notificationService = notificationService;
         this.pathComputationService = pathComputationService;
         this.rendererServiceOperations = rendererServiceOperations;
-        this.networkModelWavelengthService = networkModelWavelengthService;
         this.notificationPublishService = notificationPublishService;
     }
 
@@ -69,11 +68,14 @@ public class ServicehandlerProvider {
                 pathComputationService, notificationPublishService, null);
         final RendererListenerImpl rendererListenerImpl =
                 new RendererListenerImpl(pathComputationService, notificationPublishService);
+        final NetworkModelListenerImpl networkModelListenerImpl =
+                new NetworkModelListenerImpl(notificationPublishService, null);
         pcelistenerRegistration = notificationService.registerNotificationListener(pceListenerImpl);
         rendererlistenerRegistration = notificationService.registerNotificationListener(rendererListenerImpl);
+        networkmodellistenerRegistration = notificationService.registerNotificationListener(networkModelListenerImpl);
         final ServicehandlerImpl servicehandler = new ServicehandlerImpl(dataBroker, pathComputationService,
                 rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
-                networkModelWavelengthService);
+                networkModelListenerImpl);
         rpcRegistration =
             rpcService.registerRpcImplementation(OrgOpenroadmServiceService.class, servicehandler);
     }
@@ -85,6 +87,7 @@ public class ServicehandlerProvider {
         LOG.info("ServicehandlerProvider Closed");
         pcelistenerRegistration.close();
         rendererlistenerRegistration.close();
+        networkmodellistenerRegistration.close();
         rpcRegistration.close();
     }