fix issue in Lighty for PortMapping 24/95624/2
authorChristophe Betoule <christophe.betoule@orange.com>
Wed, 31 Mar 2021 13:06:58 +0000 (15:06 +0200)
committerChristophe Betoule <christophe.betoule@orange.com>
Wed, 31 Mar 2021 13:09:35 +0000 (15:09 +0200)
Signed-off-by: Christophe Betoule <christophe.betoule@orange.com>
Change-Id: Ia9dd5a87218fb57c6befd7356ac4a8f053a3d1f7

lighty/src/main/java/io/lighty/controllers/tpce/module/TransportPCEImpl.java

index 1513335f4666a0d709c59ce3ba725a52faaf13c1..fcd0521491146cda4eb9614d29dee304467da6e9 100644 (file)
@@ -106,17 +106,6 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP
         RequestProcessor requestProcessor = new RequestProcessor(lightyServices.getBindingDataBroker());
         networkTransaction = new NetworkTransactionImpl(requestProcessor);
 
-        LOG.info("Creating PCE beans ...");
-        // TODO: pass those parameters through command line
-        GnpyConsumer gnpyConsumer = new GnpyConsumerImpl("http://127.0.0.1:8008",
-                "gnpy", "gnpy", lightyServices.getAdapterContext().currentSerializer());
-        PathComputationService pathComputationService = new PathComputationServiceImpl(
-                networkTransaction,
-                lightyServices.getBindingNotificationPublishService(),
-                gnpyConsumer
-                );
-        pceProvider = new PceProvider(lightyServices.getRpcProviderService(), pathComputationService);
-
         LOG.info("Creating network-model beans ...");
         R2RLinkDiscovery linkDiscoveryImpl = new R2RLinkDiscovery(lightyServices.getBindingDataBroker(),
                 deviceTransactionManager, networkTransaction);
@@ -135,6 +124,18 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP
                 lightyServices.getRpcProviderService(), networkutilsServiceImpl, netConfTopologyListener,
                 lightyServices.getNotificationService(), networkModelWavelengthService);
 
+        LOG.info("Creating PCE beans ...");
+        // TODO: pass those parameters through command line
+        GnpyConsumer gnpyConsumer = new GnpyConsumerImpl("http://127.0.0.1:8008",
+                "gnpy", "gnpy", lightyServices.getAdapterContext().currentSerializer());
+        PathComputationService pathComputationService = new PathComputationServiceImpl(
+                networkTransaction,
+                lightyServices.getBindingNotificationPublishService(),
+                gnpyConsumer,
+                portMapping
+                );
+        pceProvider = new PceProvider(lightyServices.getRpcProviderService(), pathComputationService);
+
         LOG.info("Creating OLM beans ...");
         CrossConnect crossConnect = initCrossConnect(mappingUtils);
         PowerMgmt powerMgmt = new PowerMgmtImpl(lightyServices.getBindingDataBroker(), openRoadmInterfaces,