Class IoParameters

    • Constructor Detail

      • IoParameters

        protected IoParameters()
      • IoParameters

        protected IoParameters​(IoParameters other)
      • IoParameters

        protected IoParameters​(Map<String,​com.fasterxml.jackson.databind.JsonNode> queryParameters)
      • IoParameters

        protected IoParameters​(Map<String,​com.fasterxml.jackson.databind.JsonNode> queryParameters,
                               File defaults)
      • IoParameters

        protected IoParameters​(org.springframework.util.MultiValueMap<String,​com.fasterxml.jackson.databind.JsonNode> queryParameters)
      • IoParameters

        protected IoParameters​(org.springframework.util.MultiValueMap<String,​com.fasterxml.jackson.databind.JsonNode> queryParameters,
                               File defaults)
    • Method Detail

      • shallBehaveBackwardsCompatible

        public boolean shallBehaveBackwardsCompatible()
      • getOffset

        public int getOffset()
        Returns:
        the value of "offset" parameter. If not present, the default -1 is returned.
        Throws:
        IoParseException - if parameter could not be parsed.
      • getLimit

        public int getLimit()
        Returns:
        the value of "limit" parameter. If not present, the default -1 is returned.
        Throws:
        IoParseException - if parameter could not be parsed.
      • getWidth

        public int getWidth()
        Returns:
        the requested chart width in pixels or the default 800.
        Throws:
        IoParseException - if parsing parameter fails.
      • getHeight

        public int getHeight()
        Returns the requested chart height in pixels.
        Returns:
        the requested chart height in pixels or the default 500.
        Throws:
        IoParseException - if parsing parameter fails.
      • isBase64

        public boolean isBase64()
        Indicates if rendered chart shall be returned as Base64 encoded string.
        Returns:
        the value of parameter "base64" or the default false.
        Throws:
        IoParseException - if parsing parameter fails.
      • isGrid

        public boolean isGrid()
        Returns:
        true if timeseries chart shall include a background grid.
        Throws:
        IoParseException - if parsing parameter fails.
      • isGeneralize

        public boolean isGeneralize()
        Returns:
        true if timeseries data shall be generalized.
        Throws:
        IoParseException - if parsing parameter fails.
      • isLegend

        public boolean isLegend()
        Returns:
        true if a legend shall be included when rendering a chart, false otherwise.
        Throws:
        IoParseException - if parsing parameter fails.
      • isDefaultLocal

        public boolean isDefaultLocal()
      • getDefaultLocale

        public String getDefaultLocale()
      • getSingleStyle

        public StyleProperties getSingleStyle()
        Returns:
        the value of "style" parameter. If not present, the default styles are returned.
        Throws:
        IoParseException - if parsing parameter fails.
      • hasStyles

        public boolean hasStyles()
        Returns:
        in case of either style for single or styles for multiple datasets are available.
      • getFormat

        public String getFormat()
      • isSetRawFormat

        public boolean isSetRawFormat()
      • getRawFormat

        public String getRawFormat()
      • getTimeFormat

        public String getTimeFormat()
      • getNormalizedTimespan

        protected String getNormalizedTimespan​(org.joda.time.format.DateTimeFormatter dateFormat)
      • getNormalizedTimespan

        protected String getNormalizedTimespan​(org.joda.time.format.DateTimeFormatter dateFormat,
                                               String parameter)
      • createTimespan

        public static IntervalWithTimeZone createTimespan​(org.joda.time.DateTime from,
                                                          org.joda.time.DateTime to)
      • getOutputTimezone

        public String getOutputTimezone()
      • getResultTime

        public org.joda.time.Instant getResultTime()
      • shallClassifyByResultTimes

        public boolean shallClassifyByResultTimes()
      • isAllResultTimes

        public boolean isAllResultTimes()
      • getResultTimes

        public Set<String> getResultTimes()
        parses csv parameter Parameters.RESULTTIMES to a set of values. Validates each result time value after removing special value all. Use isAllResultTimes() to check if client requests all result times available.
        Returns:
        a (probably empty) set of result times.
      • getODataFilter

        public Optional<org.n52.shetland.ogc.filter.Filter<?>> getODataFilter()
      • getCategories

        public Set<String> getCategories()
      • getServices

        public Set<String> getServices()
      • getOfferings

        public Set<String> getOfferings()
      • getFeatures

        public Set<String> getFeatures()
      • getProcedures

        public Set<String> getProcedures()
      • getPhenomena

        public Set<String> getPhenomena()
      • getStations

        public Set<String> getStations()
      • getPlatforms

        public Set<String> getPlatforms()
      • getDatasets

        public Set<String> getDatasets()
      • getSamplings

        public Set<String> getSamplings()
      • getMeasuringPrograms

        public Set<String> getMeasuringPrograms()
      • getPlatformGeometryTypes

        public Set<String> getPlatformGeometryTypes()
      • getObservedGeometryTypes

        public Set<String> getObservedGeometryTypes()
      • getMobile

        public String getMobile()
      • getInsitu

        public String getInsitu()
      • getDatasetTypes

        public Set<String> getDatasetTypes()
      • getObservationTypes

        public Set<String> getObservationTypes()
      • getValueTypes

        public Set<String> getValueTypes()
      • getSearchTerms

        public Set<String> getSearchTerms()
      • getSearchTypes

        public Set<String> getSearchTypes()
      • getGeometryTypes

        public Set<String> getGeometryTypes()
      • hasSelect

        public boolean hasSelect()
      • getSelectOriginal

        public Set<String> getSelectOriginal()
      • getValuesOf

        Set<String> getValuesOf​(String parameterName,
                                boolean lowerCase)
      • getSpatialFilter

        public BoundingBox getSpatialFilter()
        Creates a BoundingBox instance from given spatial request parameters. The resulting bounding box is the merged extent of all spatial filters given. For example if "near" and "bbox" exist, the returned bounding box includes both extents.
        Returns:
        a spatial filter created from given spatial parameters.
        Throws:
        IoParseException - if parsing parameters fails, or if a requested "crs" object could not be created.
      • getCrs

        public String getCrs()
        Returns:
        the requested reference context, or the default ("CRS:84") which will be interpreted as lon/lat ordered axes).
      • isForceXY

        public boolean isForceXY()
      • isMatchDomainIds

        public boolean isMatchDomainIds()
      • isExpanded

        public boolean isExpanded()
        Returns:
        the value of "expanded" parameter.
        Throws:
        IoParseException - if parameter could not be parsed.
      • isForceLatestValueRequests

        public boolean isForceLatestValueRequests()
      • getHrefBase

        public String getHrefBase()
      • isShowTimeIntervals

        public boolean isShowTimeIntervals()
      • isShowVerticalIntervals

        public boolean isShowVerticalIntervals()
      • containsParameter

        public boolean containsParameter​(String parameter)
      • getAsString

        public String getAsString​(String parameter)
      • getAsInteger

        public int getAsInteger​(String parameter,
                                int defaultValue)
      • getAsInteger

        public int getAsInteger​(String parameter)
        Parameters:
        parameter - the parameter to parse to an int value.
        Returns:
        an integer value.
        Throws:
        IoParseException - if parsing to int fails.
      • getAsBoolean

        public boolean getAsBoolean​(String parameter,
                                    boolean defaultValue)
      • getAsBoolean

        public boolean getAsBoolean​(String parameter)
        Parameters:
        parameter - the parameter to parse to boolean.
        Returns:
        true or false as boolean.
        Throws:
        IoParseException - if parsing to boolean fails.
      • getJsonNodeFrom

        public static com.fasterxml.jackson.databind.JsonNode getJsonNodeFrom​(Object object)
      • removeAllOf

        public IoParameters removeAllOf​(String key)
        Creates a new instance based on the current one and removes given parameter with the all its values. As a new instance is created the current one stays unchanged (unmutable instance) and can be reused as is.
        Parameters:
        key - the name of the parameter to remove all its values
        Returns:
        a new instance with extended key/values
      • extendWith

        public IoParameters extendWith​(String key,
                                       String... values)
        Creates a new instance based on the current one and adds parameter with the given values. As a new instance is created the current one stays unchanged (unmutable instance) and can be reused as is.
        Parameters:
        key - the parameter name
        values - the parameter values
        Returns:
        a new instance with extended key/values
      • convertValuesToJsonNodes

        protected static Map<String,​com.fasterxml.jackson.databind.JsonNode> convertValuesToJsonNodes​(Map<String,​String> queryParameters)
      • convertToJsonNodes

        protected static org.springframework.util.MultiValueMap<String,​com.fasterxml.jackson.databind.JsonNode> convertToJsonNodes​(org.springframework.util.MultiValueMap<String,​String> queryParameters)
      • mergeToLowerCasedKeys

        protected Map<String,​com.fasterxml.jackson.databind.JsonNode> mergeToLowerCasedKeys​(Map<String,​com.fasterxml.jackson.databind.JsonNode> parameters)
      • mergeToLowerCasedKeys

        protected org.springframework.util.MultiValueMap<String,​com.fasterxml.jackson.databind.JsonNode> mergeToLowerCasedKeys​(org.springframework.util.MultiValueMap<String,​com.fasterxml.jackson.databind.JsonNode> parameters)
      • createDefaults

        public static IoParameters createDefaults()
      • createDefaults

        public static IoParameters createDefaults​(File defaultConfig)
      • createFromMultiValueMap

        public static IoParameters createFromMultiValueMap​(org.springframework.util.MultiValueMap<String,​String> query)
      • createFromSingleJsonValueMap

        static IoParameters createFromSingleJsonValueMap​(Map<String,​com.fasterxml.jackson.databind.JsonNode> query)
      • respectBackwardsCompatibility

        public IoParameters respectBackwardsCompatibility()
      • isPureStationaryInsituQuery

        public boolean isPureStationaryInsituQuery()
      • isExpandWithNextValuesBeyondInterval

        public boolean isExpandWithNextValuesBeyondInterval()
      • hasCache

        public boolean hasCache()
      • getCache

        public Optional<com.fasterxml.jackson.databind.JsonNode> getCache()
      • formatToUnixTime

        public boolean formatToUnixTime()
      • getAggregation

        public Set<String> getAggregation()
      • getLevel

        public Integer getLevel()
      • isSelected

        public boolean isSelected​(String selection)
      • withoutSelectFilter

        public IoParameters withoutSelectFilter()