Class AbstractRequest
- All Implemented Interfaces:
Request
- Direct Known Subclasses:
AbstractGetCapabilitiesRequest,AbstractWMSRequest,AbstractWMTSRequest,WFSRequest
- Author:
- Richard Gould
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringRepresents OGC Exception MIME typesprotected URLprotected 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 voidprotected abstract voidImplementing subclass requests must specify their own "SERVICE" value.protected abstract voidSets up the version number for this request.voidperformPostOutput(OutputStream outputStream) Default to not requiring POST.protected StringprocessKey(String key) Some Open Web Servers do not abide by the fact that parameter keys should be case insensitive.booleanDefault to not requiring POST.voidsetProperty(String name, String value) Sets the name/value property for this request.voidsetRequestHints(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, waitMethods 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:RequestOnce 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:
getFinalURLin 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:RequestSets 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
valueaccording 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:
setPropertyin interfaceRequest- Parameters:
name- the name of the propertyvalue- the value of the property
-
getProperties
- Specified by:
getPropertiesin 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:
getPostContentTypein 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:
performPostOutputin interfaceRequest- Throws:
IOException
-
requiresPost
public boolean requiresPost()Default to not requiring POST. Implementors can override if they need to.- Specified by:
requiresPostin interfaceRequest- Returns:
- true if this request needs POST support, false otherwise.
-
getRequestHints
Description copied from interface:RequestReturns the request hints- Specified by:
getRequestHintsin interfaceRequest
-
setRequestHints
Description copied from interface:RequestSets hints that might be driving how the request is performed- Specified by:
setRequestHintsin interfaceRequest
-