fix Databroker deprecated warnings
[transportpce.git] / pce / src / main / java / org / opendaylight / transportpce / pce / gnpy / ExtractTopoDataStoreImpl.java
index 000f055a89779708d30954515f1915b034758d6e..0ad7f2e1a64e688ead695126a14efa72e17c69bf 100644 (file)
@@ -17,12 +17,9 @@ import java.util.concurrent.ExecutionException;
 import java.util.stream.IntStream;
 
 import org.eclipse.jdt.annotation.Nullable;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.transportpce.common.NetworkUtils;
-//import org.opendaylight.yang.gen.v1.gnpy.gnpy.eqpt.config.rev181119.EdfaVariety;
-//import org.opendaylight.yang.gen.v1.gnpy.gnpy.eqpt.config.rev181119.FiberVariety;
+import org.opendaylight.transportpce.common.network.NetworkTransactionService;
 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.Coordinate;
 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.Km;
 import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.edfa.params.Operational;
@@ -70,7 +67,7 @@ import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.synchronization.info.Syn
 import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.synchronization.info.SynchronizationBuilder;
 import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.synchronization.info.synchronization.Svec;
 import org.opendaylight.yang.gen.v1.gnpy.path.rev190502.synchronization.info.synchronization.SvecBuilder;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev190624.PathComputationRequestInput;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.link.rev181130.amplified.link.attributes.AmplifiedLink;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.link.rev181130.amplified.link.attributes.amplified.link.section.element.section.element.Span;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.link.rev181130.amplified.link.attributes.amplified.link.section.element.section.element.ila.Ila;
@@ -105,9 +102,7 @@ import org.slf4j.LoggerFactory;
 
 public class ExtractTopoDataStoreImpl {
     private static final Logger LOG = LoggerFactory.getLogger(ExtractTopoDataStoreImpl.class);
-    private final DataBroker dataBroker;
-    // private final OpenRoadmTopology openRoadmTopology;
-    // private final OpenRoadmInterfaces openRoadmInterfaces;
+    private final NetworkTransactionService networkTransactionService;
     private List<Elements> elements = new ArrayList<>();
     private List<Connections> connections = new ArrayList<>();
     private List<PathRequest> pathRequest = new ArrayList<>();
@@ -122,34 +117,35 @@ public class ExtractTopoDataStoreImpl {
      * Construct the ExtractTopoDataStoreImpl.
      */
     @SuppressWarnings("unchecked")
-    public ExtractTopoDataStoreImpl(final DataBroker dataBroker, PathComputationRequestInput input, AToZDirection atoz,
-            Long requestId) {
-        this.dataBroker = dataBroker;
+    public ExtractTopoDataStoreImpl(final NetworkTransactionService networkTransactionService,
+            PathComputationRequestInput input,AToZDirection atoz, Long requestId) {
+        this.networkTransactionService = networkTransactionService;
         Map<String, List<?>> map = extractTopo();
         if (map.containsKey("Elements")) {
             elements = (List<Elements>) map.get("Elements");
         } else {
             elements = null;
         }
-        if (map.containsKey("Elements")) {
+        if (map.containsKey("Connections")) {
             connections = (List<Connections>) map.get("Connections");
         } else {
             connections = null;
         }
+
         pathRequest = extractPathRequest(input, atoz, requestId);
         synchronization = extractSynchronization(requestId);
     }
 
-    public ExtractTopoDataStoreImpl(final DataBroker dataBroker, PathComputationRequestInput input, ZToADirection ztoa,
-            Long requestId) {
-        this.dataBroker = dataBroker;
+    public ExtractTopoDataStoreImpl(final NetworkTransactionService networkTransactionService,
+            PathComputationRequestInput input, ZToADirection ztoa, Long requestId) {
+        this.networkTransactionService = networkTransactionService;
         Map<String, List<?>> map = extractTopo();
         if (map.containsKey("Elements")) {
             elements = (List<Elements>) map.get("Elements");
         } else {
             elements = null;
         }
-        if (map.containsKey("Elements")) {
+        if (map.containsKey("Connections")) {
             connections = (List<Connections>) map.get("Connections");
         } else {
             connections = null;
@@ -177,16 +173,15 @@ public class ExtractTopoDataStoreImpl {
         InstanceIdentifier<Network> insIdrOpenRoadmNet = InstanceIdentifier
                 .builder(Networks.class)
                 .child(Network.class, new NetworkKey(new NetworkId(NetworkUtils.UNDERLAY_NETWORK_ID))).build();
-        ReadOnlyTransaction readOnlyTransaction = this.dataBroker.newReadOnlyTransaction();
         // Read the data broker
         try {
-            // Initialize the reading of the data broker
+            // Initialize the reading of the networkTransactionService
             // read the configuration part of the data broker that concerns
             // the openRoadm topology and get all the nodes
-            java.util.Optional<Network> openRoadmTopo = readOnlyTransaction
-                    .read(LogicalDatastoreType.CONFIGURATION, insIdOpenRoadmTopo).get().toJavaUtil();
-            java.util.Optional<Network> openRoadmNet = readOnlyTransaction
-                    .read(LogicalDatastoreType.CONFIGURATION, insIdrOpenRoadmNet).get().toJavaUtil();
+            java.util.Optional<Network> openRoadmTopo = this.networkTransactionService
+                    .read(LogicalDatastoreType.CONFIGURATION, insIdOpenRoadmTopo).get();
+            java.util.Optional<Network> openRoadmNet = this.networkTransactionService
+                    .read(LogicalDatastoreType.CONFIGURATION, insIdrOpenRoadmNet).get();
             if (openRoadmNet.isPresent()) {
                 List<Node> openRoadmNetNodeList = openRoadmNet.get().getNode();
                 if (openRoadmTopo.isPresent()) {
@@ -241,13 +236,13 @@ public class ExtractTopoDataStoreImpl {
                     // Create the list of connections
                     Network1 nw1 = openRoadmTopo.get().augmentation(Network1.class);
                     List<Link> linksList = nw1.getLink();
-                    // 1:EXPRESS-LINK ; 2:ADD-LINK ; 3:DROP-LINK ;
-                    // 4:ROADM-To-ROADM ; 5:XPONDER-INPUT ; 6:XPONDER-OUTPUT
+                    // 1:EXPRESS-LINK    2:ADD-LINK       3:DROP-LINK
+                    // 4:ROADM-To-ROADM  5:XPONDER-INPUT  6:XPONDER-OUTPUT
                     int[] externalLink = {4,5,6};
                     int idFiber = 0;
                     int nbEDFA = 0;
                     if (!linksList.isEmpty()) {
-                        LOG.warn("The link list is not empty");
+                        LOG.debug("The link list is not empty");
                         for (Link link : linksList) {
                             Link1 link1 = link.augmentation(Link1.class);
                             int linkType = link1.getLinkType().getIntValue();
@@ -276,8 +271,6 @@ public class ExtractTopoDataStoreImpl {
                                                     nbEDFA++;
                                                     mapDisgNodeRefNode.put(nodeId, nodeId);
                                                     mapNodeRefIp.put(nodeId, ipEdfa);
-                                                    // class std_medium_gain
-                                                    // implements EdfaVariety {}
                                                     element1 = addElementsEdfa(2, 0, "RLD", "Lannion_CAS",
                                                             ila.getGain().getValue(), ila.getTilt().getValue(),
                                                             ila.getOutVoaAtt().getValue(), "std_medium_gain",
@@ -293,8 +286,6 @@ public class ExtractTopoDataStoreImpl {
                                                     mapLinkFiber.put(link.getLinkId().getValue(), clfi);
                                                     mapFiberIp.put(clfi, ipFiber);
                                                     idFiber++;
-                                                    // class SSMF implements
-                                                    // FiberVariety {}
                                                     element1 = addElementsFiber(2, 0, "RLD", "Lannion_CAS",
                                                             ipFiber.getIpv4Address().getValue(), 20, 0, 0.2, 0, 0,
                                                             "SSMF");
@@ -304,7 +295,7 @@ public class ExtractTopoDataStoreImpl {
                                                     destId = element1.getUid();
                                                     destIp = null;
                                                     // Create a new link
-                                                    if (srcId != destId) {
+                                                    if (!destId.equals(srcId)) {
                                                         Connections connection = createNewConnection(srcId, srcIp,
                                                                 destId, destIp);
                                                         topoConnections.add(connection);
@@ -325,8 +316,7 @@ public class ExtractTopoDataStoreImpl {
                                         mapFiberIp.put(clfi, ipFiber);
                                         idFiber++;
 
-                                        double attIn = span.getSpanlossCurrent().getValue().doubleValue();
-                                        double lossCoef = 0.2;
+                                        double attIn = 0;
                                         double connIn = 0;
                                         double connOut = 0;
                                         String typeVariety = "SSMF";
@@ -339,6 +329,7 @@ public class ExtractTopoDataStoreImpl {
                                             //convert to kilometer
                                             length += srlgLength / convertKmM;
                                         }
+                                        double lossCoef = span.getSpanlossCurrent().getValue().doubleValue() / length;
 
                                         Elements element1 = addElementsFiber(2, 0, "RLD", "Lannion_CAS",
                                                 ipFiber.getIpv4Address().getValue(), length, attIn, lossCoef, connIn,
@@ -348,7 +339,7 @@ public class ExtractTopoDataStoreImpl {
                                         // Create a new link
                                         destId = element1.getUid();
                                         destIp = null;
-                                        if (srcId != destId) {
+                                        if (!destId.equals(srcId)) {
                                             Connections connection = createNewConnection(srcId, srcIp, destId, destIp);
                                             topoConnections.add(connection);
                                             srcId = destId;
@@ -362,14 +353,13 @@ public class ExtractTopoDataStoreImpl {
                                         mapFiberIp.put(clfi, ipFiber);
                                         idFiber++;
                                         // Create a new element
-                                        // class SSMF implements FiberVariety {}
                                         Elements element1 = addElementsFiber(2, 0, "RLD", "Lannion_CAS",
                                                 ipFiber.getIpv4Address().getValue(), 20, 0, 0.2, 0, 0, "SSMF");
                                         topoElements.add(element1);
                                         // Create a new link
                                         destId = element1.getUid();
                                         destIp = null;
-                                        if (srcId != destId) {
+                                        if (!destId.equals(srcId)) {
                                             Connections connection = createNewConnection(srcId, srcIp, destId, destIp);
                                             topoConnections.add(connection);
                                             srcId = destId;
@@ -395,9 +385,9 @@ public class ExtractTopoDataStoreImpl {
             }
         } catch (InterruptedException | ExecutionException e) {
             LOG.error("Error reading the topology", e);
-            readOnlyTransaction.close();
+            this.networkTransactionService.close();
         }
-        readOnlyTransaction.close();
+        this.networkTransactionService.close();
         map.put("Elements", topoElements);
         map.put("Connections", topoConnections);
         return map;
@@ -410,27 +400,15 @@ public class ExtractTopoDataStoreImpl {
         // List of A to Z
         List<AToZ> listAtoZ = atoz.getAToZ();
         int atozSize = listAtoZ.size();
-        // String modulationFormat = atoz.getModulationFormat();
         // Create the path request
         List<PathRequest> pathRequestList = new ArrayList<>();
-        // Define the instance identifier
-        // InstanceIdentifier<Network> nwInstanceIdentifier = InstanceIdentifier
-        // .builder(Network.class, new NetworkKey(new
-        // NetworkId(NetworkUtils.OVERLAY_NETWORK_ID))).build();
-
-        // read the configuration part of the data broker that concerns the
-        // nodes ID and get all the nodes
-        // java.util.Optional<Network> networkObject = readOnlyTransaction
-        // .read(LogicalDatastoreType.CONFIGURATION,
-        // nwInstanceIdentifier).get().toJavaUtil();
+
         // 1.1 Create explicitRouteObjects
         // 1.1.1. create RouteObjectIncludeExclude list
         List<RouteObjectIncludeExclude> routeObjectIncludeExcludes = new ArrayList<>();
         IpAddress ipAddressCurrent = null;
         Long index = (long) 0;
-        //ReadOnlyTransaction readOnlyTransaction = this.dataBroker.newReadOnlyTransaction();
         for (int i = 0; i < atozSize; i++) {
-            // String idAtoZ = listAtoZ.get(i).getId();
             String nodeId = null;
             if (listAtoZ.get(i).getResource()
                     .getResource() instanceof org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
@@ -445,8 +423,7 @@ public class ExtractTopoDataStoreImpl {
                     IpAddress ipAddress = mapNodeRefIp.get(nodeRef);
                     for (Elements element : elements) {
                         if (element.getUid().contains(ipAddress.getIpv4Address().getValue().toString())) {
-                            String type = element.getType().getName();
-                            if ((ipAddressCurrent == null) || (ipAddressCurrent != ipAddress)) {
+                            if ((ipAddressCurrent == null) || (!ipAddress.equals(ipAddressCurrent))) {
                                 ipAddressCurrent = ipAddress;
                                 // Fill in routeObjectIncludeExcludes
                                 RouteObjectIncludeExclude routeObjectIncludeExclude1 = addRouteObjectIncludeExclude(
@@ -460,14 +437,7 @@ public class ExtractTopoDataStoreImpl {
                 } else {
                     LOG.warn("node ID is null");
                 }
-            } else if (listAtoZ.get(i).getResource()
-                    .getResource() instanceof org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
-                    .pathdescription.rev171017.pce.resource.resource.resource.TerminationPoint) {
-                org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce
-                        .resource.resource.resource.TerminationPoint tp = (org.opendaylight.yang.gen.v1.http.org
-                        .transportpce.b.c._interface.pathdescription.rev171017.pce.resource.resource.resource
-                        .TerminationPoint) listAtoZ.get(i).getResource().getResource();
-                // Not used in this version
+            //TODO else if termination point not implemented in this version
             } else if (listAtoZ.get(i).getResource()
                     .getResource() instanceof org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
                     .pathdescription.rev171017.pce.resource.resource.resource.Link) {
@@ -491,13 +461,11 @@ public class ExtractTopoDataStoreImpl {
 
         // 1. Create the path request element 1
         // Find parameters
-        // String serviceName = input.getServiceName();
         String sourceNode = input.getServiceAEnd().getNodeId();
         String destNode = input.getServiceZEnd().getNodeId();
 
         // 1.2 Create a path constraints
         Long rate = atoz.getRate();
-        // Long wavelengthNumber = atoz.getAToZWavelengthNumber();
         // Create EffectiveFreqSlot
         List<EffectiveFreqSlot> effectiveFreqSlot = new ArrayList<>();
         EffectiveFreqSlot effectiveFreqSlot1 = new EffectiveFreqSlotBuilder().setM(5).setN(8).build();
@@ -506,23 +474,12 @@ public class ExtractTopoDataStoreImpl {
         TeBandwidth teBandwidth = new TeBandwidthBuilder().setPathBandwidth(new BigDecimal(rate))
                 .setTechnology("flexi-grid").setTrxType("openroadm-beta1").setTrxMode("W100G")
                 .setEffectiveFreqSlot(effectiveFreqSlot).setSpacing(new BigDecimal(50000000000.0)).build();
-        // .setMaxNbOfChannel(new Long(80)).setOutputPower(new
-        // BigDecimal(0.0012589254117941673))
         PathConstraints pathConstraints = new PathConstraintsBuilder().setTeBandwidth(teBandwidth).build();
-        // PathRequest pathRequest1 = new
-        // PathRequestBuilder().setRequestId(new
-        // Long(0)).setSource(mapNodeRefIp.get(sourceNode))
-        // .setDestination(mapNodeRefIp.get(destNode)).setSrcTpId(input.getServiceAEnd().getTxDirection()
-        //      .getPort().getPortName().getBytes())
-        // .setDstTpId(input.getServiceAEnd().getRxDirection().getPort().getPortName().getBytes())
-        //      .setPathConstraints(pathConstraints)
-        // .setExplicitRouteObjects(explicitRouteObjects).build();
         PathRequest pathRequest1 = new PathRequestBuilder().setRequestId(requestId)
                 .setSource(mapNodeRefIp.get(sourceNode)).setDestination(mapNodeRefIp.get(destNode))
                 .setSrcTpId("srcTpId".getBytes()).setDstTpId("dstTpId".getBytes()).setPathConstraints(pathConstraints)
                 .setExplicitRouteObjects(explicitRouteObjects).build();
         pathRequestList.add(pathRequest1);
-        //readOnlyTransaction.close();
         return pathRequestList;
     }
 
@@ -530,27 +487,15 @@ public class ExtractTopoDataStoreImpl {
         // List of A to Z
         List<ZToA> listZToA = ztoa.getZToA();
         int ztoaSize = listZToA.size();
-        // String modulationFormat = ztoa.getModulationFormat();
         // Create the path request
         List<PathRequest> servicePathRequest = new ArrayList<>();
-        // Define the instance identifier
-        InstanceIdentifier<Network> nwInstanceIdentifier = InstanceIdentifier
-                .builder(Networks.class)
-                .child(Network.class, new NetworkKey(new NetworkId(NetworkUtils.OVERLAY_NETWORK_ID))).build();
-        //ReadOnlyTransaction readOnlyTransaction = this.dataBroker.newReadOnlyTransaction();
 
-        // read the configuration part of the data broker that concerns the
-        // nodes ID and get all the nodes
-        // java.util.Optional<Network> networkObject = readOnlyTransaction
-        // .read(LogicalDatastoreType.CONFIGURATION,
-        // nwInstanceIdentifier).get().toJavaUtil();
         // 1.1 Create explicitRouteObjects
         // 1.1.1. create RouteObjectIncludeExclude list
         List<RouteObjectIncludeExclude> routeObjectIncludeExcludes = new ArrayList<>();
         IpAddress ipAddressCurrent = null;
         Long index = (long) 0;
         for (int i = 0; i < ztoaSize; i++) {
-            // String idZtoA = listZToA.get(i).getId();
             String nodeId = null;
             if (listZToA.get(i).getResource()
                     .getResource() instanceof org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
@@ -565,8 +510,7 @@ public class ExtractTopoDataStoreImpl {
                     IpAddress ipAddress = mapNodeRefIp.get(nodeRef);
                     for (Elements element : elements) {
                         if (element.getUid().contains(ipAddress.getIpv4Address().getValue().toString())) {
-                            // String type = element.getType().getName();
-                            if ((ipAddressCurrent == null) || (ipAddressCurrent != ipAddress)) {
+                            if ((ipAddressCurrent == null) || (!ipAddress.equals(ipAddressCurrent))) {
                                 ipAddressCurrent = ipAddress;
                                 // Fill in routeObjectIncludeExcludes
                                 RouteObjectIncludeExclude routeObjectIncludeExclude1 = addRouteObjectIncludeExclude(
@@ -580,14 +524,7 @@ public class ExtractTopoDataStoreImpl {
                 } else {
                     LOG.warn("node ID is null");
                 }
-            } else if (listZToA.get(i).getResource()
-                    .getResource() instanceof org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
-                    .pathdescription.rev171017.pce.resource.resource.resource.TerminationPoint) {
-                org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce
-                    .resource.resource.resource.TerminationPoint tp = (org.opendaylight.yang.gen.v1.http.org
-                    .transportpce.b.c._interface.pathdescription.rev171017.pce.resource.resource.resource
-                    .TerminationPoint) listZToA.get(i).getResource().getResource();
-                // Not used in this version
+            //TODO else if termination point not implemented in this version
             } else if (listZToA.get(i).getResource()
                     .getResource() instanceof org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
                     .pathdescription.rev171017.pce.resource.resource.resource.Link) {
@@ -611,13 +548,11 @@ public class ExtractTopoDataStoreImpl {
 
         // 1. Create the path request element 1
         // Find parameters
-        // String serviceName = input.getServiceName();
         String sourceNode = input.getServiceZEnd().getNodeId();
         String destNode = input.getServiceAEnd().getNodeId();
 
         // 1.2 Create a path constraints
         Long rate = ztoa.getRate();
-        // Long wavelengthNumber = ztoa.getZToAWavelengthNumber();
         // Create EffectiveFreqSlot
         List<EffectiveFreqSlot> effectiveFreqSlot = new ArrayList<>();
         EffectiveFreqSlot effectiveFreqSlot1 = new EffectiveFreqSlotBuilder().setM(5).setN(8).build();
@@ -626,23 +561,12 @@ public class ExtractTopoDataStoreImpl {
         TeBandwidth teBandwidth = new TeBandwidthBuilder().setPathBandwidth(new BigDecimal(rate))
                 .setTechnology("flexi-grid").setTrxType("openroadm-beta1").setTrxMode("W100G")
                 .setEffectiveFreqSlot(effectiveFreqSlot).setSpacing(new BigDecimal(50000000000.0)).build();
-        // .setMaxNbOfChannel(new Long(80)).setOutputPower(new
-        // BigDecimal(0.0012589254117941673))
         PathConstraints pathConstraints = new PathConstraintsBuilder().setTeBandwidth(teBandwidth).build();
-        // PathRequest pathRequest1 = new
-        // PathRequestBuilder().setRequestId(new
-        // Long(0)).setSource(mapNodeRefIp.get(sourceNode))
-        // .setDestination(mapNodeRefIp.get(destNode)).setSrcTpId(input.getServiceAEnd().getTxDirection()
-        //      .getPort().getPortName().getBytes())
-        // .setDstTpId(input.getServiceAEnd().getRxDirection().getPort().getPortName().getBytes())
-        //      .setPathConstraints(pathConstraints)
-        // .setExplicitRouteObjects(explicitRouteObjects).build();
         PathRequest pathRequest1 = new PathRequestBuilder().setRequestId(requestId)
                 .setSource(mapNodeRefIp.get(sourceNode)).setDestination(mapNodeRefIp.get(destNode))
                 .setSrcTpId("srcTpId".getBytes()).setDstTpId("dstTpId".getBytes()).setPathConstraints(pathConstraints)
                 .setExplicitRouteObjects(explicitRouteObjects).build();
         servicePathRequest.add(pathRequest1);
-        //readOnlyTransaction.close();
         return servicePathRequest;
     }
 
@@ -652,7 +576,7 @@ public class ExtractTopoDataStoreImpl {
     public List<Synchronization> extractSynchronization(Long requestId) {
         // Create RequestIdNumber
         List<Long> requestIdNumber = new ArrayList<>();
-        requestIdNumber.add(0, new Long(0));
+        requestIdNumber.add(requestId);
         // Create a synchronization
         Svec svec = new SvecBuilder().setRelaxable(true).setDisjointness(new TePathDisjointness(true, true, false))
                 .setRequestIdNumber(requestIdNumber).build();
@@ -678,7 +602,6 @@ public class ExtractTopoDataStoreImpl {
                 .setAttIn(new BigDecimal(attIn)).setLossCoef(new BigDecimal(lossCoef)).setConIn(new BigDecimal(connIn))
                 .setConOut(new BigDecimal(connOut)).build();
         Params params1 = new ParamsBuilder().setFiberroadm(fiber).build();
-        // TypeElement Fiber = ; //new TypeElement(Fiber);
         Elements element1 = new ElementsBuilder().setUid(clfi)
                 .setType(org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.Fiber.class)
                 .setTypeVariety(typeVariety).setMetadata(metadata1)
@@ -700,7 +623,6 @@ public class ExtractTopoDataStoreImpl {
         Operational operational = new OperationalBuilder().setGainTarget(gainTarget).setTiltTarget(tiltTarget)
                 .setOutVoa(outVoa).build();
         Edfa edfa = new EdfaBuilder()
-                // .setTypeVariety(typeVariety)
                 .setOperational(operational).build();
         Elements element1 = new ElementsBuilder().setUid(uidEdfa)
                 // Choose an ip address
@@ -763,14 +685,6 @@ public class ExtractTopoDataStoreImpl {
         return routeObjectIncludeExclude1;
     }
 
-    private String fromToNodeForConnection(String id, IpAddress ip) {
-        String fromToNode = id;
-        if (ip != null) {
-            fromToNode = ip.getIpv4Address().getValue().toString();
-        }
-        return (fromToNode);
-    }
-
     private Connections createNewConnection(String srcId, IpAddress srcIp, String destId, IpAddress destIp) {
         String fromNode = srcId;
         String toNode = destId;
@@ -817,16 +731,11 @@ public class ExtractTopoDataStoreImpl {
     }
 
     public List<PathRequest> createEmptyPathRequest(PathComputationRequestInput input, AToZDirection atoz) {
-        // List of A to Z
-        // List<AToZ> listAtoZ = atoz.getAToZ();
-        // int atozSize = listAtoZ.size();
-
         // Create the path request
         List<PathRequest> pathRequestList = new ArrayList<>();
 
         // 1. Create the path request element 1
         // Find parameters
-        // String serviceName = input.getServiceName();
         String sourceNode = input.getServiceAEnd().getNodeId();
         String destNode = input.getServiceZEnd().getNodeId();