+ @Override
+ public void updateOtnLinks(
+ org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210618.renderer.rpc.result.sp.Link
+ notifLink, boolean isDeletion) {
+
+ List<LinkId> linkIdList = new ArrayList<>();
+ String nodeTopoA = convertNetconfNodeIdToTopoNodeId(notifLink.getATermination().getNodeId(),
+ notifLink.getATermination().getTpId());
+ String nodeTopoZ = convertNetconfNodeIdToTopoNodeId(notifLink.getZTermination().getNodeId(),
+ notifLink.getZTermination().getTpId());
+ linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoA, notifLink.getATermination().getTpId(),
+ nodeTopoZ, notifLink.getZTermination().getTpId(), OtnLinkType.OTU4.getName()));
+ linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoZ, notifLink.getZTermination().getTpId(),
+ nodeTopoA, notifLink.getATermination().getTpId(), OtnLinkType.OTU4.getName()));
+ 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");
+ }
+