log.debug("Received request to generate report for " + caller);
}
return new StreamingOutput() {
@Override
public void write(OutputStream stream) throws IOException, WebApplicationException {
final ResourceOperationHistoryCriteria criteria = new ResourceOperationHistoryCriteria();
criteria.addSortEndTime(PageOrdering.DESC);
if(startTime != null){
criteria.addFilterStartTime(startTime);
}
if(endTime != null){
criteria.addFilterEndTime(endTime);
}
// lets default the end time for them to now if they didn't enter it
if(startTime != null && endTime == null){
Date today = new Date();
criteria.addFilterEndTime(today.getTime());
}
List<OperationRequestStatus> operationRequestStatusList = new ArrayList<OperationRequestStatus>(10);
String statuses[] = operationRequestStatus.split(",");
for (String requestStatus : statuses) {
log.info("OperationRequestStatus Filter set for: " + requestStatus);
operationRequestStatusList.add(OperationRequestStatus.valueOf(requestStatus.toUpperCase()));
}
criteria.addFilterStatuses(operationRequestStatusList.toArray(new OperationRequestStatus[operationRequestStatusList.size()]));
CriteriaQueryExecutor<ResourceOperationHistory, ResourceOperationHistoryCriteria> queryExecutor =
new CriteriaQueryExecutor<ResourceOperationHistory, ResourceOperationHistoryCriteria>() {
@Override
public PageList<ResourceOperationHistory> execute(ResourceOperationHistoryCriteria criteria) {