/** * {@inheritDoc} */ @Override public List<AggregatedExceptionSensorData> getDataForGroupedExceptionOverview(ExceptionSensorData template, Date fromDate, Date toDate) { StorageIndexQuery query = exceptionSensorDataQueryFactory.getDataForGroupedExceptionOverviewQuery(template, fromDate, toDate); List<ExceptionSensorData> resultList = super.executeQuery(query, Aggregators.GROUP_EXCEPTION_OVERVIEW_AGGREGATOR); List<AggregatedExceptionSensorData> filterList = new ArrayList<>(resultList.size()); for (ExceptionSensorData data : resultList) { if (data instanceof AggregatedExceptionSensorData) { filterList.add((AggregatedExceptionSensorData) data); } } return filterList; }
/** * {@inheritDoc} */ @Override public List<AggregatedExceptionSensorData> getDataForGroupedExceptionOverview(ExceptionSensorData template, Date fromDate, Date toDate) { IIndexQuery query = exceptionSensorDataQueryFactory.getDataForGroupedExceptionOverviewQuery(template, fromDate, toDate); List<ExceptionSensorData> results = super.executeQuery(query, Aggregators.GROUP_EXCEPTION_OVERVIEW_AGGREGATOR, true); List<AggregatedExceptionSensorData> aggResults = new ArrayList<>(); for (ExceptionSensorData exData : results) { if (exData instanceof AggregatedExceptionSensorData) { aggResults.add((AggregatedExceptionSensorData) exData); } } return aggResults; }
/** * @return Returns {@link AbstractWriteDataProcessor} for caching the * {@link ExceptionSensorData} grouped view. */ @Bean @Lazy @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) public AbstractWriteDataProcessor getGroupedExceptionsDataCachingDataProcessor() { IIndexQuery query = exceptionSensorDataQueryFactory.getDataForGroupedExceptionOverviewQuery(new ExceptionSensorData(), null, null); IAggregator<ExceptionSensorData> aggregator = Aggregators.GROUP_EXCEPTION_OVERVIEW_AGGREGATOR; return new QueryCachingDataProcessor<>(query, aggregator); }