Class WFSStrategy
- Direct Known Subclasses:
AbstractWFSStrategy
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract URL
buildUrlGET
(WFSRequest request) boolean
canLimit()
boolean
Indicates whether the server supports adjusting the starting position of the result set.abstract void
dispose()
Allows to free any resource held.getClientSupportedOutputFormats
(WFSOperationType operation) abstract WFSConfig
abstract String
getDefaultOutputFormat
(WFSOperationType operation) abstract FeatureTypeInfo
getFeatureTypeInfo
(QName typeName) Returns the feature type metadata object parsed from the capabilities document for the giventypeName
Returns the set of type names as extracted from the capabilities document, including the namespace and prefix.Provide additional field type mappingsabstract FilterCapabilities
Returns the parsed version of the FilterCapabilities section in the capabilities documentabstract URL
getOperationURL
(WFSOperationType operation, HttpMethod method) Returns the URL for the given operation name and HTTP protocol as stated in the WFS capabilities.abstract InputStream
getPostContents
(WFSRequest wfsRequest) Returns the input stream with the POST body contents for the given request.abstract String
getPostContentType
(WFSRequest wfsRequest) getServerSupportedOutputFormats
(QName typeName, WFSOperationType operation) getServerSupportedOutputFormats
(WFSOperationType operation) abstract WFSServiceInfo
abstract Version
Returns the WFS protocol version this facade talks to the WFS instance.getSupportedCRSIdentifiers
(QName 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, as well as any globally supported CRS identifier declared as a parameter of the GetFeature oepration in the capabilities document.abstract Configuration
newRequestHandle
(WFSOperationType operation) abstract void
setCapabilities
(WFSGetCapabilities capabilities) abstract void
abstract Filter[]
splitFilters
(QName typeName, Filter filter) Splits the filter provided by the geotools query into the server supported and unsupported ones.abstract boolean
supports
(GetFeatureRequest.ResultType resultType) abstract boolean
supportsOperation
(WFSOperationType operation, HttpMethod method) Returns whether the service supports the given operation for the given HTTP method.abstract boolean
supportsTransaction
(QName typeName) Methods inherited from class Specification
createGetCapabilitiesRequest, getVersion
-
Constructor Details
-
WFSStrategy
public WFSStrategy()
-
-
Method Details
-
setCapabilities
-
setConfig
-
getFeatureTypeInfo
Returns the feature type metadata object parsed from the capabilities document for the giventypeName
- Parameters:
typeName
- the typeName as stated in the capabilitiesFeatureTypeList
to get the info for- Returns:
- the WFS capabilities metadata for
typeName
- Throws:
IllegalArgumentException
- iftypeName
is not the name of a FeatureType stated in the capabilities document.
-
getConfig
-
getServiceVersion
Returns the WFS protocol version this facade talks to the WFS instance.- Returns:
- the protocol version in use by this facade
-
getServerSupportedOutputFormats
- Returns:
- the output formats the server advertises for the given operation;
-
getServerSupportedOutputFormats
public abstract Set<String> getServerSupportedOutputFormats(QName typeName, WFSOperationType operation) - Parameters:
typeName
- the feature type name for which to return the supported output formats- Returns:
- the output formats the server supports for the given type name and operation
-
getClientSupportedOutputFormats
- Returns:
- the list of output formats supported by the client for the given operation, in preferred order.
-
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
-
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
-
splitFilters
Splits the filter provided by the geotools query into the server supported and unsupported ones.- Returns:
- a two-element array where the first element is the supported filter and the second the one to post-process
-
supportsOperation
Returns whether the service supports the given operation for the given HTTP method.- Parameters:
operation
- the operation to check if the server supportsmethod
- 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
-
supports
-
supportsTransaction
-
getOperationURL
Returns the URL for the given operation name and HTTP protocol as stated in the WFS capabilities.- Parameters:
operation
- the name of the WFS operationmethod
- 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:
-
getSupportedCRSIdentifiers
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, as well as any globally supported CRS identifier declared as a parameter of the GetFeature oepration 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
-
dispose
public abstract 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
-
buildUrlGET
-
getPostContentType
-
getPostContents
Returns the input stream with the POST body contents for the given request.- Throws:
IOException
-
getServiceInfo
-
getWfsConfiguration
-
newRequestHandle
-
getFieldTypeMappings
Provide additional field type mappings- Returns:
- field type mappings
-
canLimit
public boolean canLimit()- Returns:
-
canOffset
public boolean canOffset()Indicates whether the server supports adjusting the starting position of the result set. Defaults to false, as not all servers provide support for paging.- Returns:
- true if the server supports setting an offset for the results, otherwise false
-