Re-assembled the topology subsystem.
diff --git a/core/api/src/main/java/org/onlab/onos/net/topology/ClusterId.java b/core/api/src/main/java/org/onlab/onos/net/topology/ClusterId.java
index af8f122..502eee1 100644
--- a/core/api/src/main/java/org/onlab/onos/net/topology/ClusterId.java
+++ b/core/api/src/main/java/org/onlab/onos/net/topology/ClusterId.java
@@ -27,6 +27,15 @@
return new ClusterId(id);
}
+ /**
+ * Returns the backing integer index.
+ *
+ * @return backing integer index
+ */
+ public int index() {
+ return id;
+ }
+
@Override
public int hashCode() {
return Objects.hash(id);
diff --git a/core/api/src/main/java/org/onlab/onos/net/topology/GraphDescription.java b/core/api/src/main/java/org/onlab/onos/net/topology/GraphDescription.java
new file mode 100644
index 0000000..2b846a0
--- /dev/null
+++ b/core/api/src/main/java/org/onlab/onos/net/topology/GraphDescription.java
@@ -0,0 +1,34 @@
+package org.onlab.onos.net.topology;
+
+import com.google.common.collect.ImmutableSet;
+import org.onlab.onos.net.Description;
+
+/**
+ * Describes attribute(s) of a network graph.
+ */
+public interface GraphDescription extends Description {
+
+ /**
+ * Returns the creation timestamp of the graph description. This is
+ * expressed in system nanos to allow proper sequencing.
+ *
+ * @return graph description creation timestamp
+ */
+ long timestamp();
+
+ /**
+ * Returns the set of topology graph vertexes.
+ *
+ * @return set of graph vertexes
+ */
+ ImmutableSet<TopologyVertex> vertexes();
+
+ /**
+ * Returns the set of topology graph edges.
+ *
+ * @return set of graph edges
+ */
+ ImmutableSet<TopologyEdge> edges();
+
+}
+
diff --git a/core/api/src/main/java/org/onlab/onos/net/topology/LinkWeight.java b/core/api/src/main/java/org/onlab/onos/net/topology/LinkWeight.java
index 89ef577..5e18dfb 100644
--- a/core/api/src/main/java/org/onlab/onos/net/topology/LinkWeight.java
+++ b/core/api/src/main/java/org/onlab/onos/net/topology/LinkWeight.java
@@ -6,5 +6,5 @@
* Entity capable of determining cost or weight of a specified topology
* graph edge.
*/
-public interface LinkWeight extends EdgeWeight<TopoVertex, TopoEdge> {
+public interface LinkWeight extends EdgeWeight<TopologyVertex, TopologyEdge> {
}
diff --git a/core/api/src/main/java/org/onlab/onos/net/topology/TopologyDescription.java b/core/api/src/main/java/org/onlab/onos/net/topology/TopologyDescription.java
deleted file mode 100644
index bcb199d..0000000
--- a/core/api/src/main/java/org/onlab/onos/net/topology/TopologyDescription.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package org.onlab.onos.net.topology;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.ImmutableSetMultimap;
-import org.onlab.graph.Graph;
-import org.onlab.onos.net.Description;
-import org.onlab.onos.net.DeviceId;
-import org.onlab.onos.net.Link;
-
-import static org.onlab.graph.GraphPathSearch.Result;
-
-/**
- * Describes attribute(s) of a network topology.
- */
-public interface TopologyDescription extends Description {
-
- /**
- * Returns the creation timestamp of the topology description. This is
- * expressed in system nanos to allow proper sequencing.
- *
- * @return topology description creation timestamp
- */
- long timestamp();
-
- /**
- * Returns the topology graph in immutable form.
- *
- * @return network graph
- */
- Graph<TopoVertex, TopoEdge> graph();
-
- /**
- * Returns an immutable map of path search results for each source device.
- *
- * @return map of path search result for each source node
- */
- ImmutableMap<DeviceId, Result<TopoVertex, TopoEdge>> pathsBySource();
-
- /**
- * Returns the set of topology SCC clusters.
- *
- * @return set of SCC clusters
- */
- ImmutableSet<TopologyCluster> clusters();
-
- /**
- * Returns an immutable set multi-map of devices for each cluster.
- *
- * @return set multi-map of devices that belong to each cluster
- */
- ImmutableSetMultimap<TopologyCluster, DeviceId> devicesByCluster();
-
- /**
- * Returns an immutable set multi-map of links for each cluster.
- *
- * @return set multi-map of links that belong to each cluster
- */
- ImmutableSetMultimap<TopologyCluster, Link> linksByCluster();
-
-}
-
diff --git a/core/api/src/main/java/org/onlab/onos/net/topology/TopoEdge.java b/core/api/src/main/java/org/onlab/onos/net/topology/TopologyEdge.java
similarity index 82%
rename from core/api/src/main/java/org/onlab/onos/net/topology/TopoEdge.java
rename to core/api/src/main/java/org/onlab/onos/net/topology/TopologyEdge.java
index ef94eca..d9cd6f4 100644
--- a/core/api/src/main/java/org/onlab/onos/net/topology/TopoEdge.java
+++ b/core/api/src/main/java/org/onlab/onos/net/topology/TopologyEdge.java
@@ -6,7 +6,7 @@
/**
* Represents an edge in the topology graph.
*/
-public interface TopoEdge extends Edge<TopoVertex> {
+public interface TopologyEdge extends Edge<TopologyVertex> {
/**
* Returns the associated infrastructure link.
diff --git a/core/api/src/main/java/org/onlab/onos/net/topology/TopologyGraph.java b/core/api/src/main/java/org/onlab/onos/net/topology/TopologyGraph.java
new file mode 100644
index 0000000..70139cd
--- /dev/null
+++ b/core/api/src/main/java/org/onlab/onos/net/topology/TopologyGraph.java
@@ -0,0 +1,10 @@
+package org.onlab.onos.net.topology;
+
+import org.onlab.graph.Graph;
+
+/**
+ * Represents an immutable topology graph.
+ */
+public interface TopologyGraph extends Graph<TopologyVertex, TopologyEdge> {
+
+}
diff --git a/core/api/src/main/java/org/onlab/onos/net/topology/TopologyProviderService.java b/core/api/src/main/java/org/onlab/onos/net/topology/TopologyProviderService.java
index 0e03767..c81a871 100644
--- a/core/api/src/main/java/org/onlab/onos/net/topology/TopologyProviderService.java
+++ b/core/api/src/main/java/org/onlab/onos/net/topology/TopologyProviderService.java
@@ -10,16 +10,13 @@
*/
public interface TopologyProviderService extends ProviderService<TopologyProvider> {
- // What can be conveyed in a topology that isn't by individual
- // providers?
-
/**
* Signals the core that some aspect of the topology has changed.
*
- * @param topoDescription information about topology
- * @param reasons events that triggered topology change
+ * @param graphDescription information about the network graph
+ * @param reasons events that triggered topology change
*/
- void topologyChanged(TopologyDescription topoDescription,
+ void topologyChanged(GraphDescription graphDescription,
List<Event> reasons);
}
diff --git a/core/api/src/main/java/org/onlab/onos/net/topology/TopologyService.java b/core/api/src/main/java/org/onlab/onos/net/topology/TopologyService.java
index 149804b..d8470e7 100644
--- a/core/api/src/main/java/org/onlab/onos/net/topology/TopologyService.java
+++ b/core/api/src/main/java/org/onlab/onos/net/topology/TopologyService.java
@@ -1,6 +1,5 @@
package org.onlab.onos.net.topology;
-import org.onlab.graph.Graph;
import org.onlab.onos.net.ConnectPoint;
import org.onlab.onos.net.DeviceId;
import org.onlab.onos.net.Path;
@@ -41,7 +40,7 @@
* @param topology topology descriptor
* @return topology graph view
*/
- Graph<TopoVertex, TopoEdge> getGraph(Topology topology);
+ TopologyGraph getGraph(Topology topology);
/**
* Returns the set of all shortest paths, precomputed in terms of hop-count,
diff --git a/core/api/src/main/java/org/onlab/onos/net/topology/TopoVertex.java b/core/api/src/main/java/org/onlab/onos/net/topology/TopologyVertex.java
similarity index 86%
rename from core/api/src/main/java/org/onlab/onos/net/topology/TopoVertex.java
rename to core/api/src/main/java/org/onlab/onos/net/topology/TopologyVertex.java
index d5a8b95..96a918f 100644
--- a/core/api/src/main/java/org/onlab/onos/net/topology/TopoVertex.java
+++ b/core/api/src/main/java/org/onlab/onos/net/topology/TopologyVertex.java
@@ -6,7 +6,7 @@
/**
* Represents a vertex in the topology graph.
*/
-public interface TopoVertex extends Vertex {
+public interface TopologyVertex extends Vertex {
/**
* Returns the associated infrastructure device identification.