Added ability to track whether or not node has all components running fully.
Change-Id: Ib2b90c7a842976a3b3a9711367fa1eed43103b17
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/ClusterViewMessageHandler.java b/web/gui/src/main/java/org/onosproject/ui/impl/ClusterViewMessageHandler.java
index a7eaaee..ccc7626 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/ClusterViewMessageHandler.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/ClusterViewMessageHandler.java
@@ -44,10 +44,11 @@
private static final String IP = "ip";
private static final String TCP_PORT = "tcp";
private static final String STATE_IID = "_iconid_state";
+ private static final String STARTED_IID = "_iconid_started";
private static final String UPDATED = "updated";
private static final String[] COL_IDS = {
- ID, IP, TCP_PORT, STATE_IID, UPDATED
+ ID, IP, TCP_PORT, STATE_IID, STARTED_IID, UPDATED
};
private static final String ICON_ID_ONLINE = "active";
@@ -95,13 +96,15 @@
ClusterService cs) {
NodeId id = node.id();
DateTime lastUpdated = cs.getLastUpdated(id);
- String iconId = (cs.getState(id) == ControllerNode.State.ACTIVE) ?
- ICON_ID_ONLINE : ICON_ID_OFFLINE;
+ ControllerNode.State state = cs.getState(id);
+ String iconId = state.isActive() ? ICON_ID_ONLINE : ICON_ID_OFFLINE;
+ String startedId = state.isReady() ? ICON_ID_ONLINE : ICON_ID_OFFLINE;
row.cell(ID, id)
.cell(IP, node.ip())
.cell(TCP_PORT, node.tcpPort())
.cell(STATE_IID, iconId)
+ .cell(STARTED_IID, startedId)
.cell(UPDATED, lastUpdated);
}
}
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandlerBase.java b/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandlerBase.java
index b700a54..e1b4bea 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandlerBase.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandlerBase.java
@@ -81,7 +81,6 @@
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Strings.isNullOrEmpty;
-import static org.onosproject.cluster.ControllerNode.State.ACTIVE;
import static org.onosproject.net.DefaultEdgeLink.createEdgeLink;
import static org.onosproject.net.PortNumber.portNumber;
import static org.onosproject.ui.topo.TopoConstants.CoreButtons;
@@ -230,7 +229,7 @@
ObjectNode payload = objectNode()
.put("id", node.id().toString())
.put("ip", node.ip().toString())
- .put("online", clusterService.getState(node.id()) == ACTIVE)
+ .put("online", clusterService.getState(node.id()).isActive())
.put("uiAttached", node.equals(clusterService.getLocalNode()))
.put("switches", switchCount);