fix Lighty.io build 65/93765/1
authorguillaume.lambert <guillaume.lambert@orange.com>
Wed, 30 Sep 2020 14:52:25 +0000 (16:52 +0200)
committerguillaume.lambert <guillaume.lambert@orange.com>
Tue, 10 Nov 2020 19:45:48 +0000 (20:45 +0100)
- migrate to new lighty-core API
- migrate to new TPCE API

JIRA: TRNSPRTPCE-294
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: Id8906afd05ba7bee6468992d2d255b5db4b621e3
(cherry picked from commit 5e3675cf1ce1d119c758cb2d8513be591c1e6b78)

lighty/pom.xml
lighty/src/main/java/io/lighty/controllers/tpce/Main.java
lighty/src/main/java/io/lighty/controllers/tpce/module/TransportPCEImpl.java
lighty/src/test/java/io/lighty/controllers/tpce/MaintTest.java

index cff3f84c3bb582e495b524734e43604b29b49985..87e0182ac01388cd338c0c82aab04b8dababeaad 100644 (file)
@@ -11,7 +11,7 @@
     <parent>
         <groupId>io.lighty.core</groupId>
         <artifactId>lighty-app-parent</artifactId>
-        <version>12.1.0</version>
+        <version>12.2.1</version>
         <relativePath />
     </parent>
 
             <scope>test</scope>
         </dependency>
 
+        <dependency>
+            <groupId>net.jcip</groupId>
+            <artifactId>jcip-annotations</artifactId>
+            <version>1.0</version>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>com.github.spotbugs</groupId>
+            <artifactId>spotbugs-annotations</artifactId>
+            <version>3.1.3</version>
+            <optional>true</optional>
+        </dependency>
+
     </dependencies>
     <build>
         <finalName>tpce</finalName>
index 7ad45575fb4e009a093299ea3f46dfb81b6e064a..9cba68c009e353678721847f44d3f422c18f1df0 100644 (file)
@@ -102,12 +102,11 @@ public class Main {
         lightyController.start().get();
 
         // 2. start RestConf server
-        CommunityRestConfBuilder communityRestConfBuilder = new CommunityRestConfBuilder();
         LightyServerBuilder jettyServerBuilder = new LightyServerBuilder(
                 new InetSocketAddress(restConfConfiguration.getInetAddress(), restConfConfiguration.getHttpPort()));
-        CommunityRestConf communityRestConf = communityRestConfBuilder.from(
-                RestConfConfigUtils.getRestConfConfiguration(restConfConfiguration, lightyController.getServices()))
-                .withLightyServer(jettyServerBuilder).build();
+        CommunityRestConfBuilder communityRestConfBuilder = CommunityRestConfBuilder.from(
+                RestConfConfigUtils.getRestConfConfiguration(restConfConfiguration, lightyController.getServices()));
+        CommunityRestConf communityRestConf = communityRestConfBuilder.withLightyServer(jettyServerBuilder).build();
         communityRestConf.start().get();
         communityRestConf.startServer();
 
@@ -115,7 +114,8 @@ public class Main {
         NetconfSBPlugin netconfSouthboundPlugin;
         netconfSBPConfiguration = NetconfConfigUtils.injectServicesToTopologyConfig(netconfSBPConfiguration,
                 lightyController.getServices());
-        NetconfTopologyPluginBuilder netconfSBPBuilder = new NetconfTopologyPluginBuilder();
+        NetconfTopologyPluginBuilder netconfSBPBuilder = new NetconfTopologyPluginBuilder(
+                lightyController.getServices(), netconfSBPConfiguration);
         netconfSouthboundPlugin = netconfSBPBuilder.from(netconfSBPConfiguration, lightyController.getServices())
                 .build();
         netconfSouthboundPlugin.start().get();
index 7555aad808aaf709ab5f69578b9208d7e2fb1899..28092d438e9030dbc24099f32ddd66cdf4a331f3 100644 (file)
@@ -103,8 +103,10 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP
         networkTransaction = new NetworkTransactionImpl(requestProcessor);
 
         LOG.info("Creating PCE beans ...");
-        PathComputationService pathComputationService = new PathComputationServiceImpl(networkTransaction,
-                lightyServices.getBindingNotificationPublishService());
+        PathComputationService pathComputationService = new PathComputationServiceImpl(
+                networkTransaction,
+                lightyServices.getBindingNotificationPublishService()
+                );
         pceProvider = new PceProvider(lightyServices.getRpcProviderService(), pathComputationService);
 
         LOG.info("Creating network-model beans ...");
@@ -146,8 +148,8 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP
 
         LOG.info("Creating service-handler beans ...");
         RendererServiceOperations rendererServiceOperations = new RendererServiceOperationsImpl(deviceRendererService,
-                olmPowerServiceRpc, lightyServices.getBindingDataBroker(), networkModelWavelengthService,
-                lightyServices.getBindingNotificationPublishService());
+                otnDeviceRendererService, olmPowerServiceRpc, lightyServices.getBindingDataBroker(),
+                networkModelWavelengthService, lightyServices.getBindingNotificationPublishService());
         servicehandlerProvider = new ServicehandlerProvider(lightyServices.getBindingDataBroker(),
                 lightyServices.getRpcProviderService(), lightyServices.getNotificationService(), pathComputationService,
                 rendererServiceOperations, networkModelWavelengthService,
@@ -235,8 +237,9 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP
         DeviceRendererRPCImpl deviceRendererRPC = new DeviceRendererRPCImpl(deviceRendererService,
                 otnDeviceRendererService);
         RendererServiceOperationsImpl rendererServiceOperations = new RendererServiceOperationsImpl(
-                deviceRendererService, olmPowerServiceRpc, lightyServices.getBindingDataBroker(),
-                networkModelWavelengthService, lightyServices.getBindingNotificationPublishService());
+                deviceRendererService, otnDeviceRendererService, olmPowerServiceRpc,
+                lightyServices.getBindingDataBroker(), networkModelWavelengthService,
+                lightyServices.getBindingNotificationPublishService());
         return new RendererProvider(lightyServices.getRpcProviderService(), deviceRendererRPC,
                 rendererServiceOperations);
     }
@@ -301,4 +304,4 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP
         CrossConnectImpl221 crossConnectImpl221 = new CrossConnectImpl221(deviceTransactionManager);
         return new CrossConnectImpl(deviceTransactionManager, mappingUtils, crossConnectImpl121, crossConnectImpl221);
     }
-}
\ No newline at end of file
+}
index bbeb8c263bd01c00bf1c0285715df4f4a48071f8..096c25d34a1bfad0b1dbc4800e7361f5d582b5eb 100644 (file)
@@ -11,7 +11,6 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
 import java.io.File;
-
 import org.eclipse.jetty.client.HttpClient;
 import org.eclipse.jetty.client.api.ContentResponse;
 import org.junit.After;
@@ -62,4 +61,4 @@ public class MaintTest {
         ContentResponse response = client.GET("http://localhost:8888/restconfCustom/config/ietf-network:networks/network/openroadm-topology");
         assertEquals("Response code should be 200", 200, response.getStatus());
     }
-}
\ No newline at end of file
+}