private static final String DEPENDENCY = "Dependency";
public ProductLinesDashboard buildDependencyDashboard(long time) {
TopologyGraph topologyGraph = queryTopologyGraph(time);
ProductLinesDashboard dashboardGraph = new ProductLinesDashboard();
Set<String> allDomains = new HashSet<String>();
if (topologyGraph != null) {
Map<String, ProductLine> groups = m_productLineConfigManger.queryAllProductLines();
for (Entry<String, ProductLine> entry : groups.entrySet()) {
String realName = entry.getValue().getTitle();
boolean isDashboard = entry.getValue().getDashboard();
if (isDashboard) {
Map<String, Domain> domains = entry.getValue().getDomains();
for (Domain domain : domains.values()) {
String nodeName = domain.getId();
TopologyNode node = topologyGraph.findTopologyNode(nodeName);
allDomains.add(nodeName);
if (node != null) {
dashboardGraph.addNode(realName, m_graphBuilder.cloneNode(node));
}
}
}
}
Map<String, TopologyEdge> edges = topologyGraph.getEdges();
for (TopologyEdge edge : edges.values()) {
String self = edge.getSelf();
String to = edge.getTarget();
if (allDomains.contains(self) && allDomains.contains(to)) {
dashboardGraph.addEdge(m_graphBuilder.cloneEdge(edge));
}
}
}
return dashboardGraph;
}