List<ReportHelper> udpReports = new ArrayList<ReportHelper>();
List<ReportHelper> udpAggregates = new ArrayList<ReportHelper>();
List<ReportHelper> udpSums = new ArrayList<ReportHelper>();
while (!reportQueue.isEmpty() && (numRemoved < 200)) {
ReportHelper rh = reportQueue.remove();
numRemoved++;
// System.out.printf("type: %s, report type: %s\n", rh.getType(), rh.getReportType());
switch (rh.getType()) {
case HTTP:
httpReports.add(rh);
break;
case UDP:
if (rh.getReportType().equals("r"))
udpReports.add(rh);
else if (rh.getReportType().equals("t"))
udpAggregates.add(rh);
else if (rh.getReportType().equals("c"))
udpSums.add(rh);
else
throw new IllegalArgumentException("Invalid report type " + rh.getReportType());
break;
default:
throw new IllegalArgumentException("Unkown type " + rh.getType());
}
}
if (httpReports.size() > 0) {
sendHttpReport(httpReports);