From 695a5251d67a1133d16c6b81b6bc45d646a671ad Mon Sep 17 00:00:00 2001 From: "guillaume.lambert" Date: Tue, 18 Jun 2019 12:14:43 +0200 Subject: [PATCH] remove dead code pointed out by sonar JIRA: TRNSPRTPCE-133 Change-Id: Ibb9e073a7c32a524d643b337d04116eaf5111e1f Signed-off-by: guillaume.lambert --- .../common/crossconnect/CrossConnectImpl.java | 2 - .../common/fixedflex/FixedFlexImpl.java | 4 - .../OpenRoadmInterfacesImpl.java | 2 - .../olm/power/PowerMgmtVersion121.java | 1 - .../olm/power/PowerMgmtVersion221.java | 1 - .../olm/service/OlmPowerServiceImpl.java | 13 -- .../transportpce/pce/PceCalculation.java | 1 - .../transportpce/pce/PceConstraintsCalc.java | 3 - .../transportpce/pce/PceLink.java | 2 - .../transportpce/pce/PcePathDescription.java | 3 +- .../transportpce/pce/PceSendingPceRPCs.java | 1 - .../pce/gnpy/ExtractTopoDataStoreImpl.java | 100 +---------- .../transportpce/pce/gnpy/GnpyResult.java | 26 --- .../gnpy/ServiceDataStoreOperationsImpl.java | 8 +- .../NetworkModelWavelengthServiceImpl.java | 12 -- .../OpenRoadmInterface221.java | 2 - .../DeviceRendererServiceImpl.java | 10 -- .../RendererServiceOperationsImpl.java | 56 ------- .../servicehandler/MappingConstraints.java | 158 ------------------ .../servicehandler/ModelMappingUtils.java | 3 - 20 files changed, 8 insertions(+), 400 deletions(-) diff --git a/common/src/main/java/org/opendaylight/transportpce/common/crossconnect/CrossConnectImpl.java b/common/src/main/java/org/opendaylight/transportpce/common/crossconnect/CrossConnectImpl.java index ec699ae97..463dabd94 100644 --- a/common/src/main/java/org/opendaylight/transportpce/common/crossconnect/CrossConnectImpl.java +++ b/common/src/main/java/org/opendaylight/transportpce/common/crossconnect/CrossConnectImpl.java @@ -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; diff --git a/common/src/main/java/org/opendaylight/transportpce/common/fixedflex/FixedFlexImpl.java b/common/src/main/java/org/opendaylight/transportpce/common/fixedflex/FixedFlexImpl.java index 06c2bb9fc..e7c57408d 100644 --- a/common/src/main/java/org/opendaylight/transportpce/common/fixedflex/FixedFlexImpl.java +++ b/common/src/main/java/org/opendaylight/transportpce/common/fixedflex/FixedFlexImpl.java @@ -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; diff --git a/common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl.java b/common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl.java index 5dbcbad85..34b3d545c 100644 --- a/common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl.java +++ b/common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl.java @@ -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; diff --git a/olm/src/main/java/org/opendaylight/transportpce/olm/power/PowerMgmtVersion121.java b/olm/src/main/java/org/opendaylight/transportpce/olm/power/PowerMgmtVersion121.java index df6dced55..2e1b56518 100644 --- a/olm/src/main/java/org/opendaylight/transportpce/olm/power/PowerMgmtVersion121.java +++ b/olm/src/main/java/org/opendaylight/transportpce/olm/power/PowerMgmtVersion121.java @@ -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() { } diff --git a/olm/src/main/java/org/opendaylight/transportpce/olm/power/PowerMgmtVersion221.java b/olm/src/main/java/org/opendaylight/transportpce/olm/power/PowerMgmtVersion221.java index 66a0b5c53..48d9bfe15 100644 --- a/olm/src/main/java/org/opendaylight/transportpce/olm/power/PowerMgmtVersion221.java +++ b/olm/src/main/java/org/opendaylight/transportpce/olm/power/PowerMgmtVersion221.java @@ -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() { } diff --git a/olm/src/main/java/org/opendaylight/transportpce/olm/service/OlmPowerServiceImpl.java b/olm/src/main/java/org/opendaylight/transportpce/olm/service/OlmPowerServiceImpl.java index 3d3889318..e39505d59 100644 --- a/olm/src/main/java/org/opendaylight/transportpce/olm/service/OlmPowerServiceImpl.java +++ b/olm/src/main/java/org/opendaylight/transportpce/olm/service/OlmPowerServiceImpl.java @@ -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 interfaceObject; interfaceObject = openRoadmInterfaces.getInterface(realNodeId, interfaceName); if (interfaceObject.isPresent()) { - InstanceIdentifier 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 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 diff --git a/pce/src/main/java/org/opendaylight/transportpce/pce/PceCalculation.java b/pce/src/main/java/org/opendaylight/transportpce/pce/PceCalculation.java index 177fb7323..95a8cbed8 100644 --- a/pce/src/main/java/org/opendaylight/transportpce/pce/PceCalculation.java +++ b/pce/src/main/java/org/opendaylight/transportpce/pce/PceCalculation.java @@ -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; diff --git a/pce/src/main/java/org/opendaylight/transportpce/pce/PceConstraintsCalc.java b/pce/src/main/java/org/opendaylight/transportpce/pce/PceConstraintsCalc.java index 97beb039f..584832acc 100644 --- a/pce/src/main/java/org/opendaylight/transportpce/pce/PceConstraintsCalc.java +++ b/pce/src/main/java/org/opendaylight/transportpce/pce/PceConstraintsCalc.java @@ -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 {}!", diff --git a/pce/src/main/java/org/opendaylight/transportpce/pce/PceLink.java b/pce/src/main/java/org/opendaylight/transportpce/pce/PceLink.java index 2fb29265b..ac86dc9d6 100644 --- a/pce/src/main/java/org/opendaylight/transportpce/pce/PceLink.java +++ b/pce/src/main/java/org/opendaylight/transportpce/pce/PceLink.java @@ -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; } diff --git a/pce/src/main/java/org/opendaylight/transportpce/pce/PcePathDescription.java b/pce/src/main/java/org/opendaylight/transportpce/pce/PcePathDescription.java index 1193b2db6..31486dbad 100644 --- a/pce/src/main/java/org/opendaylight/transportpce/pce/PcePathDescription.java +++ b/pce/src/main/java/org/opendaylight/transportpce/pce/PcePathDescription.java @@ -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++; diff --git a/pce/src/main/java/org/opendaylight/transportpce/pce/PceSendingPceRPCs.java b/pce/src/main/java/org/opendaylight/transportpce/pce/PceSendingPceRPCs.java index bada4cb4b..218a52baf 100644 --- a/pce/src/main/java/org/opendaylight/transportpce/pce/PceSendingPceRPCs.java +++ b/pce/src/main/java/org/opendaylight/transportpce/pce/PceSendingPceRPCs.java @@ -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; } diff --git a/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/ExtractTopoDataStoreImpl.java b/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/ExtractTopoDataStoreImpl.java index 31417baf8..692451f94 100644 --- a/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/ExtractTopoDataStoreImpl.java +++ b/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/ExtractTopoDataStoreImpl.java @@ -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 = new ArrayList<>(); private List connections = new ArrayList<>(); private List pathRequest = new ArrayList<>(); @@ -241,8 +237,8 @@ public class ExtractTopoDataStoreImpl { // Create the list of connections Network1 nw1 = openRoadmTopo.get().augmentation(Network1.class); List 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 listAtoZ = atoz.getAToZ(); int atozSize = listAtoZ.size(); - // String modulationFormat = atoz.getModulationFormat(); // Create the path request List pathRequestList = new ArrayList<>(); - // Define the instance identifier - // InstanceIdentifier 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 networkObject = readOnlyTransaction - // .read(LogicalDatastoreType.CONFIGURATION, - // nwInstanceIdentifier).get().toJavaUtil(); + // 1.1 Create explicitRouteObjects // 1.1.1. create RouteObjectIncludeExclude list List 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 = 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 listZToA = ztoa.getZToA(); int ztoaSize = listZToA.size(); - // String modulationFormat = ztoa.getModulationFormat(); // Create the path request List servicePathRequest = new ArrayList<>(); - // Define the instance identifier - InstanceIdentifier 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 networkObject = readOnlyTransaction - // .read(LogicalDatastoreType.CONFIGURATION, - // nwInstanceIdentifier).get().toJavaUtil(); // 1.1 Create explicitRouteObjects // 1.1.1. create RouteObjectIncludeExclude list List 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 = 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 createEmptyPathRequest(PathComputationRequestInput input, AToZDirection atoz) { - // List of A to Z - // List listAtoZ = atoz.getAToZ(); - // int atozSize = listAtoZ.size(); - // Create the path request List 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(); diff --git a/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyResult.java b/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyResult.java index 006710250..2767005e2 100644 --- a/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyResult.java +++ b/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyResult.java @@ -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; // Create the schema context final ModuleInfoBackedContext moduleContext = ModuleInfoBackedContext.create(); Iterable 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}. diff --git a/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/ServiceDataStoreOperationsImpl.java b/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/ServiceDataStoreOperationsImpl.java index 4771b5c2d..c25f82d33 100644 --- a/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/ServiceDataStoreOperationsImpl.java +++ b/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/ServiceDataStoreOperationsImpl.java @@ -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 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(); } diff --git a/renderer/src/main/java/org/opendaylight/transportpce/renderer/NetworkModelWavelengthServiceImpl.java b/renderer/src/main/java/org/opendaylight/transportpce/renderer/NetworkModelWavelengthServiceImpl.java index eef28d9e9..72700afe3 100644 --- a/renderer/src/main/java/org/opendaylight/transportpce/renderer/NetworkModelWavelengthServiceImpl.java +++ b/renderer/src/main/java/org/opendaylight/transportpce/renderer/NetworkModelWavelengthServiceImpl.java @@ -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(); diff --git a/renderer/src/main/java/org/opendaylight/transportpce/renderer/openroadminterface/OpenRoadmInterface221.java b/renderer/src/main/java/org/opendaylight/transportpce/renderer/openroadminterface/OpenRoadmInterface221.java index 7b59eaf5b..48d433c1c 100644 --- a/renderer/src/main/java/org/opendaylight/transportpce/renderer/openroadminterface/OpenRoadmInterface221.java +++ b/renderer/src/main/java/org/opendaylight/transportpce/renderer/openroadminterface/OpenRoadmInterface221.java @@ -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"))); diff --git a/renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/DeviceRendererServiceImpl.java b/renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/DeviceRendererServiceImpl.java index 2e0e3cb1e..3fd2e0d1c 100644 --- a/renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/DeviceRendererServiceImpl.java +++ b/renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/DeviceRendererServiceImpl.java @@ -171,14 +171,6 @@ public class DeviceRendererServiceImpl implements DeviceRendererService { this.crossConnect.postCrossConnect(nodeId, waveNumber, srcTp, destTp); if (connectionNameOpt.isPresent()) { nodesProvisioned.add(nodeId); -// List 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); } } diff --git a/renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/RendererServiceOperationsImpl.java b/renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/RendererServiceOperationsImpl.java index 2d0124092..a8052aa60 100644 --- a/renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/RendererServiceOperationsImpl.java +++ b/renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/RendererServiceOperationsImpl.java @@ -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 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 = 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 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; } diff --git a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/MappingConstraints.java b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/MappingConstraints.java index a9f8749e3..f05e58dd6 100644 --- a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/MappingConstraints.java +++ b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/MappingConstraints.java @@ -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 diff --git a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/ModelMappingUtils.java b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/ModelMappingUtils.java index 53675d4b7..0d65c3e6b 100644 --- a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/ModelMappingUtils.java +++ b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/ModelMappingUtils.java @@ -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() { } -- 2.36.6