Disjoint Path Utils Exposed
- to TopologyStores
- to TopologyServices
- to PathServices
- to REST API
Change-Id: Ib2b5840df0f8e94f327ec8f91827d3d850634562
Change-Id: I03e59210e9c79c4f92dcfa8c7983642572708429
Change-Id: Ia5c17d1ded374ef688990bd30e7f99184aaca95b
Change-Id: Ibebae50bc722701e8212263587727ad8abd79805
diff --git a/core/common/src/main/java/org/onosproject/common/DefaultTopology.java b/core/common/src/main/java/org/onosproject/common/DefaultTopology.java
index 08b5245..f2f86ea 100644
--- a/core/common/src/main/java/org/onosproject/common/DefaultTopology.java
+++ b/core/common/src/main/java/org/onosproject/common/DefaultTopology.java
@@ -322,8 +322,9 @@
}
return builder.build();
}
+
/**
- /**
+ * /**
* Returns the set of pre-computed shortest disjoint path pairs between source and
* destination devices.
*
@@ -331,7 +332,7 @@
* @param dst destination device
* @return set of shortest disjoint path pairs
*/
- Set<DisjointPath> getDisjointPaths(DeviceId src, DeviceId dst) {
+ public Set<DisjointPath> getDisjointPaths(DeviceId src, DeviceId dst) {
return getDisjointPaths(src, dst, null);
}
@@ -344,7 +345,7 @@
* @param weight link weight function
* @return set of disjoint shortest path pairs
*/
- Set<DisjointPath> getDisjointPaths(DeviceId src, DeviceId dst, LinkWeight weight) {
+ public Set<DisjointPath> getDisjointPaths(DeviceId src, DeviceId dst, LinkWeight weight) {
final DefaultTopologyVertex srcV = new DefaultTopologyVertex(src);
final DefaultTopologyVertex dstV = new DefaultTopologyVertex(dst);
Set<TopologyVertex> vertices = graph.getVertexes();
@@ -366,12 +367,12 @@
* Computes on-demand the set of shortest disjoint risk groups path pairs between source and
* destination devices.
*
- * @param src source device
- * @param dst destination device
- * @param riskProfile map representing risk groups for each edge
- * @return set of shortest disjoint paths
+ * @param src source device
+ * @param dst destination device
+ * @param riskProfile map representing risk groups for each edge
+ * @return set of shortest disjoint paths
*/
- Set<DisjointPath> getSRLGDisjointPathsD(DeviceId src, DeviceId dst, Map<TopologyEdge, Object> riskProfile) {
+ public Set<DisjointPath> getSRLGDisjointPathsD(DeviceId src, DeviceId dst, Map<TopologyEdge, Object> riskProfile) {
return getSRLGDisjointPathsD(src, dst, null, riskProfile);
}
@@ -379,13 +380,13 @@
* Computes on-demand the set of shortest disjoint risk groups path pairs between source and
* destination devices.
*
- * @param src source device
- * @param dst destination device
- * @param weight edge weight object
- * @param riskProfile map representing risk groups for each edge
+ * @param src source device
+ * @param dst destination device
+ * @param weight edge weight object
+ * @param riskProfile map representing risk groups for each edge
* @return set of shortest disjoint paths
*/
- Set<DisjointPath> getSRLGDisjointPathsD(DeviceId src, DeviceId dst, LinkWeight weight, Map<TopologyEdge,
+ public Set<DisjointPath> getSRLGDisjointPathsD(DeviceId src, DeviceId dst, LinkWeight weight, Map<TopologyEdge,
Object> riskProfile) {
final DefaultTopologyVertex srcV = new DefaultTopologyVertex(src);
final DefaultTopologyVertex dstV = new DefaultTopologyVertex(dst);
@@ -409,14 +410,14 @@
* Computes on-demand the set of shortest disjoint risk groups path pairs between source and
* destination devices.
*
- * @param src source device
- * @param dst destination device
- * @param weight edge weight object
- * @param riskProfile map representing risk groups for each link
+ * @param src source device
+ * @param dst destination device
+ * @param weight edge weight object
+ * @param riskProfile map representing risk groups for each link
* @return set of shortest disjoint paths
*/
- Set<DisjointPath> getSRLGDisjointPaths(DeviceId src, DeviceId dst, LinkWeight weight,
- Map<Link, Object> riskProfile) {
+ public Set<DisjointPath> getSRLGDisjointPaths(DeviceId src, DeviceId dst, LinkWeight weight,
+ Map<Link, Object> riskProfile) {
Map<TopologyEdge, Object> riskProfile2 = new HashMap<>();
for (Link l : riskProfile.keySet()) {
riskProfile2.put(new TopologyEdge() {
@@ -450,12 +451,12 @@
* Computes on-demand the set of shortest disjoint risk groups path pairs between source and
* destination devices.
*
- * @param src source device
- * @param dst destination device
- * @param riskProfile map representing risk groups for each link
+ * @param src source device
+ * @param dst destination device
+ * @param riskProfile map representing risk groups for each link
* @return set of shortest disjoint paths
*/
- Set<DisjointPath> getSRLGDisjointPaths(DeviceId src, DeviceId dst, Map<Link, Object> riskProfile) {
+ public Set<DisjointPath> getSRLGDisjointPaths(DeviceId src, DeviceId dst, Map<Link, Object> riskProfile) {
return getSRLGDisjointPaths(src, dst, null, riskProfile);
}
diff --git a/core/common/src/test/java/org/onosproject/store/trivial/SimpleTopologyStore.java b/core/common/src/test/java/org/onosproject/store/trivial/SimpleTopologyStore.java
index 6a89c01..0246d42 100644
--- a/core/common/src/test/java/org/onosproject/store/trivial/SimpleTopologyStore.java
+++ b/core/common/src/test/java/org/onosproject/store/trivial/SimpleTopologyStore.java
@@ -23,6 +23,7 @@
import org.onosproject.event.Event;
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.DeviceId;
+import org.onosproject.net.DisjointPath;
import org.onosproject.net.Link;
import org.onosproject.net.Path;
import org.onosproject.net.provider.ProviderId;
@@ -39,6 +40,7 @@
import org.slf4j.Logger;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import static org.slf4j.LoggerFactory.getLogger;
@@ -114,6 +116,29 @@
}
@Override
+ public Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst) {
+ return defaultTopology(topology).getDisjointPaths(src, dst);
+ }
+
+ @Override
+ public Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst,
+ LinkWeight weight) {
+ return defaultTopology(topology).getDisjointPaths(src, dst, weight);
+ }
+
+ @Override
+ public Set<DisjointPath> getSRLGDisjointPaths(Topology topology, DeviceId src, DeviceId dst,
+ Map<Link, Object> riskProfile) {
+ return defaultTopology(topology).getSRLGDisjointPaths(src, dst, riskProfile);
+ }
+
+ @Override
+ public Set<DisjointPath> getSRLGDisjointPaths(Topology topology, DeviceId src, DeviceId dst,
+ LinkWeight weight, Map<Link, Object> riskProfile) {
+ return defaultTopology(topology).getSRLGDisjointPaths(src, dst, weight, riskProfile);
+ }
+
+ @Override
public boolean isInfrastructure(Topology topology, ConnectPoint connectPoint) {
return defaultTopology(topology).isInfrastructure(connectPoint);
}