org.geotools.data.wms.request
Class AbstractRequest

java.lang.Object
  extended byorg.geotools.data.wms.request.AbstractRequest
All Implemented Interfaces:
Request
Direct Known Subclasses:
AbstractDescribeLayerRequest, AbstractGetCapabilitiesRequest, AbstractGetFeatureInfoRequest, AbstractGetLegendGraphicRequest, AbstractGetMapRequest, AbstractGetStylesRequest, AbstractPutStylesRequest

public abstract class AbstractRequest
extends java.lang.Object
implements Request

A class that provides functionality for performing basic requests

Author:
Richard Gould

Field Summary
static java.lang.String EXCEPTION_XML
          Represents OGC Exception MIME types
protected  java.net.URL onlineResource
           
protected  java.util.Properties properties
           
 
Fields inherited from interface org.geotools.data.wms.request.Request
REQUEST, SERVICE, VERSION, WMTVER
 
Constructor Summary
AbstractRequest(java.net.URL onlineResource, java.util.Properties properties)
          Creates an AbstractRequest.
 
Method Summary
 java.net.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.
 java.util.Properties getProperties()
           
protected  java.lang.String processKey(java.lang.String key)
          Some WebMapServers do not abide by the fact that parameter keys should be case insensitive.
 void setProperty(java.lang.String name, java.lang.String value)
          Sets the name/value property for this request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXCEPTION_XML

public static final java.lang.String EXCEPTION_XML
Represents OGC Exception MIME types

See Also:
Constant Field Values

onlineResource

protected java.net.URL onlineResource

properties

protected java.util.Properties properties
Constructor Detail

AbstractRequest

public AbstractRequest(java.net.URL onlineResource,
                       java.util.Properties properties)
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 WMS specific ones. However, certain parameters will be over-written by individual requests themselves. Examples of such parameters include, but are not limited to:

Parameters:
onlineResource - the URL to construct the Request for
properties - a map of pre-set parameters to be used. Can be null.
Method Detail

getFinalURL

public java.net.URL 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 interface Request
Returns:
a URL that can be used to issue the request
See Also:
Request.getFinalURL()

processKey

protected java.lang.String processKey(java.lang.String key)
Some WebMapServers 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

public void setProperty(java.lang.String name,
                        java.lang.String value)
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 WMS specifications! The code will not do this for you. Please ensure that you are familiar with this. See section 6.2.1 of the WMS 1.1.1 spec and 6.3.2 of the WMS 1.3.0 spec. If value is null, "name" is removed from the properties table.

Specified by:
setProperty in interface Request
Parameters:
name - the name of the property
value - the value of the property
See Also:
Request.setProperty(java.lang.String, java.lang.String)

getProperties

public java.util.Properties getProperties()
Specified by:
getProperties in interface Request
Returns:
the request's current property map
See Also:
Request.getProperties()


Copyright © GeoTools. All Rights Reserved.