public abstract class Request extends Object implements Callable<Response>
UID| Modifier and Type | Field and Description |
|---|---|
protected Document |
doc |
protected UUID |
id |
protected static org.slf4j.Logger |
LOGGER |
protected org.apache.commons.collections.map.CaseInsensitiveMap |
map |
static String[] |
SUPPORTED_LANGUAGES |
static String |
SUPPORTED_VERSION |
| Constructor and Description |
|---|
Request(org.apache.commons.collections.map.CaseInsensitiveMap map)
Create a Request based on a CaseInsensitiveMap as input (HTTP GET)
|
Request(Document doc)
Create a Request based on a Document as input (HTTP POST)
|
| Modifier and Type | Method and Description |
|---|---|
static String |
accumulateString(String[] strings)
Accumulates the Strings in an array, separated by ", " (without quotes).
|
abstract Response |
call()
After creation a Request is handled.
|
static void |
checkLanguageSupported(String language)
Checks, if the language is supported by the WPS.
|
abstract Object |
getAttachedResult() |
Document |
getDocument()
Returns the user input in Document form
|
org.apache.commons.collections.map.CaseInsensitiveMap |
getMap()
Returns the user input in Map form
|
protected String[] |
getMapArray(String key,
boolean required)
Retrieve an array of values from the client-input-map with a lookup-key
|
static String[] |
getMapArray(String key,
org.apache.commons.collections.map.CaseInsensitiveMap map,
boolean required)
Retrieve an array of values from an input-map with a lookup-key
|
protected String |
getMapValue(String key,
boolean required)
Retrieve a value from the client-input-map with a lookup-key
|
protected String |
getMapValue(String key,
boolean required,
String[] supportedValues)
Retrieve a value from the client-input-map with a lookup-key
|
static String |
getMapValue(String key,
org.apache.commons.collections.map.CaseInsensitiveMap map,
boolean required)
Retrieve a value from an input-map with a lookup-key
|
static String |
getMapValue(String key,
org.apache.commons.collections.map.CaseInsensitiveMap map,
boolean required,
String[] supportedValues)
Retrieve a value from an input-map with a lookup-key
|
protected String[] |
getRequestedVersions(boolean mandatory)
Returns the version that the client requested.
|
UUID |
getUniqueId() |
boolean |
requireVersion(String version,
boolean mandatory)
The process (request) on the server could require a specific version on the client
|
abstract boolean |
validate()
There should be some validation required on the (input of the) clients Request.
|
protected org.apache.commons.collections.map.CaseInsensitiveMap map
protected Document doc
protected static org.slf4j.Logger LOGGER
protected UUID id
public static final String SUPPORTED_VERSION
public static final String[] SUPPORTED_LANGUAGES
public Request(org.apache.commons.collections.map.CaseInsensitiveMap map)
throws org.n52.wps.server.ExceptionReport
map - The Map which holds the client input.org.n52.wps.server.ExceptionReportpublic Request(Document doc) throws org.n52.wps.server.ExceptionReport
doc - The Document which holds the client input.org.n52.wps.server.ExceptionReportpublic Document getDocument()
public org.apache.commons.collections.map.CaseInsensitiveMap getMap()
public static String getMapValue(String key, org.apache.commons.collections.map.CaseInsensitiveMap map, boolean required) throws org.n52.wps.server.ExceptionReport
key - The lookup-keymap - The input-map to look inrequired - If the key-value pair must be in the map.org.n52.wps.server.ExceptionReportpublic static String getMapValue(String key, org.apache.commons.collections.map.CaseInsensitiveMap map, boolean required, String[] supportedValues) throws org.n52.wps.server.ExceptionReport
key - The lookup-keymap - The input-map to look inrequired - If the key-value pair must be in the map.org.n52.wps.server.ExceptionReportpublic static String[] getMapArray(String key, org.apache.commons.collections.map.CaseInsensitiveMap map, boolean required) throws org.n52.wps.server.ExceptionReport
key - The lookup-keymap - The input-map to look inrequired - If the key-value pair must be in the map.org.n52.wps.server.ExceptionReportprotected String getMapValue(String key, boolean required) throws org.n52.wps.server.ExceptionReport
The - lookup-keyorg.n52.wps.server.ExceptionReportprotected String getMapValue(String key, boolean required, String[] supportedValues) throws org.n52.wps.server.ExceptionReport
The - lookup-keyorg.n52.wps.server.ExceptionReportprotected String[] getMapArray(String key, boolean required) throws org.n52.wps.server.ExceptionReport
The - lookup-keyorg.n52.wps.server.ExceptionReportprotected String[] getRequestedVersions(boolean mandatory) throws org.n52.wps.server.ExceptionReport
org.n52.wps.server.ExceptionReportpublic boolean requireVersion(String version, boolean mandatory) throws org.n52.wps.server.ExceptionReport
version - The version that is required on the clientorg.n52.wps.server.ExceptionReportpublic static String accumulateString(String[] strings)
strings - The array to accumulatepublic UUID getUniqueId()
public static void checkLanguageSupported(String language) throws org.n52.wps.server.ExceptionReport
language - The language to be checked.org.n52.wps.server.ExceptionReport - If a wrong language is requested, this ExceptionReport will be returned to the client.public abstract Object getAttachedResult()
public abstract Response call() throws org.n52.wps.server.ExceptionReport
call in interface Callable<Response>org.n52.wps.server.ExceptionReportCallable.call()public abstract boolean validate()
throws org.n52.wps.server.ExceptionReport
org.n52.wps.server.ExceptionReportCopyright © 2019. All Rights Reserved.