List<List<MeasurementDataNumericHighLowComposite>> listList =
dataManager.findDataForContext(caller, EntityContext.forResource(sched.getResource().getId()),definitionId,startTime,endTime,dataPoints);
if (!listList.isEmpty()) {
MeasurementAggregate measurementAggregate = dataManager.getMeasurementAggregate(caller,scheduleId,startTime,endTime);
List<MeasurementDataNumericHighLowComposite> list = listList.get(0);
MetricAggregate res = new MetricAggregate(scheduleId,measurementAggregate.getMin(),measurementAggregate.getAvg(),measurementAggregate.getMax());
boolean isHtml = mediaType.equals(MediaType.TEXT_HTML_TYPE);
res = fillInDatapoints(res, list, scheduleId, hideEmpty, isHtml);
resList.add(res);
}
else