ONOS-4971: Synthetic Link Data -- WIP
- adding CLI commands for dumping Model Cache contents.
Change-Id: I28dfe179835de6cd0c5356faf87af46a239eb772
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/topo/model/ModelCache.java b/web/gui/src/main/java/org/onosproject/ui/impl/topo/model/ModelCache.java
index e3fedd1..4ca6b42 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/topo/model/ModelCache.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/topo/model/ModelCache.java
@@ -298,6 +298,10 @@
}
}
+ Set<UiDevice> getAllDevices() {
+ return uiTopology.allDevices();
+ }
+
// === LINKS
@@ -357,6 +361,9 @@
}
}
+ Set<UiLink> getAllLinks() {
+ return uiTopology.allLinks();
+ }
// === HOSTS
@@ -460,6 +467,10 @@
}
}
+ Set<UiHost> getAllHosts() {
+ return uiTopology.allHosts();
+ }
+
/**
* Refreshes the internal state.
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/topo/model/UiSharedTopologyModel.java b/web/gui/src/main/java/org/onosproject/ui/impl/topo/model/UiSharedTopologyModel.java
index 52eea69..4a5cc91 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/topo/model/UiSharedTopologyModel.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/topo/model/UiSharedTopologyModel.java
@@ -63,6 +63,9 @@
import org.onosproject.ui.impl.topo.UiTopoSession;
import org.onosproject.ui.model.ServiceBundle;
import org.onosproject.ui.model.topo.UiClusterMember;
+import org.onosproject.ui.model.topo.UiDevice;
+import org.onosproject.ui.model.topo.UiHost;
+import org.onosproject.ui.model.topo.UiLink;
import org.onosproject.ui.model.topo.UiRegion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -200,7 +203,14 @@
// Methods for topo session (or CLI) to use to get information from us
/**
- * Returns the list of cluster members stored in our model cache.
+ * Refreshes the cache's internal state.
+ */
+ public void refresh() {
+ cache.refresh();
+ }
+
+ /**
+ * Returns the list of cluster members stored in the model cache.
*
* @return list of cluster members
*/
@@ -209,7 +219,7 @@
}
/**
- * Returns the set of regions stored in our model cache.
+ * Returns the set of regions stored in the model cache.
*
* @return set of regions
*/
@@ -237,10 +247,30 @@
}
/**
- * Refreshes the cache's internal state.
+ * Returns the set of devices stored in the model cache.
+ *
+ * @return set of devices
*/
- public void refresh() {
- cache.refresh();
+ public Set<UiDevice> getDevices() {
+ return cache.getAllDevices();
+ }
+
+ /**
+ * Returns the set of hosts stored in the model cache.
+ *
+ * @return set of hosts
+ */
+ public Set<UiHost> getHosts() {
+ return cache.getAllHosts();
+ }
+
+ /**
+ * Returns the set of links stored in the model cache.
+ *
+ * @return set of links
+ */
+ public Set<UiLink> getLinks() {
+ return cache.getAllLinks();
}
// =====================================================================