remove dead code pointed out by sonar 43/82543/6
authorguillaume.lambert <guillaume.lambert@orange.com>
Tue, 18 Jun 2019 10:14:43 +0000 (12:14 +0200)
committerGuillaume Lambert <guillaume.lambert@orange.com>
Wed, 19 Jun 2019 12:48:07 +0000 (12:48 +0000)
JIRA: TRNSPRTPCE-133

Change-Id: Ibb9e073a7c32a524d643b337d04116eaf5111e1f
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
20 files changed:
common/src/main/java/org/opendaylight/transportpce/common/crossconnect/CrossConnectImpl.java
common/src/main/java/org/opendaylight/transportpce/common/fixedflex/FixedFlexImpl.java
common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl.java
olm/src/main/java/org/opendaylight/transportpce/olm/power/PowerMgmtVersion121.java
olm/src/main/java/org/opendaylight/transportpce/olm/power/PowerMgmtVersion221.java
olm/src/main/java/org/opendaylight/transportpce/olm/service/OlmPowerServiceImpl.java
pce/src/main/java/org/opendaylight/transportpce/pce/PceCalculation.java
pce/src/main/java/org/opendaylight/transportpce/pce/PceConstraintsCalc.java
pce/src/main/java/org/opendaylight/transportpce/pce/PceLink.java
pce/src/main/java/org/opendaylight/transportpce/pce/PcePathDescription.java
pce/src/main/java/org/opendaylight/transportpce/pce/PceSendingPceRPCs.java
pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/ExtractTopoDataStoreImpl.java
pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyResult.java
pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/ServiceDataStoreOperationsImpl.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/NetworkModelWavelengthServiceImpl.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/openroadminterface/OpenRoadmInterface221.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/DeviceRendererServiceImpl.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/RendererServiceOperationsImpl.java
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/MappingConstraints.java
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/ModelMappingUtils.java

index ec699ae97859c7366d2ce83a0421d0638ef8c1c4..463dabd9456473376f3d493f38a4ebdcc1b41628 100644 (file)
@@ -25,7 +25,6 @@ public class CrossConnectImpl implements CrossConnect {
 
     private static final Logger LOG = LoggerFactory.getLogger(CrossConnectImpl.class);
 
-    private final DeviceTransactionManager deviceTransactionManager;
     protected CrossConnect crossConnect;
     private final MappingUtils mappingUtils;
     private CrossConnectImpl121 crossConnectImpl121;
@@ -34,7 +33,6 @@ public class CrossConnectImpl implements CrossConnect {
     public CrossConnectImpl(DeviceTransactionManager deviceTransactionManager, MappingUtils mappingUtils,
                             CrossConnectImpl121 crossConnectImpl121,
                             CrossConnectImpl221 crossConnectImpl221) {
-        this.deviceTransactionManager = deviceTransactionManager;
         this.mappingUtils = mappingUtils;
         this.crossConnectImpl121 = crossConnectImpl121;
         this.crossConnectImpl221 = crossConnectImpl221;
index 06c2bb9fce4af43a6bb8d86fe385446e409f34fa..e7c57408d0e91a90a4cace98fb67cd83cef785e1 100644 (file)
@@ -8,11 +8,7 @@
 
 package org.opendaylight.transportpce.common.fixedflex;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 public final class FixedFlexImpl implements FixedFlexInterface {
-    private static final Logger LOG = LoggerFactory.getLogger(FixedFlexImpl.class);
     private long index;
     private double centerFrequency;
     private double start;
index 5dbcbad85fc2e60aec10baf764a88feae59a676d..34b3d545cafbfa9a739ccc97041b4c7129a224be 100644 (file)
@@ -23,7 +23,6 @@ public class OpenRoadmInterfacesImpl implements OpenRoadmInterfaces {
 
     private static final Logger LOG = LoggerFactory.getLogger(OpenRoadmInterfacesImpl.class);
 
-    private final DeviceTransactionManager deviceTransactionManager;
     OpenRoadmInterfacesImpl121 openRoadmInterfacesImpl121;
     OpenRoadmInterfacesImpl221 openRoadmInterfacesImpl221;
     MappingUtils mappingUtils;
@@ -31,7 +30,6 @@ public class OpenRoadmInterfacesImpl implements OpenRoadmInterfaces {
     public OpenRoadmInterfacesImpl(DeviceTransactionManager deviceTransactionManager, MappingUtils mappingUtils,
                                    OpenRoadmInterfacesImpl121 openRoadmInterfacesImpl121,
                                    OpenRoadmInterfacesImpl221 openRoadmInterfacesImpl221) {
-        this.deviceTransactionManager = deviceTransactionManager;
         this.mappingUtils = mappingUtils;
         this.openRoadmInterfacesImpl121 = openRoadmInterfacesImpl121;
         this.openRoadmInterfacesImpl221 = openRoadmInterfacesImpl221;
index df6dced557a1236a566c6f96c0d125de2b0d9a40..2e1b56518f5cb3f3db72574ea1ab8f5173abc610 100644 (file)
@@ -42,7 +42,6 @@ import org.slf4j.LoggerFactory;
 
 public final class PowerMgmtVersion121 {
     private static final Logger LOG = LoggerFactory.getLogger(PowerMgmtVersion121.class);
-    private static final long DATA_STORE_READ_TIMEOUT = 120;
 
     private PowerMgmtVersion121() {
     }
index 66a0b5c530451f46a79dd9eaf2e97e0be1e2681a..48d9bfe15b06308bdaf6ebf98396e84a1ca9036a 100644 (file)
@@ -44,7 +44,6 @@ import org.slf4j.LoggerFactory;
 
 public final class PowerMgmtVersion221 {
     private static final Logger LOG = LoggerFactory.getLogger(PowerMgmtVersion221.class);
-    private static final long DATA_STORE_READ_TIMEOUT = 120;
 
     private PowerMgmtVersion221() {
     }
index 3d3889318e79bf2fde6181e93f5fcaeda2fd17fa..e39505d599e4383df19279bae29d78f08943da8a 100644 (file)
@@ -65,8 +65,6 @@ import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmappi
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.RatioDB;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.Interface;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.InterfaceBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.InterfaceKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.OrgOpenroadmDevice;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev181130.Link1;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev181130.OpenroadmLinkType;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.transport.interfaces.rev161014.Interface1;
@@ -127,7 +125,6 @@ public class OlmPowerServiceImpl implements OlmPowerService {
     public GetPmOutput getPm(GetPmInput pmInput) {
         org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping
             .rev170228.network.Nodes.OpenroadmVersion openroadmVersion;
-        //LOG.info("Version returbed by mapping util is "+ mappingUtils.getOpenROADMVersion(pmInput.getNodeId()));
         if (mappingUtils.getOpenRoadmVersion(pmInput.getNodeId())
             .equals(StringConstants.OPENROADM_DEVICE_VERSION_1_2_1)) {
             LOG.info("Device version is 1.2.1");
@@ -394,7 +391,6 @@ public class OlmPowerServiceImpl implements OlmPowerService {
      */
     private boolean setSpanLoss(String nodeId, String interfaceName, BigDecimal spanLoss, String direction) {
         String realNodeId = getRealNodeId(nodeId);
-        BigDecimal initialSpanloss = new BigDecimal(0);
         try {
             LOG.info("Setting Spanloss in device for {}, InterfaceName: {}", realNodeId, interfaceName);
             if (mappingUtils.getOpenRoadmVersion(realNodeId)
@@ -405,8 +401,6 @@ public class OlmPowerServiceImpl implements OlmPowerService {
                 Optional<Interface> interfaceObject;
                 interfaceObject = openRoadmInterfaces.getInterface(realNodeId, interfaceName);
                 if (interfaceObject.isPresent()) {
-                    InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
-                        .child(Interface.class, new InterfaceKey(interfaceName));
                     InterfaceBuilder interfaceBuilder = new InterfaceBuilder(interfaceObject.get());
                     OtsBuilder otsBuilder = new OtsBuilder();
                     Interface intf = interfaceObject.get();
@@ -446,13 +440,6 @@ public class OlmPowerServiceImpl implements OlmPowerService {
                     .interfaces.grp.Interface> interfaceObject =
                         openRoadmInterfaces.getInterface(realNodeId, interfaceName);
                 if (interfaceObject.isPresent()) {
-                    InstanceIdentifier<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019
-                        .interfaces.grp.Interface> interfacesIID =
-                        InstanceIdentifier.create(org.opendaylight.yang.gen.v1.http.org.openroadm
-                            .device.rev181019.org.openroadm.device.container.OrgOpenroadmDevice.class)
-                            .child(org.opendaylight.yang.gen.v1.http.org.openroadm
-                                .device.rev181019.interfaces.grp.Interface.class, new org.opendaylight.yang.gen
-                                .v1.http.org.openroadm.device.rev181019.interfaces.grp.InterfaceKey(interfaceName));
                     org.opendaylight.yang.gen.v1.http.org.openroadm.device
                         .rev181019.interfaces.grp.InterfaceBuilder interfaceBuilder =
                         new org.opendaylight.yang.gen.v1.http.org.openroadm.device
index 177fb7323bfc007cb24d5aebb959d293ea6729fd..95a8cbed8a44c6ffc458254211201b141de78571 100644 (file)
@@ -71,7 +71,6 @@ public class PceCalculation {
         NONE, HARD_EXCLUDE, HARD_INCLUDE, HARD_DIVERSITY, SOFT_EXCLUDE, SOFT_INCLUDE, SOFT_DIVERSITY;
     }
 
-    // private static final String NETWORK_ID = "Transport Overlay";
     public PceCalculation(PathComputationRequestInput input, DataBroker dataBroker, PceConstraints pceHardConstraints,
             PceConstraints pceSoftConstraints, PceResult rc) {
         this.input = input;
index 97beb039fe04bca57663aff48eaf90f1037b4046..584832acca93956fe1516f49ff9953917ad7b6e4 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.transportpce.pce;
 import com.google.common.base.Optional;
 import java.util.ArrayList;
 import java.util.List;
-//import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
@@ -208,8 +207,6 @@ public class PceConstraintsCalc {
                     result = Optional.of(path);
                 }
             }
-//            return pathDescReadTx.read(LogicalDatastoreType.CONFIGURATION, pathDescriptionIID)
-//                    .get(Timeouts.DATASTORE_READ, TimeUnit.MILLISECONDS);
         } catch (InterruptedException | ExecutionException | TimeoutException e) {
             LOG.warn(
                 "PCE diversity constraints: Exception while getting path description from datastore {} for service {}!",
index 2fb29265b5c165d54f9e85cd208da24499458b79..ac86dc9d61df5844fb44e7dc8db355d66c44fb35 100644 (file)
@@ -29,7 +29,6 @@ public class PceLink {
     /*
      * extension of Link to include constraints and Graph weight
      */
-    // double capacity = 1;
 
     double weight = 0;
 
@@ -200,7 +199,6 @@ public class PceLink {
         spanOsnrLu = Math.pow(10, (spanOsnrDb / 10.0));
         sum = PceConstraints.CONST_OSNR / spanOsnrLu;
         linkOsnrLu = sum;
-        //link_OSNR_dB = 10 * Math.log10(1 / sum);
         LOG.debug("In retrieveOSNR: link OSNR is {} dB", linkOsnrLu);
         return linkOsnrLu;
     }
index 1193b2db6452df72938749ad251fb69d2ca1d3c1..31486dbad38eceac666570a5396d4dbf34f1e98e 100644 (file)
@@ -127,7 +127,8 @@ public class PcePathDescription {
                     .build();
 
             // Resource
-            AToZKey srcTPKey = new AToZKey(index.toString());// tpName);
+            AToZKey srcTPKey = new AToZKey(index.toString());
+            // tpName);
             Resource tpResource1 = new ResourceBuilder().setResource(stp).build();
             AToZ stpResource = new AToZBuilder().setId(tpName).withKey(srcTPKey).setResource(tpResource1).build();
             index++;
index bada4cb4b0cd626f560e104724419de6aede3396..218a52bafc4ba98a22c34cc29a64bedf1c101be0 100644 (file)
@@ -209,7 +209,6 @@ public class PceSendingPceRPCs {
         ConnectToGnpyServer connect = new ConnectToGnpyServer();
         String gnpyJsonModified = gnpyJson.replace("gnpy-eqpt-config:", "")
                 .replace("gnpy-path-computation-simplified:", "").replace("gnpy-network-topology:", "");
-        //sd.writeStringFile(gnpyJsonModified);
         String gnpyResponse = connect.gnpyCnx(gnpyJsonModified);
         return gnpyResponse;
     }
index 31417baf83a647bc6128084931b4189bdc3862e2..692451f94f2ef85b96a472dc607506abe764052d 100644 (file)
@@ -21,8 +21,6 @@ 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.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.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;
@@ -106,8 +104,6 @@ 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 List<Elements> elements = new ArrayList<>();
     private List<Connections> connections = new ArrayList<>();
     private List<PathRequest> pathRequest = new ArrayList<>();
@@ -241,8 +237,8 @@ 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;
@@ -276,8 +272,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 +287,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");
@@ -361,7 +353,6 @@ 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);
@@ -409,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
@@ -444,7 +423,6 @@ 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)) {
                                 ipAddressCurrent = ipAddress;
                                 // Fill in routeObjectIncludeExcludes
@@ -459,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) {
@@ -490,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();
@@ -505,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;
     }
 
@@ -529,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
@@ -564,7 +510,6 @@ 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)) {
                                 ipAddressCurrent = ipAddress;
                                 // Fill in routeObjectIncludeExcludes
@@ -579,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) {
@@ -610,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();
@@ -625,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;
     }
 
@@ -677,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)
@@ -699,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
@@ -763,14 +686,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 +732,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();
 
index 0067102503899356f0ccd6202d627613618d5710..2767005e222a59e9a58afa93560dfabb152b264c 100644 (file)
@@ -11,9 +11,7 @@ package org.opendaylight.transportpce.pce.gnpy;
 import com.google.common.base.Preconditions;
 import com.google.gson.stream.JsonReader;
 
-import java.io.BufferedReader;
 import java.io.ByteArrayInputStream;
-import java.io.FileReader;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
@@ -84,8 +82,6 @@ public class GnpyResult {
 
     public GnpyResult(String gnpyResponseString) throws Exception {
 
-        // try {
-        // Optional<DataObject> dataObject;
         // Create the schema context
         final ModuleInfoBackedContext moduleContext = ModuleInfoBackedContext.create();
         Iterable<? extends YangModuleInfo> moduleInfos;
@@ -257,28 +253,6 @@ public class GnpyResult {
         return schemaContext;
     }
 
-    private String readResultFromFile(String fileName) {
-        BufferedReader br = null;
-        FileReader fr = null;
-        StringBuilder sb = new StringBuilder();
-        String gnpyResponse;
-
-        try {
-            fr = new FileReader(fileName);
-            br = new BufferedReader(fr);
-            String currentLine;
-            while ((currentLine = br.readLine()) != null) {
-                LOG.info(currentLine);
-                sb.append(currentLine);
-            }
-            fr.close();
-        } catch (IOException e) {
-            LOG.warn("GNPy: exception {} occured during the reading of results", e.getMessage());
-        }
-        gnpyResponse = sb.toString();
-        return gnpyResponse;
-    }
-
     /**
      * Transforms the given input {@link NormalizedNode} into the given
      * {@link DataObject}.
index 4771b5c2da2210c1df824fb7183a48c8301f465e..c25f82d330c69e199d3782983f666a7eb1d5d7ab 100644 (file)
@@ -52,10 +52,8 @@ import org.slf4j.LoggerFactory;
 public class ServiceDataStoreOperationsImpl implements ServiceDataStoreOperations {
 
     private static final Logger LOG = LoggerFactory.getLogger(ServiceDataStoreOperationsImpl.class);
-    private final DataBroker dataBroker;
 
     public ServiceDataStoreOperationsImpl(DataBroker dataBroker) {
-        this.dataBroker = dataBroker;
     }
 
     public void createXMLFromDevice(DataStoreContext dataStoreContextUtil, OrgOpenroadmDevice device, String output) {
@@ -98,7 +96,7 @@ public class ServiceDataStoreOperationsImpl implements ServiceDataStoreOperation
             // Prepare the variables
             final ModuleInfoBackedContext moduleContext = ModuleInfoBackedContext.create();
             Iterable<? extends YangModuleInfo> moduleInfos = Collections
-                    .singleton(BindingReflections.getModuleInfo(object.getClass()));// TransportpceGnpyData.class));
+                    .singleton(BindingReflections.getModuleInfo(object.getClass()));
             moduleContext.addModuleInfos(moduleInfos);
             SchemaContext schemaContext = moduleContext.tryToCreateSchemaContext().get();
             BindingRuntimeContext bindingContext;
@@ -119,8 +117,6 @@ public class ServiceDataStoreOperationsImpl implements ServiceDataStoreOperation
             // The write part
             final BindingStreamEventWriter bindingWriter = codecRegistry.newWriter(id, domWriter);
             codecRegistry.getSerializer(id.getTargetType()).serialize(object, bindingWriter);
-            // file.write(writer.toString());
-            // file.close();
             writer.close();
         } catch (IOException e) {
             LOG.error("GNPy: writer error ");
@@ -128,8 +124,6 @@ public class ServiceDataStoreOperationsImpl implements ServiceDataStoreOperation
             LOG.warn("GNPy: exception {} occured during json file creation", e.getMessage(), e);
         } catch (ReactorException e) {
             LOG.warn("GNPy: exception {} occured during json file creation", e.getMessage(), e);
-//        } catch (Exception e) {
-//            LOG.warn("An error {} occured during json file creation", e.getMessage(), e);
         }
         return writer.toString();
     }
index eef28d9e95a50049e186f45da98e546d213de758..72700afe311175c7380ad098327ac6889ae05bba 100644 (file)
@@ -523,18 +523,6 @@ public class NetworkModelWavelengthServiceImpl implements NetworkModelWavelength
                             .build());
                     break;
                 case XPONDERCLIENT:
-//                    XpdrClientAttributes xpdrClientAttributes = tp.getXpdrClientAttributes();
-//                    XpdrClientAttributesBuilder xpdrClientAttributesBuilder;
-//                    if (xpdrClientAttributes == null) {
-//                        xpdrClientAttributesBuilder = new XpdrClientAttributesBuilder();
-//                    } else {
-//                        xpdrClientAttributesBuilder = new XpdrClientAttributesBuilder(xpdrClientAttributes);
-//                    }
-//                    Wavelength usedXpdrClientWl = new WavelengthBuilder().setWidth(frequencyGHz)
-//                        .setFrequency(frequencyTHz).build();
-//                    tp1Builder.setXpdrClientAttributes(xpdrClientAttributesBuilder
-//                            .setWavelength(usedXpdrClientWl)
-//                            .build());
                     break;
                 case XPONDERPORT:
                     XpdrPortAttributes xpdrPortAttributes = tp.getXpdrPortAttributes();
index 7b59eaf5b7de60c48adee37ea1dfb6feb4eca26b..48d433c1ce7d919dfeb2fc9eb23bb12c906ae25b 100644 (file)
@@ -219,8 +219,6 @@ public class OpenRoadmInterface221 {
         OchBuilder ocIfBuilder = new OchBuilder();
 
         ocIfBuilder.setFrequency(FrequencyTHz.getDefaultInstance(String.valueOf(fixedFlex.getCenterFrequency())));
-        // ocIfBuilder.setWidth(FrequencyGHz.getDefaultInstance(String.valueOf(fixedFlex.getWavelength())));
-        // ocIfBuilder.setModulationFormat(ModulationFormat.DpQpsk);
         ocIfBuilder.setRate(R100G.class);
         ocIfBuilder.setTransmitPower(new PowerDBm(new BigDecimal("-5")));
 
index 2e0e3cb1e5438d9ca447ddc1235a127f1a43ea5e..3fd2e0d1c542181101b6c5aa55a406d8d1aa8f3d 100644 (file)
@@ -171,14 +171,6 @@ public class DeviceRendererServiceImpl implements DeviceRendererService {
                                 this.crossConnect.postCrossConnect(nodeId, waveNumber, srcTp, destTp);
                         if (connectionNameOpt.isPresent()) {
                             nodesProvisioned.add(nodeId);
-//                            List<Ports> ports =
-//                                    this.crossConnect.getConnectionPortTrail(nodeId, waveNumber, srcTp, destTp);
-//                            if (ServicePathDirection.A_TO_Z.equals(direction)) {
-//                                topology.updateAtoZTopologyList(ports, nodeId);
-//                            }
-//                            if (ServicePathDirection.Z_TO_A.equals(direction)) {
-//                                topology.updateZtoATopologyList(ports, nodeId);
-//                            }
                             createdConnections.add(connectionNameOpt.get());
                         } else {
                             processErrorMessage("Unable to post Roadm-connection for node " + nodeId, forkJoinPool,
@@ -463,8 +455,6 @@ public class DeviceRendererServiceImpl implements DeviceRendererService {
             writeTx.submit().get(Timeouts.DATASTORE_WRITE, TimeUnit.MILLISECONDS);
         } else {
             LOG.warn("Service {} does not exist - topology can not be updated", name);
-//            servicesBuilder = new ServicesBuilder();
-//            servicesBuilder.withKey(serviceKey);
         }
     }
 
index 2d012409255f2eebebbc8288c46849c9ba149ce5..a8052aa607a0c85fcdc5db192de5bbcb559dfbf4 100644 (file)
@@ -110,58 +110,6 @@ public class RendererServiceOperationsImpl implements RendererServiceOperations
         }
     }
 
-/*    @Override
-    public ServiceImplementationRequestOutput serviceImplementation(ServiceImplementationRequestInput input) {
-        LOG.info("Calling service impl request {} {}", input.getServiceName());
-        RollbackProcessor rollbackProcessor = new RollbackProcessor();
-
-        ServicePathInputData servicePathInputDataAtoZ
-                = ModelMappingUtils.rendererCreateServiceInputAToZ(input.getServiceName(),
-                        input.getPathDescription());
-        ServicePathInputData servicePathInputDataZtoA
-                = ModelMappingUtils.rendererCreateServiceInputZToA(input.getServiceName(),
-                        input.getPathDescription());
-        List<DeviceRenderingResult> renderingResults = deviceRendering(rollbackProcessor, servicePathInputDataAtoZ,
-                servicePathInputDataZtoA);
-        if (rollbackProcessor.rollbackAllIfNecessary() > 0) {
-            return ModelMappingUtils.createServiceImplResponse(ResponseCodes.RESPONSE_FAILED, OPERATION_FAILED);
-        }
-
-        ServicePowerSetupInput olmPowerSetupInputAtoZ = ModelMappingUtils.createServicePowerSetupInput(
-                renderingResults.get(0).getOlmList(), input);
-        ServicePowerSetupInput olmPowerSetupInputZtoA = ModelMappingUtils.createServicePowerSetupInput(
-                renderingResults.get(1).getOlmList(), input);
-        olmPowerSetup(rollbackProcessor, olmPowerSetupInputAtoZ, olmPowerSetupInputZtoA);
-        if (rollbackProcessor.rollbackAllIfNecessary() > 0) {
-            return ModelMappingUtils.createServiceImplResponse(ResponseCodes.RESPONSE_FAILED, OPERATION_FAILED);
-        }
-
-        // run service activation test twice - once on source node and once on destination node
-        List<Nodes> nodes = servicePathInputDataAtoZ.getServicePathInput().getNodes();
-        Nodes sourceNode = nodes.get(0);
-        Nodes destNode = nodes.get(nodes.size() - 1);
-
-        String srcNetworkTp;
-        String dstNetowrkTp;
-
-        if (sourceNode.getDestTp().contains(StringConstants.NETWORK_TOKEN)) {
-            srcNetworkTp = sourceNode.getDestTp();
-        } else {
-            srcNetworkTp = sourceNode.getSrcTp();
-        }
-        if (destNode.getDestTp().contains(StringConstants.NETWORK_TOKEN)) {
-            dstNetowrkTp = destNode.getDestTp();
-        } else {
-            dstNetowrkTp = destNode.getSrcTp();
-        }
-
-        if (!isServiceActivated(sourceNode.getNodeId(), srcNetworkTp)
-                || !isServiceActivated(destNode.getNodeId(), dstNetowrkTp)) {
-            rollbackProcessor.rollbackAll();
-            return ModelMappingUtils.createServiceImplResponse(ResponseCodes.RESPONSE_FAILED, OPERATION_FAILED);
-        }
-    } */
-
     @Override
     public ListenableFuture<ServiceImplementationRequestOutput>
             serviceImplementation(ServiceImplementationRequestInput input) {
@@ -202,13 +150,11 @@ public class RendererServiceOperationsImpl implements RendererServiceOperations
                 Nodes destNode = nodes.get(nodes.size() - 1);
                 String srcNetworkTp;
                 String dstNetowrkTp;
-                //if (sourceNode.getDestTp().contains(OpenRoadmInterfacesImpl.NETWORK_TOKEN)) {
                 if (sourceNode.getDestTp().contains(StringConstants.NETWORK_TOKEN)) {
                     srcNetworkTp = sourceNode.getDestTp();
                 } else {
                     srcNetworkTp = sourceNode.getSrcTp();
                 }
-                //if (destNode.getDestTp().contains(OpenRoadmInterfacesImpl.NETWORK_TOKEN)) {
                 if (destNode.getDestTp().contains(StringConstants.NETWORK_TOKEN)) {
                     dstNetowrkTp = destNode.getDestTp();
                 } else {
@@ -383,8 +329,6 @@ public class RendererServiceOperationsImpl implements RendererServiceOperations
                     servicePathDataAtoZ.getServicePathInput().getServiceName(), RpcStatusEx.Pending,
                     "Device rendering was not successful! Rendering will be rolled back.");
             //FIXME we can't do rollback here, because we don't have rendering results.
-            //rollbackProcessor.addTask(new DeviceRenderingRollbackTask("AtoZDeviceTask", true));
-            //rollbackProcessor.addTask(new DeviceRenderingRollbackTask("ZtoADeviceTask", true));
             return renderingResults;
         }
 
index a9f8749e36765af336268188e16ef7b4c00c169c..f05e58dd6b77fdcaac7f9bcb72450ec762f14e7f 100644 (file)
@@ -182,87 +182,7 @@ public class MappingConstraints {
      */
     public void serviceToServicePathConstarints() {
         LOG.info("Mapping Service Constraints to ServicePath Constraints");
-        //CoRoutingOrGeneral coRoutingOrGeneral = null;
         if (serviceHardConstraints  !=  null) {
-            /*HardConstraintsBuilder tempHard = new HardConstraintsBuilder();
-            coRoutingOrGeneral = serviceHardConstraints.getCoRoutingOrGeneral();
-            General tmpGeneral = null;
-            CoRouting tmpCoRouting = null;
-            if (coRoutingOrGeneral  !=  null) {
-                org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
-                    .rev171017.constraints.sp.co.routing.or.general.GeneralBuilder finalGeneral =
-                    new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
-                    .rev171017.constraints.sp.co.routing.or.general.GeneralBuilder();
-                org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
-                    .rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder finalCoRouting =
-                    new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
-                    .rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder();
-                if (coRoutingOrGeneral instanceof General) {
-                    tmpGeneral = (General) coRoutingOrGeneral;
-                    if (tmpGeneral  !=  null) {
-                        Diversity tmpDiversity =  tmpGeneral.getDiversity();
-                        if (tmpDiversity  !=  null) {
-                            finalGeneral.setDiversity(
-                                    new DiversityBuilder()
-                                        .setExistingService(tmpDiversity.getExistingService())
-                                        .setExistingServiceApplicability(
-                                                new ExistingServiceApplicabilityBuilder()
-                                                .setClli(tmpDiversity.getExistingServiceApplicability().isSite())
-                                                .setNode(tmpDiversity.getExistingServiceApplicability().isNode())
-                                                .setSrlg(tmpDiversity.getExistingServiceApplicability().isSrlg())
-                                                .build())
-                                        .build());
-                        }
-                        Exclude tmpExclude = tmpGeneral.getExclude();
-                        if (tmpExclude  !=  null) {
-                            finalGeneral.setExclude(
-                                    new ExcludeBuilder()
-                                        .setSupportingServiceName(tmpExclude.getSupportingServiceName())
-                                        .setClli(tmpExclude.getSite())
-                                        .setNodeId(tmpExclude.getNodeId())
-                                        //.setAffinity(value)
-                                        //.setSRLG(value)
-                                        .build());
-                        }
-                        Include tmpInclude = tmpGeneral.getInclude();
-                        if (tmpInclude  !=  null) {
-                            finalGeneral.setInclude(
-                                    new IncludeBuilder()
-                                        //.setOrderedHops()
-                                        .build());
-                        }
-                        Latency tmpLatency = tmpGeneral.getLatency();
-                        if (tmpLatency != null) {
-                            finalGeneral.setLatency(
-                                    new LatencyBuilder()
-                                        .setMaxLatency(tmpLatency.getMaxLatency())
-                                        .build());
-                        }
-                    }
-                    tempHard
-                        .setCoRoutingOrGeneral(finalGeneral.build())
-                        .setCustomerCode(serviceHardConstraints.getCustomerCode());
-                } else if (coRoutingOrGeneral instanceof CoRouting) {
-                    tmpCoRouting = (CoRouting)coRoutingOrGeneral;
-                    if (tmpCoRouting  !=  null) {
-                        org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014
-                            .constraints.co.routing.or.general.co.routing.CoRouting tmpCoRoutingCoRouting =
-                            tmpCoRouting.getCoRouting();
-                        if (tmpCoRoutingCoRouting  !=  null) {
-                            finalCoRouting.setCoRouting(
-                                    new CoRoutingBuilder()
-                                        .setExistingService(tmpCoRoutingCoRouting.getExistingService())
-                                        .build());
-                        }
-                    }
-                    tempHard
-                        .setCoRoutingOrGeneral(finalCoRouting.build())
-                        .setCustomerCode(serviceHardConstraints.getCustomerCode());
-
-                }
-            }
-            servicePathHardConstraints = tempHard.build();*/
-
             org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
                 .rev171017.routing.constraints.sp.HardConstraints tempHard = (org.opendaylight.yang.gen
                     .v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.routing
@@ -271,84 +191,6 @@ public class MappingConstraints {
                 servicePathHardConstraints = tempHard;
             }
         } else if (serviceSoftConstraints  !=  null) {
-            /*oftConstraintsBuilder tempSoft = new SoftConstraintsBuilder();
-            coRoutingOrGeneral = serviceSoftConstraints.getCoRoutingOrGeneral();
-            General tmpGeneral = null;
-            CoRouting tmpCoRouting = null;
-            if (coRoutingOrGeneral  !=  null) {
-                org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
-                    .rev171017.constraints.sp.co.routing.or.general.GeneralBuilder finalGeneral =
-                    new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
-                    .rev171017.constraints.sp.co.routing.or.general.GeneralBuilder();
-                org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
-                    .rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder finalCoRouting =
-                    new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
-                    .rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder();
-                if (coRoutingOrGeneral instanceof General) {
-                    tmpGeneral = (General) coRoutingOrGeneral;
-                    if (tmpGeneral  !=  null) {
-                        Diversity tmpDiversity =  tmpGeneral.getDiversity();
-                        if (tmpDiversity  !=  null) {
-                            finalGeneral.setDiversity(
-                                    new DiversityBuilder()
-                                        .setExistingService(tmpDiversity.getExistingService())
-                                        .setExistingServiceApplicability(
-                                                new ExistingServiceApplicabilityBuilder()
-                                                .setClli(tmpDiversity.getExistingServiceApplicability().isSite())
-                                                .setNode(tmpDiversity.getExistingServiceApplicability().isNode())
-                                                .setSrlg(tmpDiversity.getExistingServiceApplicability().isSrlg())
-                                                .build())
-                                        .build());
-                        }
-                        Exclude tmpExclude = tmpGeneral.getExclude();
-                        if (tmpExclude  !=  null) {
-                            finalGeneral.setExclude(
-                                    new ExcludeBuilder()
-                                        .setSupportingServiceName(tmpExclude.getSupportingServiceName())
-                                        .setClli(tmpExclude.getSite())
-                                        .setNodeId(tmpExclude.getNodeId())
-                                        //.setAffinity(value)
-                                        //.setSRLG(value)
-                                        .build());
-                        }
-                        Include tmpInclude = tmpGeneral.getInclude();
-                        if (tmpInclude  !=  null) {
-                            finalGeneral.setInclude(
-                                    new IncludeBuilder()
-                                        //.setOrderedHops()
-                                        .build());
-                        }
-                        Latency tmpLatency = tmpGeneral.getLatency();
-                        if (tmpLatency  !=  null) {
-                            finalGeneral.setLatency(
-                                    new LatencyBuilder()
-                                        .setMaxLatency(tmpLatency.getMaxLatency())
-                                        .build());
-                        }
-                    }
-                    tempSoft
-                        .setCoRoutingOrGeneral(finalGeneral.build())
-                        .setCustomerCode(serviceSoftConstraints.getCustomerCode());
-                } else if (coRoutingOrGeneral instanceof CoRouting) {
-                    tmpCoRouting = (CoRouting)coRoutingOrGeneral;
-                    if (tmpCoRouting != null) {
-                        org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014
-                            .constraints.co.routing.or.general.co.routing.CoRouting tmpCoRoutingCoRouting =
-                            tmpCoRouting.getCoRouting();
-                        if (tmpCoRoutingCoRouting != null) {
-                            finalCoRouting.setCoRouting(
-                                    new CoRoutingBuilder()
-                                        .setExistingService(tmpCoRoutingCoRouting.getExistingService())
-                                        .build());
-                        }
-                    }
-                    tempSoft
-                        .setCoRoutingOrGeneral(finalCoRouting.build())
-                        .setCustomerCode(serviceSoftConstraints.getCustomerCode());
-
-                }
-            }
-            servicePathSoftConstraints = tempSoft.build();*/
             org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
                 .rev171017.routing.constraints.sp.SoftConstraints tempSoft = (org.opendaylight.yang.gen
                     .v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.routing
index 53675d4b7ca7f247478d4cd158cb213dcdf25035..0d65c3e6bf61dfeb6fbb366a77d2ecb584e19015 100644 (file)
@@ -62,11 +62,8 @@ import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePathsBuilder;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 public final class ModelMappingUtils {
-    private static final Logger LOG = LoggerFactory.getLogger(ModelMappingUtils.class);
 
     private ModelMappingUtils() {
     }