Search in sources :

Example 1 with AggregationProcessing

use of org.entcore.common.aggregation.processing.AggregationProcessing in project statistics by OPEN-ENT-NG.

the class AggregateTask method handle.

@Override
public void handle(Long event) {
    log.info("Execute AggregateTask.");
    AggregationProcessing aggProcessing = new AggregationProcessingSequentialImpl();
    IndicatorHelper.addIndicators(from, to, aggProcessing);
    Handler<JsonObject> handler = (this.handler != null) ? this.handler : new Handler<JsonObject>() {

        @Override
        public void handle(JsonObject event) {
            try {
                if (!"ok".equals(event.getString("status", null))) {
                    log.error("Error in AggregateTask : status is different from ok." + event.toString());
                }
            } catch (Exception e) {
                log.error("Error in AggregateTask when checking status", e);
            }
        }
    };
    aggProcessing.process(handler);
}
Also used : AggregationProcessing(org.entcore.common.aggregation.processing.AggregationProcessing) JsonObject(org.vertx.java.core.json.JsonObject)

Aggregations

AggregationProcessing (org.entcore.common.aggregation.processing.AggregationProcessing)1 JsonObject (org.vertx.java.core.json.JsonObject)1