org.deegree.protocol.wfs.client
Class WFSClient

java.lang.Object
  extended by org.deegree.protocol.ows.client.AbstractOWSClient<WFSCapabilitiesAdapter>
      extended by org.deegree.protocol.wfs.client.WFSClient

public class WFSClient
extends AbstractOWSClient<WFSCapabilitiesAdapter>

API-level client for accessing servers that implement the OpenGIS Web Feature Service (WFS) 1.0.0/1.1.0/2.0.0 protocol.

Initialization

In the initial step, one constructs a new WFSClient instance by invoking the constructor with a URL to a WFS capabilities document. This usually is a GetCapabilities request (including necessary parameters) to a WFS service.
 ...
   URL capabilitiesUrl = new URL( "http://...?service=WFS&version=1.0.0&request=GetCapabilities" );
   WFSClient wfsClient = new WFSClient( capabilitiesUrl );
 ...
 
Afterwards, the initialized WFSClient instance is bound to the specified service and WFS protocol version. Now, it's possible to access service metadata, feature type information as well as performing queries.

Accessing service metadata

The method #getMetadata() allows to access service metadata announced by the service, such as title, abstract, provider etc.

Accessing feature type information

...

Retrieving feature instances

...

Retrieving individual GML objects

...

Performing transactions

...

Locking features

...

Version:
$Revision: 32145 $, $Date: 2011-10-14 19:13:51 +0200 (Fri, 14 Oct 2011) $
Author:
Markus Schneider, last edited by: $Author: mschneider $

Field Summary
 
Fields inherited from class org.deegree.protocol.ows.client.AbstractOWSClient
capaDoc
 
Constructor Summary
WFSClient(URL capaUrl)
          Creates a new WFSClient instance with default behavior.
WFSClient(URL capaUrl, AppSchema schema)
          Creates a new WFSClient instance with options.
 
Method Summary
 GetFeatureResponse<Feature> doGetFeature(GetFeature request)
          Performs the given GetFeature request.
 AppSchema getAppSchema()
          Returns the (GML) AppSchema for all FeatureTypes offered by this server.
protected  WFSCapabilitiesAdapter getCapabilitiesAdapter(org.apache.axiom.om.OMElement root, String versionAttr)
          Returns an OWSCapabilitiesAdapter instance suitable for the specific service and version.
 GetFeatureResponse<Feature> getFeatures(QName ftName, Filter filter)
          Queries features of the specified feature type and with an optional filter.
 WFSFeatureType getFeatureType(QName ftName)
          Returns (metadata of) the specified feature type offered by the service.
 List<WFSFeatureType> getFeatureTypes()
          Returns (metadata of) all feature types offered by the service.
 GMLObject getGMLObject(GetGmlObject request)
           
 WFSVersion getServiceVersion()
          Returns the WFS protocol version in use.
 
Methods inherited from class org.deegree.protocol.ows.client.AbstractOWSClient
doGet, doPost, getGetUrl, getGetUrls, getIdentification, getOperations, getPostUrl, getPostUrls, getProvider, isOperationSupported
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WFSClient

public WFSClient(URL capaUrl)
          throws OWSExceptionReport,
                 XMLStreamException,
                 IOException
Creates a new WFSClient instance with default behavior.

Parameters:
capaUrl - url of a WFS capabilities document, usually this is a KVP-encoded GetCapabilities request to a WFS service, must not be null
Throws:
OWSExceptionReport - if the server responded with an exception report
XMLStreamException
IOException - if a communication/network problem occured

WFSClient

public WFSClient(URL capaUrl,
                 AppSchema schema)
          throws OWSExceptionReport,
                 XMLStreamException,
                 IOException
Creates a new WFSClient instance with options.

Parameters:
capaUrl - url of a WFS capabilities document, usually this is a GetCapabilities request to a WFS service, must not be null
schema - application schema that describes the feature types offered by the service, can be null (in this case, DescribeFeatureType requests will be performed to determine the schema)
Throws:
OWSExceptionReport - if the server responded with a service exception report
XMLStreamException
IOException - if a communication/network problem occured
Method Detail

getServiceVersion

public WFSVersion getServiceVersion()
Returns the WFS protocol version in use.

Returns:
the WFS protocol version in use, never null

getFeatureTypes

public List<WFSFeatureType> getFeatureTypes()
Returns (metadata of) all feature types offered by the service.

Returns:
metadata of the feature types, never null

getFeatureType

public WFSFeatureType getFeatureType(QName ftName)
Returns (metadata of) the specified feature type offered by the service.

Returns:
metadata of the feature type, or null if no such feature type exists

getAppSchema

public AppSchema getAppSchema()
                       throws OWSExceptionReport,
                              XMLStreamException,
                              IOException
Returns the (GML) AppSchema for all FeatureTypes offered by this server.

Returns:
application schema, never null
Throws:
OWSExceptionReport - if the server responded with a service exception report
IOException
XMLStreamException

getFeatures

public GetFeatureResponse<Feature> getFeatures(QName ftName,
                                               Filter filter)
                                        throws OWSExceptionReport,
                                               XMLStreamException,
                                               IOException,
                                               UnknownCRSException,
                                               TransformationException
Queries features of the specified feature type and with an optional filter.

Parameters:
ftName -
filter -
Returns:
query reponse, never null
Throws:
IOException
XMLStreamException
TransformationException
UnknownCRSException
OWSExceptionReport

doGetFeature

public GetFeatureResponse<Feature> doGetFeature(GetFeature request)
                                         throws OWSExceptionReport,
                                                XMLStreamException,
                                                IOException
Performs the given GetFeature request.

Returns:
WFS response, never null
Throws:
OWSExceptionReport - if the server responded with a service exception report
XMLStreamException
IOException

getGMLObject

public GMLObject getGMLObject(GetGmlObject request)

getCapabilitiesAdapter

protected WFSCapabilitiesAdapter getCapabilitiesAdapter(org.apache.axiom.om.OMElement root,
                                                        String versionAttr)
                                                 throws IOException
Description copied from class: AbstractOWSClient
Returns an OWSCapabilitiesAdapter instance suitable for the specific service and version.

Specified by:
getCapabilitiesAdapter in class AbstractOWSClient<WFSCapabilitiesAdapter>
Parameters:
root - root element of the service capabilities, never null
versionAttr - capabilities version, may be null (for broken capabilities responses)
Returns:
capabilities adapter, must not be null
Throws:
IOException


Copyright © 2011. All Rights Reserved.