Class WFSStrategy

  • Direct Known Subclasses:

    public abstract class WFSStrategy
    extends Specification
    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.

    • Constructor Detail

      • WFSStrategy

        public WFSStrategy()
    • Method Detail

      • setCapabilities

        public abstract void setCapabilities​(WFSGetCapabilities capabilities)
      • setConfig

        public abstract void setConfig​(WFSConfig config)
      • getFeatureTypeInfo

        public abstract FeatureTypeInfo getFeatureTypeInfo​(QName typeName)
        Returns the feature type metadata object parsed from the capabilities document for the given typeName
        typeName - the typeName as stated in the capabilities FeatureTypeList to get the info for
        the WFS capabilities metadata for typeName
        IllegalArgumentException - if typeName is not the name of a FeatureType stated in the capabilities document.
      • getConfig

        public abstract WFSConfig getConfig()
      • getServiceVersion

        public abstract Version getServiceVersion()
        Returns the WFS protocol version this facade talks to the WFS instance.
        the protocol version in use by this facade
      • getServerSupportedOutputFormats

        public abstract Set<String> getServerSupportedOutputFormats​(WFSOperationType operation)
        the output formats the server advertises for the given operation;
      • getServerSupportedOutputFormats

        public abstract Set<String> getServerSupportedOutputFormats​(QName typeName,
                                                                    WFSOperationType operation)
        typeName - the feature type name for which to return the supported output formats
        the output formats the server supports for the given type name and operation
      • getClientSupportedOutputFormats

        public abstract List<String> getClientSupportedOutputFormats​(WFSOperationType operation)
        the list of output formats supported by the client for the given operation, in preferred order.
      • getFeatureTypeNames

        public abstract Set<QName> getFeatureTypeNames()
        Returns the set of type names as extracted from the capabilities document, including the namespace and prefix.
        the set of feature type names as extracted from the capabilities document
      • getFilterCapabilities

        public abstract FilterCapabilities getFilterCapabilities()
        Returns the parsed version of the FilterCapabilities section in the capabilities document
        a FilterCapabilities out of the FilterCapabilities section in the getcapabilities document
      • splitFilters

        public abstract Filter[] splitFilters​(QName typeName,
                                              Filter filter)
        Splits the filter provided by the geotools query into the server supported and unsupported ones.
        a two-element array where the first element is the supported filter and the second the one to post-process
      • supportsOperation

        public abstract boolean supportsOperation​(WFSOperationType operation,
                                                  HttpMethod method)
        Returns whether the service supports the given operation for the given HTTP method.
        operation - the operation to check if the server supports
        method - the HTTP method to check if the server supports for the given operation
        true if the operation/method is supported as stated in the WFS capabilities
      • supportsTransaction

        public abstract boolean supportsTransaction​(QName typeName)
      • getOperationURL

        public abstract URL getOperationURL​(WFSOperationType operation,
                                            HttpMethod method)
        Returns the URL for the given operation name and HTTP protocol as stated in the WFS capabilities.
        operation - the name of the WFS operation
        method - the HTTP method
        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)
      • getSupportedCRSIdentifiers

        public abstract Set<String> 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.
        typeName - the featuretype name as declared in the FeatureType/Name element of the WFS capabilities
        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.

      • buildUrlGET

        public abstract URL buildUrlGET​(WFSRequest request)
      • getPostContentType

        public abstract String getPostContentType​(WFSRequest wfsRequest)
      • getWfsConfiguration

        public abstract Configuration getWfsConfiguration()
      • getFieldTypeMappings

        public abstract Map<QName,​Class<?>> getFieldTypeMappings()
        Provide additional field type mappings
        field type mappings
      • canLimit

        public boolean canLimit()
      • 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.
        true if the server supports setting an offset for the results, otherwise false