public abstract class AbstractRequest extends Object implements Request
Modifier and Type | Field and Description |
---|---|
static String |
EXCEPTION_XML
Represents OGC Exception MIME types
|
protected Map<String,Object> |
hints |
protected URL |
onlineResource |
protected Properties |
properties |
Constructor and Description |
---|
AbstractRequest(URL onlineResource,
Properties properties)
Creates an AbstractRequest.
|
Modifier and Type | Method and Description |
---|---|
URL |
getFinalURL()
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.
|
String |
getPostContentType()
Default POST content type is xml
|
Properties |
getProperties() |
Map<String,Object> |
getRequestHints()
Returns the request hints
|
protected abstract void |
initRequest() |
protected abstract void |
initService()
Implementing subclass requests must specify their own "SERVICE" value.
|
protected abstract void |
initVersion()
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 |
requiresPost()
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 performed
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createResponse
public static final String EXCEPTION_XML
protected URL onlineResource
protected Properties properties
public AbstractRequest(URL onlineResource, Properties properties)
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:
onlineResource
- the URL to construct the Request forproperties
- a map of pre-set parameters to be used. Can be null.public URL getFinalURL()
Request
getFinalURL
in interface Request
org.geotools.data.wms.request.Request#getFinalURL()
protected String processKey(String key)
This method will allow a specification to determine the way that the parameter keys should be encoded in requests made by the server.
key
- the key to be processedpublic void setProperty(String name, String value)
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.
setProperty
in interface Request
name
- the name of the propertyvalue
- the value of the propertypublic Properties getProperties()
getProperties
in interface Request
protected abstract void initRequest()
protected abstract void initService()
protected abstract void initVersion()
public String getPostContentType()
getPostContentType
in interface Request
public void performPostOutput(OutputStream outputStream) throws IOException
performPostOutput
in interface Request
IOException
public boolean requiresPost()
requiresPost
in interface Request
public Map<String,Object> getRequestHints()
Request
getRequestHints
in interface Request
Copyright © 1996–2019 Geotools. All rights reserved.