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));