JsonBuilder jb = new JsonBuilder();
List<Pair<String, String>> netGraphData = new ArrayList<Pair<String, String>>();
long current = System.currentTimeMillis();
long currentHours = current - current % TimeHelper.ONE_HOUR;
long startTime = start.getTime();
NetGraphSet netGraphSet = null;
if (startTime >= currentHours) {
netGraphSet = m_currentNetGraphSet;
} else if (startTime == currentHours - TimeHelper.ONE_HOUR) {
netGraphSet = m_lastNetGraphSet;
} else {
netGraphSet = m_reportService.queryNetTopologyReport(Constants.CAT, start, new Date(start.getTime()
+ TimeHelper.ONE_HOUR));
}
if (netGraphSet != null) {
NetGraph netGraph = netGraphSet.findNetGraph(minute);
if (netGraph != null) {
for (NetTopology netTopology : netGraph.getNetTopologies()) {
String topoName = netTopology.getName();
String data = jb.toJson(netTopology);