in src/main/java/org/apache/sling/discovery/impl/TopologyWebConsolePlugin.java [220:311]
private void renderOverview(final PrintWriter pw, final TopologyView topology) {
pw.println("<p class=\"statline ui-state-highlight\">Configuration</p>");
pw.println("<br/>");
pw.print("<a href=\"${appRoot}/configMgr/org.apache.sling.discovery.impl.Config\">Configure Discovery Service</a>");
pw.println("<br/>");
pw.println("<br/>");
final String changing;
if (!topology.isCurrent()) {
changing = " <b><i>CHANGING!</i> (the view is no longer current!)</b>";
} else {
changing = "";
}
pw.println("<p class=\"statline ui-state-highlight\">Topology"+changing+"</p>");
pw.println("<div class=\"ui-widget-header ui-corner-top buttonGroup\" style=\"height: 15px;\">");
pw.println("<span style=\"float: left; margin-left: 1em;\">Instances in the topology</span>");
pw.println("</div>");
pw.println("<table class=\"adapters nicetable ui-widget tablesorter\">");
pw.println("<thead>");
pw.println("<tr>");
pw.println("<th class=\"header ui-widget-header\">Sling id (click for properties)</th>");
pw.println("<th class=\"header ui-widget-header\">ClusterView id</th>");
pw.println("<th class=\"header ui-widget-header\">Local instance</th>");
pw.println("<th class=\"header ui-widget-header\">Leader instance</th>");
pw.println("<th class=\"header ui-widget-header\">In local cluster</th>");
pw.println("<th class=\"header ui-widget-header\">Announced by instance</th>");
pw.println("</tr>");
pw.println("</thead>");
pw.println("<tbody>");
Set<ClusterView> clusters = topology.getClusterViews();
ClusterView myCluster = topology.getLocalInstance().getClusterView();
boolean odd = true;
renderCluster(pw, myCluster, myCluster, odd, topology.isCurrent());
for (Iterator<ClusterView> it = clusters.iterator(); it.hasNext();) {
ClusterView clusterView = it.next();
if (clusterView.equals(myCluster)) {
// skip - I already rendered that
continue;
}
odd = !odd;
renderCluster(pw, clusterView, myCluster, odd, topology.isCurrent());
}
pw.println("</tbody>");
pw.println("</table>");
pw.println("<br/>");
pw.println("<br/>");
pw.println("<p class=\"statline ui-state-highlight\">Connectors</p>");
listIncomingTopologyConnectors(pw);
listOutgoingTopologyConnectors(pw);
pw.println("<br/>");
pw.println("<p class=\"statline ui-state-highlight\">Topology Change History</p>");
pw.println("<pre>");
for (Iterator<String> it = topologyLog
.iterator(); it.hasNext();) {
String aLogEntry = it.next();
pw.println(aLogEntry);
}
pw.println("</pre>");
pw.println("<br/>");
pw.println("<p class=\"statline ui-state-highlight\">Property Change History</p>");
pw.println("<pre>");
for (Iterator<String> it = propertyChangeLog
.iterator(); it.hasNext();) {
String aLogEntry = it.next();
pw.println(aLogEntry);
}
pw.println("</pre>");
pw.println("</br>");
pw.println("<p class=\"statline ui-state-highlight\">SyncTokenService History</p>");
pw.println("<pre>");
if (!config.useSyncTokenService()) {
pw.println("(disabled - useSyncTokenService flag is false)");
} else if (syncTokenService == null) {
pw.println("(no SyncTokenService available)");
} else {
ClusterSyncHistory clusterSyncHistory = syncTokenService.getClusterSyncHistory();
if (clusterSyncHistory == null) {
pw.println("(no history available)");
} else {
for (String syncHistoryEntry : clusterSyncHistory.getSyncHistory()) {
pw.println(syncHistoryEntry);
}
}
}
pw.println("</pre>");
pw.println("<br/>");
}