+ @Override
+ public void updateOtnLinks(List<String> suppLinks, boolean isDeletion) {
+ List<LinkId> linkIdList = new ArrayList<>();
+ if (suppLinks != null) {
+ suppLinks.forEach(lk -> linkIdList.add(new LinkId(lk)));
+ }
+ List<Link> supportedOtu4links = getOtnLinks(linkIdList);
+
+ TopologyShard otnTopologyShard = OpenRoadmOtnTopology.updateOtnLinks(supportedOtu4links, isDeletion);
+ if (otnTopologyShard.getLinks() != null) {
+ for (Link otnTopologyLink : otnTopologyShard.getLinks()) {
+ LOG.info("creating and updating otn links {} in {}", otnTopologyLink.getLinkId().getValue(),
+ NetworkUtils.OVERLAY_NETWORK_ID);
+ InstanceIdentifier<Link> iiOtnTopologyLink = InstanceIdentifier.builder(Networks.class)
+ .child(Network.class, new NetworkKey(new NetworkId(NetworkUtils.OTN_NETWORK_ID)))
+ .augmentation(Network1.class)
+ .child(Link.class, otnTopologyLink.key())
+ .build();
+ networkTransactionService.merge(LogicalDatastoreType.CONFIGURATION, iiOtnTopologyLink, otnTopologyLink);
+ }
+ }
+ try {
+ networkTransactionService.commit().get();
+ } catch (InterruptedException | ExecutionException e) {
+ LOG.error("Error adding OTN links in otn-topology", e);
+ }
+ LOG.info("OTN links updated");
+ }
+