org.geotools.data.wfs.protocol.wfs
Interface WFSProtocol

All Known Implementing Classes:
WFS_1_1_0_Protocol

public interface WFSProtocol

Facade interface to interact with a WFS instance.

Implementations of this interface know how to send and get information back from a WFS service for a specific protocol version, but are not meant to provide any logic other than the conversation with the service. For instance, WFSProtocol implementations are not required to transform filters to something appropriate for the service capabilities, nor any other control logic than creating and sending the requests mapping what is given to the operation methods.

This interface provides enough information extracted or derived from the WFS capabilities document as for the client code to issue requests appropriate for the server capabilities.

Since:
2.6
Version:
$Id: WFSProtocol.java 33654 2009-07-30 11:58:11Z groldan $
Author:
Gabriel Roldan (OpenGeo)

Method Summary
 WFSResponse describeFeatureTypeGET(java.lang.String typeName, java.lang.String outputFormat)
          Issues a DescribeFeatureType request for the given type name and output format using the HTTP GET method
 WFSResponse describeFeatureTypePOST(java.lang.String typeName, java.lang.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.
 java.lang.String getDefaultCRS(java.lang.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.
 java.lang.String getDefaultOutputFormat(WFSOperationType get_feature)
           
 java.net.URL getDescribeFeatureTypeURLGet(java.lang.String typeName)
          Returns the http GET request to get the gml schema for the given type name
 java.lang.String getFeatureTypeAbstract(java.lang.String typeName)
          Returns the abstract of the given feature type as declared in the corresponding FeatureType element in the capabilities document.
 java.util.Set<java.lang.String> getFeatureTypeKeywords(java.lang.String typeName)
          Returns the list of keywords of the given feature type as declared in the corresponding FeatureType element in the capabilities document.
 javax.xml.namespace.QName getFeatureTypeName(java.lang.String typeName)
          Returns the full feature type name for the typeName as declared in the FeatureTypeList/FeatureType/Name element of the capabilities document.
 java.util.Set<javax.xml.namespace.QName> getFeatureTypeNames()
          Returns the set of type names as extracted from the capabilities document, including the namespace and prefix.
 java.lang.String getFeatureTypeTitle(java.lang.String typeName)
          Returns the title of the given feature type as declared in the corresponding FeatureType element in the capabilities document.
 ReferencedEnvelope getFeatureTypeWGS84Bounds(java.lang.String typeName)
          Returns the lat lon envelope of the given feature type as declared in the corresponding FeatureType element in the capabilities document.
 org.opengis.filter.capability.FilterCapabilities getFilterCapabilities()
          Returns the parsed version of the FilterCapabilities section in the capabilities document
 java.net.URL getOperationURL(WFSOperationType operation, boolean post)
          Returns the URL for the given operation name and HTTP protocol as stated in the WFS capabilities.
 java.lang.String getServiceAbstract()
          Returns service abstract as stated in the capabilities document
 java.util.Set<java.lang.String> getServiceKeywords()
          Returns service keywords as stated in the capabilities document
 java.net.URI getServiceProviderUri()
          Returns service provider URI as stated in the capabilities document
 java.lang.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.
 java.util.Set<java.lang.String> getSupportedCRSIdentifiers(java.lang.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.
 java.util.Set<java.lang.String> getSupportedGetFeatureOutputFormats()
          Returns the output format names declared in the GetFeature operation metadata section of the WFS capabilities document
 java.util.Set<java.lang.String> getSupportedOutputFormats(java.lang.String typeName)
          Returns the union of 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
 WFSResponse issueGetFeaturePOST(GetFeature request)
          Issues a GetFeature request for the given request, using POST HTTP method
 org.opengis.filter.Filter[] splitFilters(org.opengis.filter.Filter filter)
           
 boolean supportsOperation(WFSOperationType operation, boolean post)
          Returns whether the service supports the given operation for the given HTTP method.
 

Method Detail

getServiceVersion

Version getServiceVersion()
Returns the WFS protocol version this facade talks to the WFS instance.

Returns:
the protocol version in use by this facade

getServiceTitle

java.lang.String getServiceTitle()
Returns service title as stated in the capabilities document

Returns:
the service title

getServiceAbstract

java.lang.String getServiceAbstract()
Returns service abstract as stated in the capabilities document

Returns:
the service abstract, may be null

getServiceKeywords

java.util.Set<java.lang.String> getServiceKeywords()
Returns service keywords as stated in the capabilities document

Returns:
the service keywords, may be empty

getServiceProviderUri

java.net.URI getServiceProviderUri()
Returns service provider URI as stated in the capabilities document

Returns:
the service provider URI

getSupportedGetFeatureOutputFormats

java.util.Set<java.lang.String> getSupportedGetFeatureOutputFormats()
Returns the output format names declared in the GetFeature operation metadata section of the WFS capabilities document

Returns:
the global GetFeature output formats

getSupportedOutputFormats

java.util.Set<java.lang.String> getSupportedOutputFormats(java.lang.String typeName)
Returns the union of getSupportedGetFeatureOutputFormats() and the output formats declared for the feature type specifically in the FeatureTypeList section of the capabilities document for the given feature type

Parameters:
typeName - the feature type name for which to return the supported output formats
Returns:
the output formats supported by typeName

getFeatureTypeNames

java.util.Set<javax.xml.namespace.QName> getFeatureTypeNames()
Returns the set of type names as extracted from the capabilities document, including the namespace and prefix.

Returns:
the set of feature type names as extracted from the capabilities document

getFeatureTypeName

javax.xml.namespace.QName getFeatureTypeName(java.lang.String typeName)
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.

Parameters:
typeName - the prefixed type name to get the full name for
Returns:
the full name of the given feature type
Throws:
java.lang.IllegalArgumentException - if the typeName does not exist

getFilterCapabilities

org.opengis.filter.capability.FilterCapabilities getFilterCapabilities()
Returns the parsed version of the FilterCapabilities section in the capabilities document

Returns:
a FilterCapabilities out of the FilterCapabilities section in the getcapabilities document

supportsOperation

boolean supportsOperation(WFSOperationType operation,
                          boolean post)
Returns whether the service supports the given operation for the given HTTP method.

Parameters:
operation - the operation to check if the server supports
method - the HTTP method to check if the server supports for the given operation
Returns:
true if the operation/method is supported as stated in the WFS capabilities

getOperationURL

java.net.URL getOperationURL(WFSOperationType operation,
                             boolean post)
Returns the URL for the given operation name and HTTP protocol as stated in the WFS capabilities.

Parameters:
operation - the name of the WFS operation
method - the HTTP method
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:
#supportsOperation(WFSOperationType, HttpMethod)

getFeatureTypeTitle

java.lang.String getFeatureTypeTitle(java.lang.String typeName)
Returns the title of the given feature type as declared in the corresponding FeatureType element in the capabilities document.

Parameters:
typeName - the featuretype name as declared in the FeatureType/Name element of the WFS capabilities
Returns:
the title for the given feature type

getFeatureTypeAbstract

java.lang.String getFeatureTypeAbstract(java.lang.String typeName)
Returns the abstract of the given feature type as declared in the corresponding FeatureType element in the capabilities document.

Parameters:
typeName - the featuretype name as declared in the FeatureType/Name element of the WFS capabilities
Returns:
the abstract for the given feature type

getFeatureTypeWGS84Bounds

ReferencedEnvelope getFeatureTypeWGS84Bounds(java.lang.String typeName)
Returns the lat lon envelope of the given feature type as declared in the corresponding FeatureType element in the capabilities document.

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

getDefaultCRS

java.lang.String getDefaultCRS(java.lang.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.

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

getSupportedCRSIdentifiers

java.util.Set<java.lang.String> getSupportedCRSIdentifiers(java.lang.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.

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

getFeatureTypeKeywords

java.util.Set<java.lang.String> getFeatureTypeKeywords(java.lang.String typeName)
Returns the list of keywords of the given feature type as declared in the corresponding FeatureType element in the capabilities document.

Parameters:
typeName - the featuretype name as declared in the FeatureType/Name element of the WFS capabilities
Returns:
the keywords for the given feature type

getDescribeFeatureTypeURLGet

java.net.URL getDescribeFeatureTypeURLGet(java.lang.String typeName)
Returns the http GET request to get the gml schema for the given type name

Parameters:
typeName -
Returns:

describeFeatureTypeGET

WFSResponse describeFeatureTypeGET(java.lang.String typeName,
                                   java.lang.String outputFormat)
                                   throws java.io.IOException,
                                          java.lang.UnsupportedOperationException
Issues a DescribeFeatureType request for the given type name and output format using the HTTP GET method

Throws:
java.io.IOException
java.lang.UnsupportedOperationException

describeFeatureTypePOST

WFSResponse describeFeatureTypePOST(java.lang.String typeName,
                                    java.lang.String outputFormat)
                                    throws java.io.IOException,
                                           java.lang.UnsupportedOperationException
Issues a DescribeFeatureType request for the given type name and output format using the HTTP POST method

Throws:
java.io.IOException
java.lang.UnsupportedOperationException

issueGetFeatureGET

WFSResponse issueGetFeatureGET(GetFeature request)
                               throws java.io.IOException,
                                      java.lang.UnsupportedOperationException
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.

Parameters:
request - the request to send to the WFS, as is.
kvp - the key/value pair representation of the request to build the query string from
Returns:
Throws:
java.io.IOException
java.lang.UnsupportedOperationException

issueGetFeaturePOST

WFSResponse issueGetFeaturePOST(GetFeature request)
                                throws java.io.IOException,
                                       java.lang.UnsupportedOperationException
Issues a GetFeature request for the given request, using POST HTTP method

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

Throws:
java.io.IOException
java.lang.UnsupportedOperationException

dispose

void dispose()
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.


getDefaultOutputFormat

java.lang.String getDefaultOutputFormat(WFSOperationType get_feature)

splitFilters

org.opengis.filter.Filter[] splitFilters(org.opengis.filter.Filter filter)


Copyright © 1996-2010 Geotools. All Rights Reserved.