}
return new StreamingOutput() {
@Override
public void write(OutputStream stream) throws IOException, WebApplicationException {
GenericDriftCriteria criteria = new GenericDriftCriteria();
// Need to fetch the change set so that we can the definition id which is
// needed to build the details url.
criteria.fetchChangeSet(true);
criteria.addFilterChangeSetStartVersion(1);// always start at 1 for this report
if(startTime != null){
criteria.addFilterStartTime(startTime);
}
if(endTime != null){
criteria.addFilterEndTime(endTime);
}
// lets default the end time for them to now if they didnt enter it
if(startTime != null && endTime == null){
Date today = new Date();
criteria.addFilterEndTime(today.getTime());
}
if(snapshot != null) {
log.info("Drift Snapshot version Filter set for: " + snapshot);
criteria.addFilterChangeSetEndVersion(snapshot);
}
if(path != null) {
log.info("Drift Path Filter set for: " + path);
criteria.addFilterPath(path);
}
if(definitionName != null) {
log.info("Drift Definition Filter set for: " + definitionName);
//@todo: drift sorting is done in the resultset after no criteria for definition
}
criteria.addFilterCategories(getCategories());
CriteriaQueryExecutor<DriftComposite, DriftCriteria> queryExecutor =
new CriteriaQueryExecutor<DriftComposite, DriftCriteria>() {
@Override
public PageList<DriftComposite> execute(DriftCriteria criteria) {