[ONOS-4164] todo removal
Change-Id: Iaed7a5d2960529ecd548897b546a8804bbc9da27
diff --git a/apps/pce/app/src/main/java/org/onosproject/pce/rest/PcePathWebResource.java b/apps/pce/app/src/main/java/org/onosproject/pce/rest/PcePathWebResource.java
index abd7c88..a54e0b2 100644
--- a/apps/pce/app/src/main/java/org/onosproject/pce/rest/PcePathWebResource.java
+++ b/apps/pce/app/src/main/java/org/onosproject/pce/rest/PcePathWebResource.java
@@ -53,7 +53,6 @@
/**
* Query and program pce path.
*/
-
@Path("path")
public class PcePathWebResource extends AbstractWebResource {
@@ -124,14 +123,11 @@
LspType lspType = path.lspType();
List<Constraint> listConstrnt = new LinkedList<Constraint>();
- // add cost
- //TODO: need to uncomment below lines once Bandwidth and Cost constraint classes are ready
- //CostConstraint.Type costType = CostConstraint.Type.values()[Integer.valueOf(path.constraint().cost())];
- //listConstrnt.add(CostConstraint.of(costType));
+ // Add bandwidth
+ listConstrnt.add(path.bandwidthConstraint());
- // add bandwidth. Data rate unit is in BPS.
- //listConstrnt.add(LocalBandwidthConstraint.of(Double.valueOf(path.constraint().bandwidth()), DataRateUnit
- // .valueOf("BPS")));
+ // Add cost
+ listConstrnt.add(path.costConstraint());
Boolean issuccess = nullIsNotFound(get(PceService.class)
.setupPath(srcDevice, dstDevice, path.name(), listConstrnt, lspType),
@@ -161,19 +157,15 @@
ObjectNode jsonTree = (ObjectNode) mapper().readTree(stream);
JsonNode pathNode = jsonTree.get("path");
PcePath path = codec(PcePath.class).decode((ObjectNode) pathNode, this);
- // Assign cost
List<Constraint> constrntList = new LinkedList<Constraint>();
- //TODO: need to uncomment below lines once CostConstraint class is ready
- if (path.costConstraint() != null) {
- //CostConstraint.Type costType = CostConstraint.Type.values()[path.constraint().cost()];
- //constrntList.add(CostConstraint.of(costType));
+ // Assign bandwidth
+ if (path.bandwidthConstraint() != null) {
+ constrntList.add(path.bandwidthConstraint());
}
- // Assign bandwidth. Data rate unit is in BPS.
- if (path.bandwidthConstraint() != null) {
- //TODO: need to uncomment below lines once BandwidthConstraint class is ready
- //constrntList.add(LocalBandwidthConstraint
- // .of(path.constraint().bandwidth(), DataRateUnit.valueOf("BPS")));
+ // Assign cost
+ if (path.costConstraint() != null) {
+ constrntList.add(path.costConstraint());
}
Boolean result = nullIsNotFound(get(PceService.class).updatePath(TunnelId.valueOf(id), constrntList),