int count = Integer.MAX_VALUE;
if (countParam != null) {
count = Integer.parseInt(countParam);
}
PingDataCollector collector = (PingDataCollector) context.getAttribute(PingDataCollector.KEY);
// get the data we want
List<PingData> data = collector.getData(after, count);
// find out how much data there is
int dataSize = collector.getDataSize();
ResponseBuilder rb = Response.ok(new PingDataCollection(dataSize, data));
return rb.build();
}