/** * Get the temporal filter with valueReference phenomenonTime from extensions * * @param extensions To get filter from * @return Temporal filter with valueReference phenomenonTime */ private TemporalFilter getPhenomenonTimeFilter(SwesExtensions extensions) { for (SwesExtension<?> extension : extensions.getExtensions()) { if (extension.getValue() instanceof TemporalFilter) { TemporalFilter filter = (TemporalFilter) extension.getValue(); if (TemporalRestrictions.PHENOMENON_TIME_VALUE_REFERENCE.equals( filter.getValueReference())) { return filter; } } } return null; }
/** * Check if extensions contains a temporal filter with valueReference phenomenonTime * * @param extensions Extensions to check * @return <code>true</code>, if extensions contains a temporal filter with valueReference * phenomenonTime */ private boolean hasPhenomenonTimeFilter(SwesExtensions extensions) { boolean hasFilter = false; for (SwesExtension<?> extension : extensions.getExtensions()) { if (extension.getValue() instanceof TemporalFilter) { TemporalFilter filter = (TemporalFilter) extension.getValue(); if (TemporalRestrictions.PHENOMENON_TIME_VALUE_REFERENCE.equals( filter.getValueReference())) { hasFilter = true; } } } return hasFilter; }
public ReportObligationType getFlow(SwesExtensions extensions) throws InvalidParameterValueException { if (hasFlowExtension(extensions)) { SwesExtension<?> extension = extensions.getExtension(AqdConstants.EXTENSION_FLOW); if (extension.getValue() instanceof SweText) { try { return ReportObligationType.from(((SweText) extension.getValue()).getValue()); } catch (IllegalArgumentException iae) { throw new InvalidParameterValueException( AqdConstants.EXTENSION_FLOW, ((SweText) extension.getValue()).getValue()); } } } return ReportObligationType.E2A; }