Class AbstractRequest
- All Implemented Interfaces:
Request
- Direct Known Subclasses:
AbstractGetCapabilitiesRequest
,AbstractWMSRequest
,AbstractWMTSRequest
,WFSRequest
- Author:
- Richard Gould
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Represents OGC Exception MIME typesprotected URL
protected Properties
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractRequest
(URL onlineResource, Properties properties) Creates an AbstractRequest. -
Method Summary
Modifier and TypeMethodDescriptionOnce the properties of the request are configured, this will return the URL that points to the server and contains all of the appropriate name/value parameters.Default POST content type is xmlReturns the request hintsprotected abstract void
protected abstract void
Implementing subclass requests must specify their own "SERVICE" value.protected abstract void
Sets up the version number for this request.void
performPostOutput
(OutputStream outputStream) Default to not requiring POST.protected String
processKey
(String key) Some Open Web Servers do not abide by the fact that parameter keys should be case insensitive.boolean
Default to not requiring POST.void
setProperty
(String name, String value) Sets the name/value property for this request.void
setRequestHints
(Map<String, Object> hints) Sets hints that might be driving how the request is performedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface Request
createResponse
-
Field Details
-
EXCEPTION_XML
Represents OGC Exception MIME types- See Also:
-
onlineResource
-
properties
-
hints
-
-
Constructor Details
-
AbstractRequest
Creates an AbstractRequest.If properties isn't
null
, it will use them instead of creating a new Properties object.This constructor will strip all the query parameters off of onlineResource and put them in the properties map. This allows clients to provide their own parameters and have them saved and used along with the OWS specific ones.
However, certain parameters will be over-written by individual requests themselves. Examples of such parameters include, but are not limited to:
- WMTVER
- REQUEST
- VERSION
- SERVICE
- Parameters:
onlineResource
- the URL to construct the Request forproperties
- a map of pre-set parameters to be used. Can be null.
-
-
Method Details
-
getFinalURL
Description copied from interface:Request
Once the properties of the request are configured, this will return the URL that points to the server and contains all of the appropriate name/value parameters.- Specified by:
getFinalURL
in interfaceRequest
- Returns:
- a URL that can be used to issue the request
- See Also:
-
org.geotools.data.wms.request.Request#getFinalURL()
-
processKey
Some Open Web Servers do not abide by the fact that parameter keys should be case insensitive.This method will allow a specification to determine the way that the parameter keys should be encoded in requests made by the server.
- Parameters:
key
- the key to be processed- Returns:
- the key, after being processed. (made upper case, for example)
-
setProperty
Description copied from interface:Request
Sets the name/value property for this request.Note that when using this method, it is up to the programmer to provide their own encoding of
value
according to the OWS specifications! The code will not do this for you.Different OWS specifications define different ways to do this. There are notorious differences between WMS 1.1.1 (section 6.2.1) and WMS 1.3.0 (section 6.3.2) for example.
If value is null, "name" is removed from the properties table.
- Specified by:
setProperty
in interfaceRequest
- Parameters:
name
- the name of the propertyvalue
- the value of the property
-
getProperties
- Specified by:
getProperties
in interfaceRequest
- Returns:
- a copy of this request's properties
-
initRequest
protected abstract void initRequest() -
initService
protected abstract void initService()Implementing subclass requests must specify their own "SERVICE" value. Example: setProperty("SERVICE", "WFS"); -
initVersion
protected abstract void initVersion()Sets up the version number for this request. Typically something like setProperty("VERSION", "1.1.1"); -
getPostContentType
Default POST content type is xml- Specified by:
getPostContentType
in interfaceRequest
- Returns:
- the MIME type of the data to be sent during the request
-
performPostOutput
Default to not requiring POST. Implementors can override if they need to.- Specified by:
performPostOutput
in interfaceRequest
- Throws:
IOException
-
requiresPost
public boolean requiresPost()Default to not requiring POST. Implementors can override if they need to.- Specified by:
requiresPost
in interfaceRequest
- Returns:
- true if this request needs POST support, false otherwise.
-
getRequestHints
Description copied from interface:Request
Returns the request hints- Specified by:
getRequestHints
in interfaceRequest
-
setRequestHints
Description copied from interface:Request
Sets hints that might be driving how the request is performed- Specified by:
setRequestHints
in interfaceRequest
-