Package org.n52.io.request
Class IoParameters
java.lang.Object
org.n52.io.request.IoParameters
- All Implemented Interfaces:
Parameters
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.n52.io.request.Parameters
Parameters.HttpHeader -
Field Summary
Fields inherited from interface org.n52.io.request.Parameters
AGGREGATION, BASE_64, BBOX, BOM, CACHE, CATEGORIES, COMPLEX_PARENT, CRS, DATASETS, DEFAULT_BASE_64, DEFAULT_EXPANDED, DEFAULT_FORCE_LATEST_VALUE, DEFAULT_FORCE_XY, DEFAULT_FORMAT, DEFAULT_GENERALIZE, DEFAULT_GRID, DEFAULT_HEIGHT, DEFAULT_LEGEND, DEFAULT_LIMIT, DEFAULT_MATCH_DOMAIN_IDS, DEFAULT_OFFSET, DEFAULT_OUTPUT_TIMEZONE, DEFAULT_RENDERING_TRIGGER, DEFAULT_SHOW_TIME_INTERVALS, DEFAULT_SHOW_VERTICAL_INTERVALS, DEFAULT_TIME_FORMAT, DEFAULT_WIDTH, EXPAND_WITH_NEXT_VALUES_BEYOND_INTERVAL, EXPANDED, FEATURES, FILTER_DATASET_TYPES, FILTER_FIELDS, FILTER_INSITU, FILTER_MOBILE, FILTER_OBSERVATION_TYPES, FILTER_OBSERVED_GEOMETRIES, FILTER_PLATFORM_GEOMETRIES, FILTER_VALUE_TYPES, FORCE_LATEST_VALUE, FORCE_XY, FORMAT, GENERALIZE, GEOMETRY_TYPES, GRID, HANDLE_AS_VALUE_TYPE, HEIGHT, HREF_BASE, LAST_VALUE_MATCHES, LEGEND, LEVEL, LIMIT, LOCALE, MATCH_DOMAIN_IDS, MEASURING_PROGRAMS, NEAR, ODATA_FILTER, OFFERINGS, OFFSET, OUTPUT_TIMEZONE, PHENOMENA, PLATFORMS, PROCEDURES, RAW_FORMAT, RENDERING_TRIGGER, RESULT_TIMES_VALUE_ALL, RESULTTIMES, SAMPLINGS, SEARCH_TERM, SEARCH_TYPES, SELECT, SERVICES, SHOW_TIME_INTERVALS, SHOW_VERTICAL_INTERVALS, STATIONS, STYLE, STYLES, TAGS, TIME_FORMAT, TIMESERIES, TIMESPAN, TOKEN_SEPARATOR, UNIX_TIME, WIDTH, ZIP -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedIoParameters(Map<String, com.fasterxml.jackson.databind.JsonNode> queryParameters) protectedIoParameters(Map<String, com.fasterxml.jackson.databind.JsonNode> queryParameters, File defaults) protectedIoParameters(IoParameters other) protectedIoParameters(org.springframework.util.MultiValueMap<String, com.fasterxml.jackson.databind.JsonNode> queryParameters) protectedIoParameters(org.springframework.util.MultiValueMap<String, com.fasterxml.jackson.databind.JsonNode> queryParameters, File defaults) -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsParameter(String parameter) protected static org.springframework.util.MultiValueMap<String,com.fasterxml.jackson.databind.JsonNode> convertToJsonNodes(org.springframework.util.MultiValueMap<String, String> queryParameters) convertValuesToJsonNodes(Map<String, String> queryParameters) static IoParametersstatic IoParameterscreateDefaults(File defaultConfig) static IntervalWithTimeZonestatic IoParameterscreateFromMultiValueMap(org.springframework.util.MultiValueMap<String, String> query) (package private) static IoParameterscreateFromSingleJsonValueMap(Map<String, com.fasterxml.jackson.databind.JsonNode> query) static IoParameterscreateFromSingleValueMap(Map<String, String> query) static IntervalWithTimeZonecreateTimespan(org.joda.time.DateTime from, org.joda.time.DateTime to) extendWith(String key, String... values) Creates a new instance based on the current one and adds parameter with the given values.extendWith(String key, Collection<String> values) booleanbooleangetAsBoolean(String parameter) booleangetAsBoolean(String parameter, boolean defaultValue) intgetAsInteger(String parameter) intgetAsInteger(String parameter, int defaultValue) getAsString(String parameter) getAsString(String parameter, String defaultValue) Optional<com.fasterxml.jackson.databind.JsonNode>getCache()getCrs()intReturns the requested chart height in pixels.static com.fasterxml.jackson.databind.JsonNodegetJsonNodeFrom(Object object) getLevel()intgetLimit()protected StringgetNormalizedTimespan(org.joda.time.format.DateTimeFormatter dateFormat) protected StringgetNormalizedTimespan(org.joda.time.format.DateTimeFormatter dateFormat, String parameter) Optional<org.n52.shetland.ogc.filter.Filter<?>>intorg.joda.time.Instantparses csv parameterParameters.RESULTTIMESto a set of values.Creates aBoundingBoxinstance from given spatial request parameters.getTags()getValuesOf(String parameterName) getValuesOf(String parameterName, boolean lowerCase) intgetWidth()booleanhasCache()booleanbooleanbooleanbooleanisBase64()Indicates if rendered chart shall be returned as Base64 encoded string.booleanbooleanbooleanbooleanbooleanbooleanbooleanisGrid()booleanisLegend()booleanbooleanbooleanisSelected(String selection) booleanbooleanbooleanmergeToLowerCasedKeys(Map<String, com.fasterxml.jackson.databind.JsonNode> parameters) protected org.springframework.util.MultiValueMap<String,com.fasterxml.jackson.databind.JsonNode> mergeToLowerCasedKeys(org.springframework.util.MultiValueMap<String, com.fasterxml.jackson.databind.JsonNode> parameters) removeAllOf(String key) Creates a new instance based on the current one and removes given parameter with the all its values.replaceWith(String key, String... values) replaceWith(String key, Collection<String> values) setDefaultLocale(String defaultLocale) booleanbooleantoString()withSubSelectFilter(String selection)
-
Constructor Details
-
IoParameters
protected IoParameters() -
IoParameters
-
IoParameters
-
IoParameters
-
IoParameters
protected IoParameters(org.springframework.util.MultiValueMap<String, com.fasterxml.jackson.databind.JsonNode> queryParameters) -
IoParameters
-
-
Method Details
-
shallBehaveBackwardsCompatible
public boolean shallBehaveBackwardsCompatible() -
setParseExceptionHandle
-
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:
trueif timeseries chart shall include a background grid.- Throws:
IoParseException- if parsing parameter fails.
-
isGeneralize
public boolean isGeneralize()- Returns:
trueif timeseries data shall be generalized.- Throws:
IoParseException- if parsing parameter fails.
-
isLegend
public boolean isLegend()- Returns:
trueif a legend shall be included when rendering a chart,falseotherwise.- Throws:
IoParseException- if parsing parameter fails.
-
getLocale
- Returns:
- the value of "locale" parameter.
- Throws:
IoParseException- if parsing parameter fails.
-
isDefaultLocal
public boolean isDefaultLocal() -
getDefaultLocale
-
setDefaultLocale
-
getSingleStyle
- Returns:
- the value of "style" parameter. If not present, the default styles are returned.
- Throws:
IoParseException- if parsing parameter fails.
-
getReferencedStyles
- Returns:
- the value of "styles" parameter.
- Throws:
IoParseException- if parsing parameter fails.
-
hasStyles
public boolean hasStyles()- Returns:
- in case of either
stylefor single orstylesfor multiple datasets are available.
-
getFormat
-
isSetRawFormat
public boolean isSetRawFormat() -
getRawFormat
-
getTimeFormat
-
getTimespan
- Returns:
- the value of "timespan" parameter. If not present, the default timespan is returned.
- Throws:
IoParseException- if timespan could not be parsed.
-
getNormalizedTimespan
-
getNormalizedTimespan
-
createDefaultTimespan
-
createTimespan
public static IntervalWithTimeZone createTimespan(org.joda.time.DateTime from, org.joda.time.DateTime to) -
getOutputTimezone
-
getLastValueMatches
-
getResultTime
public org.joda.time.Instant getResultTime() -
shallClassifyByResultTimes
public boolean shallClassifyByResultTimes() -
isAllResultTimes
public boolean isAllResultTimes() -
getResultTimes
parses csv parameterParameters.RESULTTIMESto a set of values. Validates each result time value after removing special valueall. UseisAllResultTimes()to check if client requests all result times available.- Returns:
- a (probably empty) set of result times.
-
getODataFilter
-
getCategories
-
getServices
-
getOfferings
-
getFeatures
-
getProcedures
-
getPhenomena
-
getStations
-
getPlatforms
-
getDatasets
-
getSamplings
-
getMeasuringPrograms
-
getTags
-
getFields
-
getPlatformGeometryTypes
-
getObservedGeometryTypes
-
getMobile
-
getInsitu
-
getDatasetTypes
-
getObservationTypes
-
getValueTypes
-
getSearchTerms
-
getSearchTypes
-
getGeometryTypes
-
hasSelect
public boolean hasSelect() -
getSelect
-
getSelectOriginal
-
getValuesOf
-
getValuesOf
-
getFilterResolver
-
getSpatialFilter
Creates aBoundingBoxinstance 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
- 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
-
isShowTimeIntervals
public boolean isShowTimeIntervals() -
isShowVerticalIntervals
public boolean isShowVerticalIntervals() -
containsParameter
-
getOther
-
getAsString
-
getAsString
-
getAsInteger
-
getAsInteger
- Parameters:
parameter- the parameter to parse to anintvalue.- Returns:
- an integer value.
- Throws:
IoParseException- if parsing tointfails.
-
getAsBoolean
-
getAsBoolean
- Parameters:
parameter- the parameter to parse toboolean.- Returns:
trueorfalseasboolean.- Throws:
IoParseException- if parsing tobooleanfails.
-
getJsonNodeFrom
-
removeAllOf
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
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 namevalues- the parameter values- Returns:
- a new instance with extended key/values
-
extendWith
-
replaceWith
-
replaceWith
-
convertValuesToJsonNodes
-
convertToJsonNodes
-
toString
-
mergeToLowerCasedKeys
-
mergeToLowerCasedKeys
-
createDefaults
-
createDefaults
-
createFromMultiValueMap
public static IoParameters createFromMultiValueMap(org.springframework.util.MultiValueMap<String, String> query) -
createFromSingleValueMap
-
createFromSingleJsonValueMap
static IoParameters createFromSingleJsonValueMap(Map<String, com.fasterxml.jackson.databind.JsonNode> query) -
respectBackwardsCompatibility
-
isPureStationaryInsituQuery
public boolean isPureStationaryInsituQuery() -
isExpandWithNextValuesBeyondInterval
public boolean isExpandWithNextValuesBeyondInterval() -
hasCache
public boolean hasCache() -
getCache
-
formatToUnixTime
public boolean formatToUnixTime() -
getAggregation
-
getLevel
-
isSelected
-
withoutSelectFilter
-
withSubSelectFilter
-