Change TAPI topology to use correct states
[transportpce.git] / lighty / src / main / java / io / lighty / controllers / tpce / module / TransportPCEImpl.java
index bdaedc68f2b5d08c3569e409d4e90ef4243b61ab..cee0fba65ce4f671c498b425f657c829b465ae3c 100644 (file)
@@ -83,12 +83,12 @@ import org.opendaylight.transportpce.tapi.listeners.TapiServiceHandlerListenerIm
 import org.opendaylight.transportpce.tapi.topology.TapiNetconfTopologyListener;
 import org.opendaylight.transportpce.tapi.topology.TapiNetworkModelService;
 import org.opendaylight.transportpce.tapi.topology.TapiNetworkModelServiceImpl;
-import org.opendaylight.transportpce.tapi.topology.TapiPortMappingListener;
 import org.opendaylight.transportpce.tapi.topology.TapiNetworkUtilsImpl;
+import org.opendaylight.transportpce.tapi.topology.TapiPortMappingListener;
 import org.opendaylight.transportpce.tapi.utils.TapiListener;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev170818.TransportpceNetworkutilsService;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.tapinetworkutils.rev210408.TransportpceTapinetworkutilsService;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.TransportpceOlmService;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.tapinetworkutils.rev210408.TransportpceTapinetworkutilsService;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.OrgOpenroadmServiceService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -220,7 +220,7 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP
         tapiProvider = initTapi(lightyServices, servicehandler, networkTransaction, serviceDataStoreOperations,
                 tapiNetConfTopologyListener, tapiPortMappingListener, tapiNetworkutilsServiceImpl, tapiPceListenerImpl,
                 tapiRendererListenerImpl, tapiServiceHandlerListener, lightyServices.getNotificationService());
-        if(activateNbiNotification) {
+        if (activateNbiNotification) {
             LOG.info("Creating nbi-notifications beans ...");
             nbiNotificationsProvider = new NbiNotificationsProvider(
                     publisherTopicList, null, null, lightyServices.getRpcProviderService(),
@@ -242,7 +242,7 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP
         servicehandlerProvider.init();
         LOG.info("Initializing tapi provider ...");
         tapiProvider.init();
-        if(nbiNotificationsProvider != null) {
+        if (nbiNotificationsProvider != null) {
             LOG.info("Initializing nbi-notifications provider ...");
             nbiNotificationsProvider.init();
         }
@@ -272,15 +272,8 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP
         return true;
     }
 
-    /**
-     * Init tapi provider beans.
-     *
-     * @param lightyServices LightyServices
-     * @param rendererServiceOperations RendererServiceOperations
-     * @return TapiProvider instance
-     */
     private TapiProvider initTapi(LightyServices lightyServices, OrgOpenroadmServiceService servicehandler,
-                                  NetworkTransactionService networkTransaction,
+                                  NetworkTransactionService networkTransactionService,
                                   ServiceDataStoreOperations serviceDataStoreOperations,
                                   TapiNetconfTopologyListener tapiNetConfTopologyListener,
                                   TapiPortMappingListener tapiPortMappingListener,
@@ -289,20 +282,11 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP
                                   TapiServiceHandlerListenerImpl serviceHandlerListenerImpl,
                                   NotificationService notificationService) {
         return new TapiProvider(lightyServices.getBindingDataBroker(), lightyServices.getRpcProviderService(),
-            servicehandler, serviceDataStoreOperations, new TapiListener(), networkTransaction,
+            servicehandler, serviceDataStoreOperations, new TapiListener(), networkTransactionService,
             tapiNetConfTopologyListener, tapiPortMappingListener, tapiNetworkutilsServiceImpl, pceListenerImpl,
             rendererListenerImpl, serviceHandlerListenerImpl, notificationService);
     }
 
-    /**
-     * Init renderer provider beans.
-     *
-     * @param lightyServices LightyServices
-     * @param olmPowerServiceRpc TransportpceOlmService
-     * @param deviceRendererService DeviceRendererService
-     * @param otnDeviceRendererService OtnDeviceRendererService
-     * @return RendererProvider instance
-     */
     private RendererProvider initRenderer(LightyServices lightyServices, TransportpceOlmService olmPowerServiceRpc,
             DeviceRendererService deviceRendererService, OtnDeviceRendererService otnDeviceRendererService) {
         DeviceRendererRPCImpl deviceRendererRPC = new DeviceRendererRPCImpl(deviceRendererService,
@@ -314,14 +298,6 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP
                 rendererServiceOperations);
     }
 
-    /**
-     * Init OpenRoadmInterfaceFactory.
-     *
-     * @param mappingUtils MappingUtils
-     * @param openRoadmInterfaces OpenRoadmInterfaces
-     * @param portMapping PortMapping
-     * @return OpenRoadmInterfaceFactory instance
-     */
     private OpenRoadmInterfaceFactory initOpenRoadmFactory(MappingUtils mappingUtils,
             OpenRoadmInterfaces openRoadmInterfaces, PortMapping portMapping) {
         OpenRoadmInterface121 openRoadmInterface121 = new OpenRoadmInterface121(portMapping, openRoadmInterfaces);
@@ -333,13 +309,6 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP
             openRoadmInterface710, openRoadmOtnInterface221);
     }
 
-    /**
-     * Init PortMapping.
-     *
-     * @param lightyServices LightyServices
-     * @param openRoadmInterfaces OpenRoadmInterfaces
-     * @return PortMapping instance
-     */
     private PortMapping initPortMapping(LightyServices lightyServices, OpenRoadmInterfaces openRoadmInterfaces) {
         PortMappingVersion710 portMappingVersion710 = new PortMappingVersion710(lightyServices.getBindingDataBroker(),
             deviceTransactionManager, openRoadmInterfaces);
@@ -351,12 +320,6 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP
             portMappingVersion221, portMappingVersion121);
     }
 
-    /**
-     * Init OpenRoadmInterfaces.
-     *
-     * @param mappingUtils MappingUtils
-     * @return OpenRoadmInterfaces instance
-     */
     private OpenRoadmInterfaces initOpenRoadmInterfaces(MappingUtils mappingUtils) {
         OpenRoadmInterfacesImpl121 openRoadmInterfacesImpl121 = new OpenRoadmInterfacesImpl121(
                 deviceTransactionManager);
@@ -368,12 +331,6 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP
                 openRoadmInterfacesImpl221, openRoadmInterfacesImpl710);
     }
 
-    /**
-     * Init CrossConnect.
-     *
-     * @param mappingUtils MappingUtils
-     * @return CrossConnect instance
-     */
     private CrossConnect initCrossConnect(MappingUtils mappingUtils) {
         CrossConnectImpl121 crossConnectImpl121 = new CrossConnectImpl121(deviceTransactionManager);
         CrossConnectImpl221 crossConnectImpl221 = new CrossConnectImpl221(deviceTransactionManager);