}
return dashboardGraph;
}
public TopologyGraph buildTopologyGraph(String domain, long time) {
TopologyGraph all = queryTopologyGraph(time);
TopologyGraph topylogyGraph = new TopologyGraph();
topylogyGraph.setId(domain);
topylogyGraph.setType(GraphConstrant.PROJECT);
topylogyGraph.setStatus(GraphConstrant.OK);
if (all != null) {
TopologyNode node = all.findTopologyNode(domain);
if (node != null) {
topylogyGraph.setDes(node.getDes());
topylogyGraph.setStatus(node.getStatus());
topylogyGraph.setType(node.getType());
}
Collection<TopologyEdge> edges = all.getEdges().values();
for (TopologyEdge edge : edges) {
String self = edge.getSelf();
String target = edge.getTarget();
TopologyEdge cloneEdge = m_graphBuilder.cloneEdge(edge);
if (self.equals(domain)) {
TopologyNode other = all.findTopologyNode(target);
if (other != null) {
topylogyGraph.addTopologyNode(m_graphBuilder.cloneNode(other));
} else {
topylogyGraph.addTopologyNode(m_graphBuilder.createNode(target));
}
edge.setOpposite(false);
topylogyGraph.addTopologyEdge(cloneEdge);
} else if (target.equals(domain)) {
TopologyNode other = all.findTopologyNode(self);
if (other != null) {
topylogyGraph.addTopologyNode(m_graphBuilder.cloneNode(other));
} else {
topylogyGraph.addTopologyNode(m_graphBuilder.createNode(target));
}
cloneEdge.setTarget(edge.getSelf());
cloneEdge.setSelf(edge.getTarget());
cloneEdge.setOpposite(true);
topylogyGraph.addTopologyEdge(cloneEdge);
}
}
}
return topylogyGraph;
}