X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=lighty%2Fsrc%2Fmain%2Fjava%2Fio%2Flighty%2Fcontrollers%2Ftpce%2Fmodule%2FTransportPCEImpl.java;h=4bee0e15b17e11a7dcf2ad8544365e871871ef19;hb=a2c0845af51f68102d9f32df83cdfa93fbf9bb35;hp=579bcebc16515441c417a965cdee902cb45b7586;hpb=e50901c4b06c82b91f136dac09bacce01258d7b2;p=transportpce.git diff --git a/lighty/src/main/java/io/lighty/controllers/tpce/module/TransportPCEImpl.java b/lighty/src/main/java/io/lighty/controllers/tpce/module/TransportPCEImpl.java index 579bcebc1..4bee0e15b 100644 --- a/lighty/src/main/java/io/lighty/controllers/tpce/module/TransportPCEImpl.java +++ b/lighty/src/main/java/io/lighty/controllers/tpce/module/TransportPCEImpl.java @@ -87,6 +87,7 @@ 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.TapiNetworkUtilsImpl; +import org.opendaylight.transportpce.tapi.topology.TapiOrLinkListener; import org.opendaylight.transportpce.tapi.topology.TapiPortMappingListener; import org.opendaylight.transportpce.tapi.utils.TapiLink; import org.opendaylight.transportpce.tapi.utils.TapiListener; @@ -140,9 +141,7 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP deviceTransactionManager, networkTransaction); TransportpceNetworkutilsService networkutilsServiceImpl = new NetworkUtilsImpl( lightyServices.getBindingDataBroker()); - MappingUtils mappingUtils = new MappingUtilsImpl(lightyServices.getBindingDataBroker()); - OpenRoadmInterfaces openRoadmInterfaces = initOpenRoadmInterfaces(mappingUtils); - PortMapping portMapping = initPortMapping(lightyServices, openRoadmInterfaces); + PortMapping portMapping = initPortMapping(lightyServices); NetworkModelService networkModelService = new NetworkModelServiceImpl(networkTransaction, linkDiscoveryImpl, portMapping, lightyServices.getBindingNotificationPublishService()); FrequenciesService networkModelWavelengthService = @@ -167,7 +166,9 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP pceProvider = new PceProvider(lightyServices.getRpcProviderService(), pathComputationService); LOG.info("Creating OLM beans ..."); + MappingUtils mappingUtils = new MappingUtilsImpl(lightyServices.getBindingDataBroker()); CrossConnect crossConnect = initCrossConnect(mappingUtils); + OpenRoadmInterfaces openRoadmInterfaces = initOpenRoadmInterfaces(mappingUtils, portMapping); PowerMgmt powerMgmt = new PowerMgmtImpl(lightyServices.getBindingDataBroker(), openRoadmInterfaces, crossConnect, deviceTransactionManager, olmtimer1, olmtimer2); OlmPowerService olmPowerService = new OlmPowerServiceImpl(lightyServices.getBindingDataBroker(), powerMgmt, @@ -209,6 +210,7 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP networkModelListenerImpl, servicehandler); LOG.info("Creating tapi beans ..."); + TapiLink tapiLink = new TapiLink(networkTransaction); R2RTapiLinkDiscovery tapilinkDiscoveryImpl = new R2RTapiLinkDiscovery(networkTransaction, deviceTransactionManager, tapiLink); TapiRendererListenerImpl tapiRendererListenerImpl = new TapiRendererListenerImpl(lightyServices @@ -222,17 +224,19 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP tapilinkDiscoveryImpl, networkTransaction, tapiLink); TapiNetconfTopologyListener tapiNetConfTopologyListener = new TapiNetconfTopologyListener(tapiNetworkModelService); + TapiOrLinkListener orLinkListener = new TapiOrLinkListener(tapiLink, networkTransaction); TapiPortMappingListener tapiPortMappingListener = new TapiPortMappingListener(tapiNetworkModelService); tapiProvider = initTapi(lightyServices, servicehandler, networkTransaction, serviceDataStoreOperations, - tapiNetConfTopologyListener, tapiPortMappingListener, tapiNetworkutilsServiceImpl, tapiPceListenerImpl, - tapiRendererListenerImpl, tapiServiceHandlerListener, lightyServices.getNotificationService()); + tapiNetConfTopologyListener, tapiPortMappingListener, tapiNetworkutilsServiceImpl, tapiPceListenerImpl, + tapiRendererListenerImpl, tapiServiceHandlerListener, lightyServices.getNotificationService(), + orLinkListener); if (activateNbiNotification) { LOG.info("Creating nbi-notifications beans ..."); nbiNotificationsProvider = new NbiNotificationsProvider( - publisherServiceList, publisherAlarmList, null, null, lightyServices.getRpcProviderService(), - lightyServices.getNotificationService(), lightyServices.getAdapterContext().currentSerializer()); + publisherServiceList, publisherAlarmList, null, null, lightyServices.getRpcProviderService(), + lightyServices.getNotificationService(), lightyServices.getAdapterContext().currentSerializer()); } } @@ -288,11 +292,11 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP TransportpceTapinetworkutilsService tapiNetworkutilsServiceImpl, TapiPceListenerImpl pceListenerImpl, TapiRendererListenerImpl rendererListenerImpl, TapiServiceHandlerListenerImpl serviceHandlerListenerImpl, - NotificationService notificationService) { + NotificationService notificationService, TapiOrLinkListener orLinkListener) { return new TapiProvider(lightyServices.getBindingDataBroker(), lightyServices.getRpcProviderService(), servicehandler, serviceDataStoreOperations, new TapiListener(), networkTransactionService, tapiNetConfTopologyListener, tapiPortMappingListener, tapiNetworkutilsServiceImpl, pceListenerImpl, - rendererListenerImpl, serviceHandlerListenerImpl, notificationService); + rendererListenerImpl, serviceHandlerListenerImpl, notificationService, orLinkListener); } private RendererProvider initRenderer(LightyServices lightyServices, TransportpceOlmService olmPowerServiceRpc, @@ -321,24 +325,24 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP openRoadmInterface710, openRoadmOtnInterface221, openRoadmOtnInterface710); } - private PortMapping initPortMapping(LightyServices lightyServices, OpenRoadmInterfaces openRoadmInterfaces) { + private PortMapping initPortMapping(LightyServices lightyServices) { PortMappingVersion710 portMappingVersion710 = new PortMappingVersion710(lightyServices.getBindingDataBroker(), - deviceTransactionManager, openRoadmInterfaces); + deviceTransactionManager); PortMappingVersion221 portMappingVersion221 = new PortMappingVersion221(lightyServices.getBindingDataBroker(), - deviceTransactionManager, openRoadmInterfaces); + deviceTransactionManager); PortMappingVersion121 portMappingVersion121 = new PortMappingVersion121(lightyServices.getBindingDataBroker(), - deviceTransactionManager, openRoadmInterfaces); + deviceTransactionManager); return new PortMappingImpl(lightyServices.getBindingDataBroker(), portMappingVersion710, portMappingVersion221, portMappingVersion121); } - private OpenRoadmInterfaces initOpenRoadmInterfaces(MappingUtils mappingUtils) { + private OpenRoadmInterfaces initOpenRoadmInterfaces(MappingUtils mappingUtils, PortMapping portMapping) { OpenRoadmInterfacesImpl121 openRoadmInterfacesImpl121 = new OpenRoadmInterfacesImpl121( deviceTransactionManager); OpenRoadmInterfacesImpl221 openRoadmInterfacesImpl221 = new OpenRoadmInterfacesImpl221( - deviceTransactionManager); + deviceTransactionManager, portMapping, portMapping.getPortMappingVersion221()); OpenRoadmInterfacesImpl710 openRoadmInterfacesImpl710 = new OpenRoadmInterfacesImpl710( - deviceTransactionManager); + deviceTransactionManager, portMapping, portMapping.getPortMappingVersion710()); return new OpenRoadmInterfacesImpl(deviceTransactionManager, mappingUtils, openRoadmInterfacesImpl121, openRoadmInterfacesImpl221, openRoadmInterfacesImpl710); }