deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.ogcwebservices
Class AbstractOGCWebServiceRequest

java.lang.Object
  extended by org.deegree.ogcwebservices.AbstractOGCWebServiceRequest
All Implemented Interfaces:
java.io.Serializable, OGCWebServiceRequest
Direct Known Subclasses:
AbstractCSWRequest, AbstractRequest, AbstractWFSRequest, DescribePlatformRequest, DescribeSensorRequest, DescribeUser, Get3DFeatureInfo, GetCapabilities, GetObservationRequest, Harvest, Transaction, WCSRequestBase, WCTSRequestBase, WMPSRequestBase, WMSRequestBase, WPSRequestBaseType, WPVSRequestBase

public abstract class AbstractOGCWebServiceRequest
extends java.lang.Object
implements OGCWebServiceRequest, java.io.Serializable

This is the abstract base class for all requests to OGC Web Services (OWS).

Contains utility methods to ease the extraction of values from KVP parameter maps.

Version:
$Revision: 26213 $, $Date: 2010-08-27 14:01:04 +0200 (Fr, 27 Aug 2010) $
Author:
Katharina Lupp , last edited by: $Author: apoth $
See Also:
Serialized Form

Constructor Summary
protected AbstractOGCWebServiceRequest(java.lang.String version, java.lang.String id, java.util.Map<java.lang.String,java.lang.String> vendorSpecificParameter)
          Creates a new instance of AbstractOGCWebServiceRequest.
 
Method Summary
 java.lang.String getId()
          returns the ID of a request
protected static java.lang.String getParam(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> kvp, java.lang.String defaultValue)
          Extracts a String parameter value from the given parameter map.
protected static int getParamAsInt(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> kvp, int defaultValue)
          Extracts an int parameter value from the given parameter map.
protected static java.lang.String[] getParamValues(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> kvp, java.lang.String defaultValue)
          Extracts a String list from the given parameter map.
 java.lang.String getRequestParameter()
          returns the URI of a HTTP GET request.
protected static java.lang.String getRequiredParam(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> kvp)
          Extracts a String parameter value from the given parameter map.
 java.lang.String getVendorSpecificParameter(java.lang.String name)
          Finally, the requests allow for optional vendor-specific parameters (VSPs) that will enhance the results of a request.
 java.util.Map<java.lang.String,java.lang.String> getVendorSpecificParameters()
          Finally, the requests allow for optional vendor-specific parameters (VSPs) that will enhance the results of a request.
 java.lang.String getVersion()
          returns the requested service version
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deegree.ogcwebservices.OGCWebServiceRequest
getServiceName
 

Constructor Detail

AbstractOGCWebServiceRequest

protected AbstractOGCWebServiceRequest(java.lang.String version,
                                       java.lang.String id,
                                       java.util.Map<java.lang.String,java.lang.String> vendorSpecificParameter)
Creates a new instance of AbstractOGCWebServiceRequest.

Parameters:
version -
id -
vendorSpecificParameter -
Method Detail

getId

public java.lang.String getId()
returns the ID of a request

Specified by:
getId in interface OGCWebServiceRequest
Returns:
the ID of a request

getVersion

public java.lang.String getVersion()
returns the requested service version

Specified by:
getVersion in interface OGCWebServiceRequest
Returns:
the requested service version

getVendorSpecificParameters

public java.util.Map<java.lang.String,java.lang.String> getVendorSpecificParameters()
Finally, the requests allow for optional vendor-specific parameters (VSPs) that will enhance the results of a request. Typically, these are used for private testing of non-standard functionality prior to possible standardization. A generic client is not required or expected to make use of these VSPs.

Specified by:
getVendorSpecificParameters in interface OGCWebServiceRequest
Returns:
the vendor specific parameters

getVendorSpecificParameter

public java.lang.String getVendorSpecificParameter(java.lang.String name)
Finally, the requests allow for optional vendor-specific parameters (VSPs) that will enhance the results of a request. Typically, these are used for private testing of non-standard functionality prior to possible standardization. A generic client is not required or expected to make use of these VSPs.

Specified by:
getVendorSpecificParameter in interface OGCWebServiceRequest
Parameters:
name - the "key" of a vsp
Returns:
the value requested by the key

getRequestParameter

public java.lang.String getRequestParameter()
                                     throws OGCWebServiceException
returns the URI of a HTTP GET request. If the request doesn't support HTTP GET a WebServiceException will be thrown

Specified by:
getRequestParameter in interface OGCWebServiceRequest
Returns:
the URI of a HTTP GET request. If the request doesn't support HTTP GET a WebServiceException will be thrown
Throws:
OGCWebServiceException

getParam

protected static java.lang.String getParam(java.lang.String name,
                                           java.util.Map<java.lang.String,java.lang.String> kvp,
                                           java.lang.String defaultValue)
Extracts a String parameter value from the given parameter map. If the given parameter does not exist, the also submitted default value is returned.

Parameters:
name - name of the parameter to be looked up
kvp - must contain Strings as keys and Strings as values
defaultValue - default value to be used if parameter is missing
Returns:
parameter value

getParamValues

protected static java.lang.String[] getParamValues(java.lang.String name,
                                                   java.util.Map<java.lang.String,java.lang.String> kvp,
                                                   java.lang.String defaultValue)
Extracts a String list from the given parameter map. The single values are separated by commas. If the given parameter does not exist, the also submitted default value is returned.

Parameters:
name - name of the parameter to be looked up
kvp - must contain Strings as keys and Strings as values
defaultValue - default value to be used if parameter is missing
Returns:
parameter value

getRequiredParam

protected static java.lang.String getRequiredParam(java.lang.String name,
                                                   java.util.Map<java.lang.String,java.lang.String> kvp)
                                            throws MissingParameterValueException
Extracts a String parameter value from the given parameter map. Generates exceptions with descriptive messages, if the parameter does not exist in the Map.

Parameters:
name - name of the parameter to be looked up
kvp - must contain Strings as keys and Strings as values
Returns:
parameter value
Throws:
MissingParameterValueException

getParamAsInt

protected static int getParamAsInt(java.lang.String name,
                                   java.util.Map<java.lang.String,java.lang.String> kvp,
                                   int defaultValue)
                            throws InvalidParameterValueException
Extracts an int parameter value from the given parameter map. If the given parameter does not exist, the also submitted default value is returned.

Parameters:
name - name of the parameter to be looked up
kvp - must contain Strings as keys and Strings as values
defaultValue - default value to be used if parameter is missing
Returns:
parameter value
Throws:
InvalidParameterValueException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

deegree 2.5 (2011/06/29 09:44 build-8-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org