Remove deprecated DefaultPath constructor with a scalar cost
Change-Id: Ifc4104cff773c9c692cc108fda02ce44bc6c2870
diff --git a/apps/optical-model/src/test/java/org/onosproject/net/optical/intent/impl/compiler/OpticalOduIntentCompilerTest.java b/apps/optical-model/src/test/java/org/onosproject/net/optical/intent/impl/compiler/OpticalOduIntentCompilerTest.java
index 1ae85a7..46c408f 100644
--- a/apps/optical-model/src/test/java/org/onosproject/net/optical/intent/impl/compiler/OpticalOduIntentCompilerTest.java
+++ b/apps/optical-model/src/test/java/org/onosproject/net/optical/intent/impl/compiler/OpticalOduIntentCompilerTest.java
@@ -19,6 +19,7 @@
import com.google.common.collect.Sets;
import org.junit.Before;
import org.junit.Test;
+import org.onlab.graph.ScalarWeight;
import org.onlab.packet.ChassisId;
import org.onosproject.TestApplicationId;
import org.onosproject.core.ApplicationId;
@@ -161,7 +162,7 @@
DefaultLink.builder().providerId(PID).src(d1p2).dst(d2p1).type(OPTICAL).build(),
DefaultLink.builder().providerId(PID).src(d2p2).dst(d3p1).type(OPTICAL).build()
);
- private final Path path = new DefaultPath(PID, links, 3);
+ private final Path path = new DefaultPath(PID, links, ScalarWeight.toWeight(3));
private OpticalOduIntent intent;
diff --git a/apps/optical-model/src/test/java/org/onosproject/net/optical/intent/impl/compiler/OpticalPathIntentCompilerTest.java b/apps/optical-model/src/test/java/org/onosproject/net/optical/intent/impl/compiler/OpticalPathIntentCompilerTest.java
index d8ae141..43c279d 100644
--- a/apps/optical-model/src/test/java/org/onosproject/net/optical/intent/impl/compiler/OpticalPathIntentCompilerTest.java
+++ b/apps/optical-model/src/test/java/org/onosproject/net/optical/intent/impl/compiler/OpticalPathIntentCompilerTest.java
@@ -17,6 +17,7 @@
import org.junit.Before;
import org.junit.Test;
+import org.onlab.graph.ScalarWeight;
import org.onosproject.TestApplicationId;
import org.onosproject.core.ApplicationId;
import org.onosproject.core.CoreService;
@@ -78,7 +79,7 @@
.appId(appId)
.src(d1p1)
.dst(d3p1)
- .path(new DefaultPath(PID, links, hops))
+ .path(new DefaultPath(PID, links, ScalarWeight.toWeight(hops)))
.lambda(createLambda())
.signalType(OchSignalType.FIXED_GRID)
.build();
diff --git a/apps/pce/app/src/main/java/org/onosproject/pce/pceservice/PceManager.java b/apps/pce/app/src/main/java/org/onosproject/pce/pceservice/PceManager.java
index d1e3d66..3ecdd5b 100644
--- a/apps/pce/app/src/main/java/org/onosproject/pce/pceservice/PceManager.java
+++ b/apps/pce/app/src/main/java/org/onosproject/pce/pceservice/PceManager.java
@@ -17,6 +17,7 @@
import static com.google.common.base.Preconditions.checkNotNull;
+import org.onlab.graph.ScalarWeight;
import org.onosproject.net.DisjointPath;
import java.util.ArrayList;
import java.util.Collection;
@@ -532,7 +533,8 @@
links.addAll(path.links());
totalCost = totalCost + path.cost();
}
- computedPathSet.add(new DefaultPath(finalComputedPath.iterator().next().providerId(), links, totalCost));
+ computedPathSet.add(new DefaultPath(finalComputedPath.iterator().next().providerId(), links,
+ ScalarWeight.toWeight(totalCost)));
} else {
computedPathSet = computePath(src, dst, constraints);
}
@@ -804,7 +806,7 @@
totalCost = totalCost + path.cost();
}
computedPathSet.add(new DefaultPath(finalComputedPath.iterator().next().providerId(),
- totalLinks, totalCost));
+ totalLinks, ScalarWeight.toWeight(totalCost)));
} else {
computedPathSet = computePath(tunnel.path().src().deviceId(), tunnel.path().dst().deviceId(),
constraints);
diff --git a/apps/pce/pcerest/src/test/java/org/onosproject/pcerest/PcePathResourceTest.java b/apps/pce/pcerest/src/test/java/org/onosproject/pcerest/PcePathResourceTest.java
index 51f5c2d..1e35395 100644
--- a/apps/pce/pcerest/src/test/java/org/onosproject/pcerest/PcePathResourceTest.java
+++ b/apps/pce/pcerest/src/test/java/org/onosproject/pcerest/PcePathResourceTest.java
@@ -44,6 +44,7 @@
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import org.onlab.graph.ScalarWeight;
import org.onlab.junit.TestUtils;
import org.onlab.osgi.ServiceDirectory;
import org.onlab.osgi.TestServiceDirectory;
@@ -165,7 +166,7 @@
linkList.add(l4);
// Path
- path = new DefaultPath(providerId, linkList, 10);
+ path = new DefaultPath(providerId, linkList, ScalarWeight.toWeight(10));
// Annotations
DefaultAnnotations.Builder builderAnn = DefaultAnnotations.builder();
diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/EcmpShortestPathGraph.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/EcmpShortestPathGraph.java
index 49bf80f..c9bd596 100644
--- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/EcmpShortestPathGraph.java
+++ b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/EcmpShortestPathGraph.java
@@ -15,6 +15,7 @@
*/
package org.onosproject.segmentrouting;
+import org.onlab.graph.ScalarWeight;
import org.onosproject.net.DefaultLink;
import org.onosproject.net.DefaultPath;
import org.onosproject.net.Device;
@@ -131,7 +132,7 @@
sofarLinks.addAll(path.links());
}
sofarLinks.add(upstreamLink);
- sofarPath = new DefaultPath(ProviderId.NONE, sofarLinks, 0);
+ sofarPath = new DefaultPath(ProviderId.NONE, sofarLinks, ScalarWeight.toWeight(0));
if (upstreamLink.src().deviceId().equals(rootDeviceDeviceId)) {
paths.add(sofarPath);
return;