org.deegree_impl.services.wfs.protocol
Class WFSProtocolFactory

java.lang.Object
  extended byorg.deegree_impl.services.wfs.protocol.WFSProtocolFactory

public class WFSProtocolFactory
extends java.lang.Object

Factory class for all mapped WFS-XML-Requests.

Version:
$Revision: 1.28 $ $Date: 2004/04/27 15:40:38 $
Author:
Andreas Poth, Markus Schneider

Field Summary
private static java.lang.String ogcNS
           
private static java.lang.String wfsNS
           
 
Constructor Summary
WFSProtocolFactory()
           
 
Method Summary
private static WFSDelete createDelete(org.w3c.dom.Element element)
          Creates a WFSDelete object from a wfs:Delete-element as defined in the OGC-WFS specification.
static WFSDelete createDelete(Filter filter, java.lang.String typeName)
          creates a WFSDelete object from a Filter and a typeName specifying the feature type to perform the deletion on.
private static WFSInsert createInsert(org.w3c.dom.Element element)
          Creates a WFSInsert object from a wfs:Update-element as defined in the OGC-WFS specification.
static WFSInsert createInsert(GMLFeature[] feat, java.lang.String handle)
          creates a WFSInsert object from an array of GMLFeature and a handle.
private static WFSNative createNative(org.w3c.dom.Element element)
          creates nativ operations object from a XML-element defined by the OGC WFS specifications
static WFSQuery createQuery(org.w3c.dom.Element element)
          creates a WFS Query object from a dom element.
static WFSQuery createQuery(java.lang.String[] propertyNames, java.lang.String handle, java.lang.String version, java.lang.String typeName, Filter filter)
          creates a WFSQuery object from its property names, a handle the used version, the feature type (typeName) targeted by the query and a filter.
static OGCWebServiceRequest createRequest(java.lang.String id, java.io.Reader reader)
          creates a WFS request from a reader that contains an XML encoded form of the request
private static WFSUpdate createUpdate(org.w3c.dom.Element element)
          Creates a WFSUpdate object from a wfs:Update-element as defined in the OGC-WFS specification.
static WFSDescribeFeatureTypeRequest createWFSDescribeFeatureTypeRequest(java.lang.String id, org.w3c.dom.Document doc)
          creates a DescribeFeatureType request from a reader object that offers access to a string resource that contains XML document that encodes the request.
static WFSDescribeFeatureTypeRequest createWFSDescribeFeatureTypeRequest(java.lang.String version, java.lang.String id, java.util.HashMap vendorSpecificParameter, WFSNative native_, java.lang.String outputFormat, java.lang.String[] typeNames)
          creates a WFSDescribeFeatureTypeRequest object.
static WFSDescribeFeatureTypeResponse createWFSDescribeFeatureTypeResponse(OGCWebServiceRequest request, java.lang.String[] affectedFeatureTypes, OGCWebServiceException exception, org.w3c.dom.Document featureTypeSchema)
          creates a WFSDescribeFeatureTypeResponse object
static WFSGetCapabilitiesRequest createWFSGetCapabilitiesRequest(java.lang.String id, java.util.HashMap vendorSpecificParameter, WFSNative native_)
          creates a WFSGetCapabilitiesRequest object.
static WFSGetCapabilitiesResponse createWFSGetCapabilitiesResponse(OGCWebServiceRequest request, OGCWebServiceException exception, WFSCapabilities response)
          creates a WFSGetCapabilitiesResponse object
static WFSGetFeatureRequest createWFSGetFeatureRequest(java.lang.String id, org.w3c.dom.Document doc)
          creates a instance of a WFSGetFeatureRequest object from a reader that contains the request-xml.
static WFSGetFeatureRequest createWFSGetFeatureRequest(java.lang.String id, java.lang.String request)
          creates a GetFeature request from a key-value-pair encoding of the parameters contained in the passed varialble 'request'
static WFSGetFeatureRequest createWFSGetFeatureRequest(java.lang.String version, java.lang.String id, java.util.HashMap vendorSpecificParameter, WFSNative native_, java.lang.String outputFormat, java.lang.String handle, Filter filter, int maxFeatures, int startPosition, WFSQuery[] query)
          creates a WFSGetFeatureRequest object.
static WFSGetFeatureResponse createWFSGetFeatureResponse(OGCWebServiceRequest request, java.lang.String[] affectedFeatureTypes, OGCWebServiceException exception, java.lang.Object response)
          creates a WFSGetFeatureResponse object
static WFSInsertResult createWFSInsertResult(java.lang.String handle, java.lang.String[] featureIds)
          creates a WFSInsertResult
static WFSTransactionRequest createWFSTransactionRequest(java.lang.String id, org.w3c.dom.Document doc)
          creates a WFSTransactionRequest object.
static WFSTransactionRequest createWFSTransactionRequest(java.lang.String version, java.lang.String id, java.lang.String lockId, WFSOperation[] operations, java.lang.String handle, java.lang.String releaseAction)
          creates a WFSTransactionRequest object.
static WFSTransactionResponse createWFSTransactionResponse(OGCWebServiceRequest request, java.lang.String[] affectedFeatureTypes, OGCWebServiceException exception, WFSInsertResult[] insertResults, java.lang.String status, java.lang.String handle)
          creates a WFSTransactionRequest object.
static Filter getFilter(org.w3c.dom.Element element)
          returns the filter that limits the query
static WFSNative getNative(org.w3c.dom.Element element)
          The element is intended to allow access to vendor specific capabilities of any particular web feature server or datastore.
private static java.lang.String[] getPropertyNames(org.w3c.dom.Element element)
          The property names is used to enumerate the feature properties or attributes that should be selected.
private static WFSQuery[] getQuery(org.w3c.dom.Element element)
          The query defines which feature type to query, what properties to retrieve and what constraints (spatial and non-spatial) to apply to those properties.
private static java.util.Map toMap(java.lang.String request)
          puts a http-GET request to a HashMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wfsNS

private static java.lang.String wfsNS

ogcNS

private static java.lang.String ogcNS
Constructor Detail

WFSProtocolFactory

public WFSProtocolFactory()
Method Detail

createRequest

public static OGCWebServiceRequest createRequest(java.lang.String id,
                                                 java.io.Reader reader)
                                          throws java.lang.Exception
creates a WFS request from a reader that contains an XML encoded form of the request

Throws:
java.lang.Exception

createWFSDescribeFeatureTypeRequest

public static WFSDescribeFeatureTypeRequest createWFSDescribeFeatureTypeRequest(java.lang.String id,
                                                                                org.w3c.dom.Document doc)
                                                                         throws java.io.IOException
creates a DescribeFeatureType request from a reader object that offers access to a string resource that contains XML document that encodes the request.

Throws:
java.io.IOException

createWFSDescribeFeatureTypeRequest

public static WFSDescribeFeatureTypeRequest createWFSDescribeFeatureTypeRequest(java.lang.String version,
                                                                                java.lang.String id,
                                                                                java.util.HashMap vendorSpecificParameter,
                                                                                WFSNative native_,
                                                                                java.lang.String outputFormat,
                                                                                java.lang.String[] typeNames)
creates a WFSDescribeFeatureTypeRequest object.

Parameters:
id - id of the request
vendorSpecificParameter - none standadized parameters as name-value pairs
native_ - is intended to allow access to vendor specific capabilities
outputFormat - indicates the format the result shall be formated
typeNames - names of the feature types that shalle be described

createWFSDescribeFeatureTypeResponse

public static WFSDescribeFeatureTypeResponse createWFSDescribeFeatureTypeResponse(OGCWebServiceRequest request,
                                                                                  java.lang.String[] affectedFeatureTypes,
                                                                                  OGCWebServiceException exception,
                                                                                  org.w3c.dom.Document featureTypeSchema)
creates a WFSDescribeFeatureTypeResponse object

Parameters:
request - a copy of the request that leads to this response
exception - a describtion of an excetion (only if raised)
affectedFeatureTypes - names of the feature types affected by the response

createWFSGetFeatureRequest

public static WFSGetFeatureRequest createWFSGetFeatureRequest(java.lang.String id,
                                                              java.lang.String request)
                                                       throws InconsistentRequestException
creates a GetFeature request from a key-value-pair encoding of the parameters contained in the passed varialble 'request'

Parameters:
id - id of the request
request - key-value-pair encoded GetFeature request
Throws:
InconsistentRequestException

createWFSGetFeatureRequest

public static WFSGetFeatureRequest createWFSGetFeatureRequest(java.lang.String version,
                                                              java.lang.String id,
                                                              java.util.HashMap vendorSpecificParameter,
                                                              WFSNative native_,
                                                              java.lang.String outputFormat,
                                                              java.lang.String handle,
                                                              Filter filter,
                                                              int maxFeatures,
                                                              int startPosition,
                                                              WFSQuery[] query)
creates a WFSGetFeatureRequest object.

Parameters:
id - id of the request
vendorSpecificParameter - none standadized parameters as name-value pairs
native_ - is intended to allow access to vendor specific capabilities
outputFormat - indicates the format the result shall be formated
filter - filter expression that describes the 'global' limitations of the query.
maxFeatures - maximal amout of featuers that shall be returned
startPosition - index of the feature the query shall start
query - a set of Query objects that describes the query to perform

createWFSGetFeatureRequest

public static WFSGetFeatureRequest createWFSGetFeatureRequest(java.lang.String id,
                                                              org.w3c.dom.Document doc)
                                                       throws java.lang.Exception
creates a instance of a WFSGetFeatureRequest object from a reader that contains the request-xml.

Parameters:
doc - DOM object that contains the request
id - id of the request
Throws:
java.lang.Exception

getNative

public static WFSNative getNative(org.w3c.dom.Element element)
The element is intended to allow access to vendor specific capabilities of any particular web feature server or datastore. The tag simply delimits the vendor specific command or operation.


getQuery

private static WFSQuery[] getQuery(org.w3c.dom.Element element)
                            throws java.lang.Exception
The query defines which feature type to query, what properties to retrieve and what constraints (spatial and non-spatial) to apply to those properties.

only used for xml-coded requests

Throws:
java.lang.Exception

getPropertyNames

private static java.lang.String[] getPropertyNames(org.w3c.dom.Element element)
The property names is used to enumerate the feature properties or attributes that should be selected. If no property names are specified then all properties should be fetched.


getFilter

public static Filter getFilter(org.w3c.dom.Element element)
                        throws FilterConstructionException
returns the filter that limits the query

Throws:
FilterConstructionException

createWFSGetFeatureResponse

public static WFSGetFeatureResponse createWFSGetFeatureResponse(OGCWebServiceRequest request,
                                                                java.lang.String[] affectedFeatureTypes,
                                                                OGCWebServiceException exception,
                                                                java.lang.Object response)
creates a WFSGetFeatureResponse object

Parameters:
request - a copy of the request that leads to this response
exception - a describtion of an excetion (only if raised)
affectedFeatureTypes - names of the feature types affected by the response
response - the response to the request

createWFSGetCapabilitiesRequest

public static WFSGetCapabilitiesRequest createWFSGetCapabilitiesRequest(java.lang.String id,
                                                                        java.util.HashMap vendorSpecificParameter,
                                                                        WFSNative native_)
creates a WFSGetCapabilitiesRequest object.

Parameters:
id - id of the request
vendorSpecificParameter - none standadized parameters as name-value pairs
native_ - is intended to allow access to vendor specific capabilities

createWFSGetCapabilitiesResponse

public static WFSGetCapabilitiesResponse createWFSGetCapabilitiesResponse(OGCWebServiceRequest request,
                                                                          OGCWebServiceException exception,
                                                                          WFSCapabilities response)
creates a WFSGetCapabilitiesResponse object

Parameters:
request - a copy of the request that leads to this response
exception - a describtion of an excetion (only if raised)
response - the response to the request

createQuery

public static WFSQuery createQuery(java.lang.String[] propertyNames,
                                   java.lang.String handle,
                                   java.lang.String version,
                                   java.lang.String typeName,
                                   Filter filter)
creates a WFSQuery object from its property names, a handle the used version, the feature type (typeName) targeted by the query and a filter.


createQuery

public static WFSQuery createQuery(org.w3c.dom.Element element)
                            throws java.lang.Exception
creates a WFS Query object from a dom element.

Parameters:
element - dom element containing a WFS query
Throws:
java.lang.Exception

createWFSTransactionRequest

public static WFSTransactionRequest createWFSTransactionRequest(java.lang.String version,
                                                                java.lang.String id,
                                                                java.lang.String lockId,
                                                                WFSOperation[] operations,
                                                                java.lang.String handle,
                                                                java.lang.String releaseAction)
creates a WFSTransactionRequest object.

Parameters:
id - id of the request
lockId -
operations -
handle -
releaseAction -
version -

createWFSTransactionRequest

public static WFSTransactionRequest createWFSTransactionRequest(java.lang.String id,
                                                                org.w3c.dom.Document doc)
                                                         throws XMLParsingException
creates a WFSTransactionRequest object.

Parameters:
id - id of the request
doc - DOM objects that contains the request
Throws:
XMLParsingException

createInsert

public static WFSInsert createInsert(GMLFeature[] feat,
                                     java.lang.String handle)
creates a WFSInsert object from an array of GMLFeature and a handle.


createDelete

public static WFSDelete createDelete(Filter filter,
                                     java.lang.String typeName)
creates a WFSDelete object from a Filter and a typeName specifying the feature type to perform the deletion on.


createInsert

private static WFSInsert createInsert(org.w3c.dom.Element element)
                               throws FilterConstructionException
Creates a WFSInsert object from a wfs:Update-element as defined in the OGC-WFS specification.

Parameters:
element - the 'Insert'-Element
Returns:
the constructed WFSInsert-instance
Throws:
FilterConstructionException

createDelete

private static WFSDelete createDelete(org.w3c.dom.Element element)
                               throws FilterConstructionException
Creates a WFSDelete object from a wfs:Delete-element as defined in the OGC-WFS specification.

Parameters:
element - the 'Delete'-Element
Returns:
the constructed WFSDelete-instance
Throws:
FilterConstructionException

createUpdate

private static WFSUpdate createUpdate(org.w3c.dom.Element element)
                               throws XMLParsingException
Creates a WFSUpdate object from a wfs:Update-element as defined in the OGC-WFS specification.

Parameters:
element - the 'Update'-Element
Returns:
the constructed WFSUpdate-instance
Throws:
XMLParsingException

createNative

private static WFSNative createNative(org.w3c.dom.Element element)
creates nativ operations object from a XML-element defined by the OGC WFS specifications


createWFSTransactionResponse

public static WFSTransactionResponse createWFSTransactionResponse(OGCWebServiceRequest request,
                                                                  java.lang.String[] affectedFeatureTypes,
                                                                  OGCWebServiceException exception,
                                                                  WFSInsertResult[] insertResults,
                                                                  java.lang.String status,
                                                                  java.lang.String handle)
creates a WFSTransactionRequest object.

Parameters:
request - request that lead to the response
affectedFeatureTypes - feature types that has been affected by the request
exception - exception if raised
status - termination status of the transaction (Success|Partial|Failed)
handle - something to identify the failure if one has occured

createWFSInsertResult

public static WFSInsertResult createWFSInsertResult(java.lang.String handle,
                                                    java.lang.String[] featureIds)
creates a WFSInsertResult


toMap

private static java.util.Map toMap(java.lang.String request)
puts a http-GET request to a HashMap