switch to NetworkTransactionService.commit() 38/83838/1
authorguillaume.lambert <guillaume.lambert@orange.com>
Wed, 21 Aug 2019 08:55:53 +0000 (10:55 +0200)
committerguillaume.lambert <guillaume.lambert@orange.com>
Wed, 21 Aug 2019 09:21:12 +0000 (11:21 +0200)
instead of submit which is now deprecated

Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: Idd15f41a576c1fd13f0c95a0fbea934ef89405e0

networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/service/NetworkModelServiceImpl.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/util/OpenRoadmTopology22.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/util/TopologyUtils.java

index 984005862d9a5a449a34ca45fdda319eff605f58..b2945ed57c11f96b156628d515557e10778e6027 100644 (file)
@@ -132,7 +132,7 @@ public class NetworkModelServiceImpl implements NetworkModelService {
                 networkTransactionService.merge(LogicalDatastoreType.CONFIGURATION, iiOpenRoadmTopologyLink,
                     openRoadmTopologyLink, CREATE_MISSING_PARENTS);
             }
-            networkTransactionService.submit().get();
+            networkTransactionService.commit().get();
             LOG.info("all nodes and links created");
         } catch (InterruptedException | ExecutionException e) {
             LOG.error("ERROR: ", e);
@@ -199,7 +199,7 @@ public class NetworkModelServiceImpl implements NetworkModelService {
             } else {
                 LOG.warn("TopologyShard for node '{}' is not present", nodeId);
             }
-            this.networkTransactionService.submit().get(1, TimeUnit.SECONDS);
+            this.networkTransactionService.commit().get(1, TimeUnit.SECONDS);
             LOG.info("all nodes and links deleted ! ");
         } catch (InterruptedException | ExecutionException | TimeoutException e) {
             LOG.error("Error when trying to delete node : {}", nodeId, e);
index 0664b2bdf660d982f6c11d06ce53155fe45eebd5..b38e1d9e207968e2c8805bc3afe30bf8f96f8b4a 100644 (file)
@@ -101,7 +101,7 @@ public class OpenRoadmTopology22 {
                 new NetworkKey(new NetworkId(NetworkUtils.OVERLAY_NETWORK_ID)));
 
             this.networkTransactionService.put(LogicalDatastoreType.CONFIGURATION, nwIID.build(), openRoadmTopology);
-            this.networkTransactionService.submit().get(1, TimeUnit.SECONDS);
+            this.networkTransactionService.commit().get(1, TimeUnit.SECONDS);
             LOG.info("OpenRoadm-Topology created successfully.");
         } catch (ExecutionException | TimeoutException | InterruptedException e) {
             LOG.warn("Failed to create OpenRoadm-Topology", e);
@@ -502,7 +502,7 @@ public class OpenRoadmTopology22 {
                 linkBuilder.addAugmentation(Link1.class,link1Builder.build());
                 networkTransactionService.merge(LogicalDatastoreType.CONFIGURATION, linkIID.build(),
                         linkBuilder.build());
-                networkTransactionService.submit().get(1, TimeUnit.SECONDS);
+                networkTransactionService.commit().get(1, TimeUnit.SECONDS);
                 return true;
             } else {
                 LOG.error("No link found for given LinkId: {}",
index ce80652b6faafe9a4d73b76fbb11379b21262040..f9e5bbe13769db7246f62b21344a8495a6e54e77 100644 (file)
@@ -98,7 +98,7 @@ public  final class TopologyUtils {
                 linkBuilder.addAugmentation(Link1.class,link1Builder.build());
                 networkTransactionService.merge(LogicalDatastoreType.CONFIGURATION, linkIID.build(),
                     linkBuilder.build());
-                networkTransactionService.submit().get(1, TimeUnit.SECONDS);
+                networkTransactionService.commit().get(1, TimeUnit.SECONDS);
                 return true;
             } else {
                 LOG.error("No link found for given LinkId: {}",