Search in sources :

Example 1 with OldGetSites

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;
}
Also used : OldGetSites(org.activityinfo.legacy.shared.command.OldGetSites) SiteResult(org.activityinfo.legacy.shared.command.result.SiteResult) CommandException(org.activityinfo.legacy.shared.exception.CommandException)

Aggregations

OldGetSites (org.activityinfo.legacy.shared.command.OldGetSites)1 SiteResult (org.activityinfo.legacy.shared.command.result.SiteResult)1 CommandException (org.activityinfo.legacy.shared.exception.CommandException)1