org.geotools.data.wfs.v1_1_0
Class WFS_1_1_0_Protocol

Object
  extended by WFS_1_1_0_Protocol
All Implemented Interfaces:
WFSProtocol

public class WFS_1_1_0_Protocol
extends Object
implements WFSProtocol

WFSProtocol implementation to talk to a WFS 1.1.0 server leveraging the GeoTools xml-xsd subsystem for schema assisted parsing and encoding of WFS requests and responses.

Since:
2.6
Author:
Gabriel Roldan (OpenGeo)
Module:

Constructor Summary
WFS_1_1_0_Protocol(InputStream capabilitiesReader, HTTPProtocol http)
           
 
Method Summary
 WFSResponse describeFeatureTypeGET(String typeName, String outputFormat)
          Issues a DescribeFeatureType request for the given type name and output format using the HTTP GET method
 WFSResponse describeFeatureTypePOST(String typeName, String outputFormat)
          Issues a DescribeFeatureType request for the given type name and output format using the HTTP POST method
 void dispose()
          Allows to free any resource held.
static void encode(EObject request, Configuration configuration, OutputStream out, Charset charset)
          Encodes a WFS request into out
 String getDefaultCRS(String typeName)
          Returns the CRS identifier of the default CRS for the given feature type as declared in the corresponding FeatureType element in the capabilities document.
 String getDefaultOutputFormat(WFSOperationType operation)
           
 URL getDescribeFeatureTypeURLGet(String typeName)
          Returns the http GET request to get the gml schema for the given type name
 String getFeatureTypeAbstract(String typeName)
          Returns the abstract of the given feature type as declared in the corresponding FeatureType element in the capabilities document.
 Set<String> getFeatureTypeKeywords(String typeName)
          Returns the list of keywords of the given feature type as declared in the corresponding FeatureType element in the capabilities document.
 QName getFeatureTypeName(String typeName)
          Returns the full feature type name for the typeName as declared in the FeatureTypeList/FeatureType/Name element of the capabilities document.
 Set<QName> getFeatureTypeNames()
          Returns the set of type names as extracted from the capabilities document, including the namespace and prefix.
 String getFeatureTypeTitle(String typeName)
          Returns the title of the given feature type as declared in the corresponding FeatureType element in the capabilities document.
 ReferencedEnvelope getFeatureTypeWGS84Bounds(String typeName)
          Returns the lat lon envelope of the given feature type as declared in the corresponding FeatureType element in the capabilities document.
 FilterCapabilities getFilterCapabilities()
          Returns the parsed version of the FilterCapabilities section in the capabilities document
 URL getOperationURL(WFSOperationType operation, boolean post)
          Returns the URL for the given operation name and HTTP protocol as stated in the WFS capabilities.
 String getServiceAbstract()
          Returns service abstract as stated in the capabilities document
 Set<String> getServiceKeywords()
          Returns service keywords as stated in the capabilities document
 URI getServiceProviderUri()
          Returns service provider URI as stated in the capabilities document
 String getServiceTitle()
          Returns service title as stated in the capabilities document
 Version getServiceVersion()
          Returns the WFS protocol version this facade talks to the WFS instance.
 Set<String> getSupportedCRSIdentifiers(String typeName)
          Returns the union of the default CRS and the other supported CRS's of the given feature type as declared in the corresponding FeatureType element in the capabilities document.
 Set<String> getSupportedGetFeatureOutputFormats()
          Returns the output format names declared in the GetFeature operation metadata section of the WFS capabilities document
 Set<String> getSupportedOutputFormats(String typeName)
          Returns the union of WFSProtocol.getSupportedGetFeatureOutputFormats() and the output formats declared for the feature type specifically in the FeatureTypeList section of the capabilities document for the given feature type
 WFSResponse issueGetFeatureGET(GetFeature request)
          Issues a GetFeature request for the given request, using GET HTTP method The request shall already be adapted to what the server supports in terms of filter capabilities and CRS reprojection.
 WFSResponse issueGetFeaturePOST(GetFeature request)
          Issues a GetFeature request for the given request, using POST HTTP method The query to WFS request parameter translation is the same than for WFSProtocol.issueGetFeatureGET(GetFeature)
 void setStrategy(WFSStrategy strategy)
           
 Filter[] splitFilters(Filter filter)
           
 boolean supportsOperation(WFSOperationType operation, boolean post)
          Returns whether the service supports the given operation for the given HTTP method.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WFS_1_1_0_Protocol

public WFS_1_1_0_Protocol(InputStream capabilitiesReader,
                          HTTPProtocol http)
                   throws IOException
Throws:
IOException
Method Detail

setStrategy

public void setStrategy(WFSStrategy strategy)

getServiceVersion

public Version getServiceVersion()
Description copied from interface: WFSProtocol
Returns the WFS protocol version this facade talks to the WFS instance.

Specified by:
getServiceVersion in interface WFSProtocol
Returns:
Version.v1_1_0
See Also:
WFSProtocol.getServiceVersion()

getServiceTitle

public String getServiceTitle()
Description copied from interface: WFSProtocol
Returns service title as stated in the capabilities document

Specified by:
getServiceTitle in interface WFSProtocol
Returns:
the service title
See Also:
WFSProtocol.getServiceTitle()

getServiceAbstract

public String getServiceAbstract()
Description copied from interface: WFSProtocol
Returns service abstract as stated in the capabilities document

Specified by:
getServiceAbstract in interface WFSProtocol
Returns:
the service abstract, may be null
See Also:
WFSProtocol.getServiceAbstract()

getServiceKeywords

public Set<String> getServiceKeywords()
Description copied from interface: WFSProtocol
Returns service keywords as stated in the capabilities document

Specified by:
getServiceKeywords in interface WFSProtocol
Returns:
the service keywords, may be empty
See Also:
WFSProtocol.getServiceKeywords()

getServiceProviderUri

public URI getServiceProviderUri()
Description copied from interface: WFSProtocol
Returns service provider URI as stated in the capabilities document

Specified by:
getServiceProviderUri in interface WFSProtocol
Returns:
the service provider URI
See Also:
WFSProtocol.getServiceProviderUri()

getSupportedGetFeatureOutputFormats

public Set<String> getSupportedGetFeatureOutputFormats()
Description copied from interface: WFSProtocol
Returns the output format names declared in the GetFeature operation metadata section of the WFS capabilities document

Specified by:
getSupportedGetFeatureOutputFormats in interface WFSProtocol
Returns:
the global GetFeature output formats
See Also:
WFSProtocol.getSupportedGetFeatureOutputFormats()

getSupportedOutputFormats

public Set<String> getSupportedOutputFormats(String typeName)
Description copied from interface: WFSProtocol
Returns the union of WFSProtocol.getSupportedGetFeatureOutputFormats() and the output formats declared for the feature type specifically in the FeatureTypeList section of the capabilities document for the given feature type

Specified by:
getSupportedOutputFormats in interface WFSProtocol
Parameters:
typeName - the feature type name for which to return the supported output formats
Returns:
the output formats supported by typeName
See Also:
WFSProtocol.getSupportedOutputFormats(String)

getFeatureTypeNames

public Set<QName> getFeatureTypeNames()
Description copied from interface: WFSProtocol
Returns the set of type names as extracted from the capabilities document, including the namespace and prefix.

Specified by:
getFeatureTypeNames in interface WFSProtocol
Returns:
the set of feature type names as extracted from the capabilities document
See Also:
WFSProtocol.getFeatureTypeNames()

getFeatureTypeName

public QName getFeatureTypeName(String typeName)
Description copied from interface: WFSProtocol
Returns the full feature type name for the typeName as declared in the FeatureTypeList/FeatureType/Name element of the capabilities document.

The returned QName contains the namespace, localname as well as the prefix. typeName is known to be prefix:localName.

Specified by:
getFeatureTypeName in interface WFSProtocol
Parameters:
typeName - the prefixed type name to get the full name for
Returns:
the full name of the given feature type
See Also:
WFSProtocol.getFeatureTypeName(String)

getFilterCapabilities

public FilterCapabilities getFilterCapabilities()
Description copied from interface: WFSProtocol
Returns the parsed version of the FilterCapabilities section in the capabilities document

Specified by:
getFilterCapabilities in interface WFSProtocol
Returns:
a FilterCapabilities out of the FilterCapabilities section in the getcapabilities document
See Also:
WFSProtocol.getFilterCapabilities()

supportsOperation

public boolean supportsOperation(WFSOperationType operation,
                                 boolean post)
Description copied from interface: WFSProtocol
Returns whether the service supports the given operation for the given HTTP method.

Specified by:
supportsOperation in interface WFSProtocol
Parameters:
operation - the operation to check if the server supports
Returns:
true if the operation/method is supported as stated in the WFS capabilities
See Also:
WFSProtocol.supportsOperation(WFSOperationType, boolean)

getOperationURL

public URL getOperationURL(WFSOperationType operation,
                           boolean post)
Description copied from interface: WFSProtocol
Returns the URL for the given operation name and HTTP protocol as stated in the WFS capabilities.

Specified by:
getOperationURL in interface WFSProtocol
Parameters:
operation - the name of the WFS operation
Returns:
The URL access point for the given operation and method or null if the capabilities does not declare an access point for the operation/method combination
See Also:
WFSProtocol.getOperationURL(WFSOperationType, boolean)

getFeatureTypeTitle

public String getFeatureTypeTitle(String typeName)
Description copied from interface: WFSProtocol
Returns the title of the given feature type as declared in the corresponding FeatureType element in the capabilities document.

Specified by:
getFeatureTypeTitle in interface WFSProtocol
Parameters:
typeName - the featuretype name as declared in the FeatureType/Name element of the WFS capabilities
Returns:
the title for the given feature type
See Also:
WFSProtocol.getFeatureTypeTitle(String)

getFeatureTypeAbstract

public String getFeatureTypeAbstract(String typeName)
Description copied from interface: WFSProtocol
Returns the abstract of the given feature type as declared in the corresponding FeatureType element in the capabilities document.

Specified by:
getFeatureTypeAbstract in interface WFSProtocol
Parameters:
typeName - the featuretype name as declared in the FeatureType/Name element of the WFS capabilities
Returns:
the abstract for the given feature type
See Also:
WFSProtocol.getFeatureTypeAbstract(String)

getFeatureTypeWGS84Bounds

public ReferencedEnvelope getFeatureTypeWGS84Bounds(String typeName)
Description copied from interface: WFSProtocol
Returns the lat lon envelope of the given feature type as declared in the corresponding FeatureType element in the capabilities document.

Specified by:
getFeatureTypeWGS84Bounds in interface WFSProtocol
Parameters:
typeName - the featuretype name as declared in the FeatureType/Name element of the WFS capabilities
Returns:
a WGS84 envelope representing the bounds declared for the feature type in the capabilities document
See Also:
WFSProtocol.getFeatureTypeWGS84Bounds(String)

getDefaultCRS

public String getDefaultCRS(String typeName)
Description copied from interface: WFSProtocol
Returns the CRS identifier of the default CRS for the given feature type as declared in the corresponding FeatureType element in the capabilities document.

Specified by:
getDefaultCRS in interface WFSProtocol
Parameters:
typeName - the featuretype name as declared in the FeatureType/Name element of the WFS capabilities
Returns:
the default CRS for the given feature type
See Also:
WFSProtocol.getDefaultCRS(String)

getSupportedCRSIdentifiers

public Set<String> getSupportedCRSIdentifiers(String typeName)
Description copied from interface: WFSProtocol
Returns the union of the default CRS and the other supported CRS's of the given feature type as declared in the corresponding FeatureType element in the capabilities document.

Specified by:
getSupportedCRSIdentifiers in interface WFSProtocol
Parameters:
typeName - the featuretype name as declared in the FeatureType/Name element of the WFS capabilities
Returns:
the list of supported CRS identifiers for the given feature type
See Also:
WFSProtocol.getSupportedCRSIdentifiers(String)

getFeatureTypeKeywords

public Set<String> getFeatureTypeKeywords(String typeName)
Description copied from interface: WFSProtocol
Returns the list of keywords of the given feature type as declared in the corresponding FeatureType element in the capabilities document.

Specified by:
getFeatureTypeKeywords in interface WFSProtocol
Parameters:
typeName - the featuretype name as declared in the FeatureType/Name element of the WFS capabilities
Returns:
the keywords for the given feature type
See Also:
WFSProtocol.getFeatureTypeKeywords(String)

getDescribeFeatureTypeURLGet

public URL getDescribeFeatureTypeURLGet(String typeName)
Description copied from interface: WFSProtocol
Returns the http GET request to get the gml schema for the given type name

Specified by:
getDescribeFeatureTypeURLGet in interface WFSProtocol
Returns:
See Also:
WFSProtocol.getDescribeFeatureTypeURLGet(String)

describeFeatureTypeGET

public WFSResponse describeFeatureTypeGET(String typeName,
                                          String outputFormat)
                                   throws IOException
Description copied from interface: WFSProtocol
Issues a DescribeFeatureType request for the given type name and output format using the HTTP GET method

Specified by:
describeFeatureTypeGET in interface WFSProtocol
Throws:
IOException
See Also:
WFSProtocol.describeFeatureTypeGET(String, String)

describeFeatureTypePOST

public WFSResponse describeFeatureTypePOST(String typeName,
                                           String outputFormat)
                                    throws IOException
Description copied from interface: WFSProtocol
Issues a DescribeFeatureType request for the given type name and output format using the HTTP POST method

Specified by:
describeFeatureTypePOST in interface WFSProtocol
Throws:
IOException
See Also:
WFSProtocol.describeFeatureTypePOST(String, String)

issueGetFeatureGET

public WFSResponse issueGetFeatureGET(GetFeature request)
                               throws IOException
Description copied from interface: WFSProtocol
Issues a GetFeature request for the given request, using GET HTTP method

The request shall already be adapted to what the server supports in terms of filter capabilities and CRS reprojection. The WFSProtocol implementation is not required to check if the query filter is fully supported nor if the CRS is supported for the feature type.

Specified by:
issueGetFeatureGET in interface WFSProtocol
Parameters:
request - the request to send to the WFS, as is.
Returns:
Throws:
IOException
See Also:
WFSProtocol#issueGetFeatureGET(GetFeatureType, Map)

issueGetFeaturePOST

public WFSResponse issueGetFeaturePOST(GetFeature request)
                                throws IOException
Description copied from interface: WFSProtocol
Issues a GetFeature request for the given request, using POST HTTP method

The query to WFS request parameter translation is the same than for WFSProtocol.issueGetFeatureGET(GetFeature)

Specified by:
issueGetFeaturePOST in interface WFSProtocol
Throws:
IOException
See Also:
WFSProtocol#getFeaturePOST(Query, String)

dispose

public void dispose()
Description copied from interface: WFSProtocol
Allows to free any resource held.

Successive calls to this method should not result in any exception, but the instance is meant to not be usable after the first invocation.

Specified by:
dispose in interface WFSProtocol
See Also:
WFSProtocol.dispose()

encode

public static void encode(EObject request,
                          Configuration configuration,
                          OutputStream out,
                          Charset charset)
                   throws IOException
Encodes a WFS request into out

Parameters:
request - one of GetCapabilitiesType, GetFeatureType, etc
configuration - the wfs configuration to use for encoding the request into the output stream
out - the output stream where to encode the request into
charset - the charset to use to encode the request in
Throws:
IOException

getDefaultOutputFormat

public String getDefaultOutputFormat(WFSOperationType operation)
Specified by:
getDefaultOutputFormat in interface WFSProtocol

splitFilters

public Filter[] splitFilters(Filter filter)
Specified by:
splitFilters in interface WFSProtocol


Copyright © 1996-2010 Geotools. All Rights Reserved.