use of org.activityinfo.legacy.shared.command.OldGetSites in project activityinfo by bedatadriven.
the class GetSitesHandler method execute.
@Override
public SiteResult execute(GetSites cmd, User user) {
if (useLegacyMethod(cmd, user)) {
return dispatcher.execute(new OldGetSites(cmd));
}
LOGGER.info("Entering execute()");
aggregateTime.start();
try {
initialiseHandler(cmd, user);
fetchActivityMetadata(cmd.getFilter());
queryFormTrees();
constructActivityLinks();
buildQueries();
batchQueries();
executeBatch();
mergeMonthlyRootSites();
setSitesLinkedStatus();
sort();
} catch (CommandException excp) {
// old method at any point of execution and elongate the return time
return dispatcher.execute(new OldGetSites(cmd));
}
aggregateTime.stop();
printTimes();
SiteResult result = new SiteResult(siteList);
result.setOffset(cmd.getOffset());
result.setTotalLength(totalResultLength);
LOGGER.info("Exiting execute()");
return result;
}
Aggregations