use of org.n52.io.IntervalWithTimeZone in project series-rest-api by 52North.
the class RequestParameterSet method createDefaultTimespan.
private String createDefaultTimespan() {
DateTime now = new DateTime();
DateTime lastWeek = now.minusWeeks(1);
String interval = lastWeek.toString().concat("/").concat(now.toString());
return new IntervalWithTimeZone(interval).toString();
}
use of org.n52.io.IntervalWithTimeZone in project series-rest-api by 52North.
the class RequestSimpleParameterSet method createForSingleSeries.
public static RequestSimpleParameterSet createForSingleSeries(String seriesId, IoParameters parameters) {
RequestSimpleParameterSet parameterSet = parameters.toSimpleParameterSet();
parameterSet.setDatasets(new String[] { seriesId });
IntervalWithTimeZone timespan = parameters.getTimespan();
parameterSet.setTimespan(timespan.toString());
return parameterSet;
}
use of org.n52.io.IntervalWithTimeZone in project series-rest-api by 52North.
the class ChartIoHandler method getTimespan.
private String getTimespan() {
IoParameters parameters = getParameters();
IntervalWithTimeZone timespan = parameters.getTimespan();
return timespan.toString();
}
use of org.n52.io.IntervalWithTimeZone in project series-rest-api by 52North.
the class PreRenderingJob method renderWithStyle.
private void renderWithStyle(String datasetId, RenderingConfig renderingConfig, String interval) throws IOException, DatasetFactoryException, URISyntaxException {
IntervalWithTimeZone timespan = createTimespanFromInterval(datasetId, interval);
IoParameters parameters = createConfig(datasetId, timespan.toString(), renderingConfig);
String chartQualifier = renderingConfig.getChartQualifier();
FileOutputStream fos = createFile(datasetId, interval, chartQualifier);
try (FileOutputStream out = fos) {
createIoFactory(parameters).createHandler(IMAGE_EXTENSION).writeBinary(out);
fos.flush();
} catch (IoHandlerException | IOException e) {
LOGGER.error("Image creation occures error.", e);
}
}
use of org.n52.io.IntervalWithTimeZone in project series-rest-api by 52North.
the class IoParameters method createDefaultTimespan.
private IntervalWithTimeZone createDefaultTimespan() {
DateTime now = new DateTime();
DateTime lastWeek = now.minusWeeks(1);
String interval = lastWeek.toString().concat("/").concat(now.toString());
return new IntervalWithTimeZone(interval);
}
Aggregations