use of org.n52.io.quantity.generalize.GeneralizingQuantityService in project series-rest-api by 52North.
the class TimeseriesDataController method getTimeseriesData.
private DataCollection<QuantityData> getTimeseriesData(RequestSimpleParameterSet parameters) {
Stopwatch stopwatch = Stopwatch.startStopwatch();
DataCollection<QuantityData> timeseriesData = parameters.isGeneralize() ? new GeneralizingQuantityService(timeseriesDataService).getData(parameters) : timeseriesDataService.getData(parameters);
LOGGER.debug("Processing request took {} seconds.", stopwatch.stopInSeconds());
return timeseriesData;
}
use of org.n52.io.quantity.generalize.GeneralizingQuantityService in project series-rest-api by 52North.
the class QuantityIoFactory method createProcessChain.
@Override
public IoProcessChain<QuantityData> createProcessChain() {
return new IoProcessChain<QuantityData>() {
@Override
public DataCollection<QuantityData> getData() {
final boolean generalize = getParameters().isGeneralize();
DataService<QuantityData> dataService = generalize ? new GeneralizingQuantityService(getDataService()) : getDataService();
return dataService.getData(getRequestParameters());
}
@Override
public DataCollection<?> getProcessedData() {
String format = getParameters().getFormat();
return FormatterFactory.createFormatterFactory(format).create().format(getData());
}
};
}
Aggregations