org.geotools.data.wfs.v1_1_0
Class DefaultWFSStrategy

Object
  extended by DefaultWFSStrategy
All Implemented Interfaces:
WFSStrategy
Direct Known Subclasses:
CubeWerxStrategy, GeoServerStrategy, IonicStrategy

public class DefaultWFSStrategy
extends Object
implements WFSStrategy

A default strategy for a WFS 1.1.0 implementation that assumes the server sticks to the standard.

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

Nested Class Summary
 
Nested classes/interfaces inherited from interface WFSStrategy
WFSStrategy.RequestComponents
 
Field Summary
protected static String DEFAULT_OUTPUT_FORMAT
           
 
Constructor Summary
DefaultWFSStrategy()
           
 
Method Summary
protected  Map<String,String> buildGetFeatureParametersForGet(GetFeatureType request)
           
 WFSStrategy.RequestComponents createGetFeatureRequest(WFSProtocol wfs, GetFeature query)
          Creates the mapping GetFeature request for the given Query and outputFormat, and post-processing filter based on the server's stated filter capabilities.
protected  String encodeGetFeatureGetFilter(Filter filter)
          Returns a single-line string containing the xml representation of the given filter, as appropriate for the FILTER parameter in a GetFeature request.
 String getDefaultOutputFormat(WFSProtocol wfs, WFSOperationType operation)
          Returns the protocol default output format name for the WFS version the implementation talks.
protected  Configuration getFilterConfiguration()
           
 Configuration getWfsConfiguration()
          Returns an xml configuration suitable to parse/encode wfs documents appropriate for the server.
 Filter[] splitFilters(Capabilities caps, Filter queryFilter)
          Splits the filter provided by the geotools query into the server supported and unsupported ones.
 boolean supportsGet()
          A simple means to specify whether GET requests are supported between the server and the client.
 boolean supportsPost()
          A simple means to specify whether POST requests are supported between the server and the client.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_OUTPUT_FORMAT

protected static final String DEFAULT_OUTPUT_FORMAT
See Also:
Constant Field Values
Constructor Detail

DefaultWFSStrategy

public DefaultWFSStrategy()
Method Detail

supportsGet

public boolean supportsGet()
Description copied from interface: WFSStrategy
A simple means to specify whether GET requests are supported between the server and the client. Regardless of the server supporting the method or not there might be other sort of inconvenients (technical?) that prevents us from using a given method at all, but generally this should just return true

Specified by:
supportsGet in interface WFSStrategy
Returns:
whether we can send GET requests to the server
See Also:
WFSStrategy.supportsGet()

supportsPost

public boolean supportsPost()
Description copied from interface: WFSStrategy
A simple means to specify whether POST requests are supported between the server and the client. Regardless of the server supporting the method or not there might be other sort of inconvenients (technical?) that prevents us from using a given method at all, but generally this should just return true

Specified by:
supportsPost in interface WFSStrategy
Returns:
whether we can send POST requests to the server
See Also:
WFSStrategy.supportsPost()

getDefaultOutputFormat

public String getDefaultOutputFormat(WFSProtocol wfs,
                                     WFSOperationType operation)
Description copied from interface: WFSStrategy
Returns the protocol default output format name for the WFS version the implementation talks.

Specified by:
getDefaultOutputFormat in interface WFSStrategy
Returns:
"text/xml; subtype=gml/3.1.1"
See Also:
WFSProtocol#getDefaultOutputFormat()

createGetFeatureRequest

public WFSStrategy.RequestComponents createGetFeatureRequest(WFSProtocol wfs,
                                                             GetFeature query)
                                                      throws IOException
Creates the mapping GetFeature request for the given Query and outputFormat, and post-processing filter based on the server's stated filter capabilities.

Specified by:
createGetFeatureRequest in interface WFSStrategy
Parameters:
wfs - the WFS protocol handler from which the strategy may need to grab some feature type metadata not available through the datastore interface, or even perform some test request.
query - the GetFeature query to create the server request and post-processing filter for
Returns:
a handle to the request and post-processing filter appropriate to attend the given query
Throws:
IOException
See Also:
WFSStrategy#createGetFeatureRequest(WFS_1_1_0_DataStore, WFSProtocol, Query, String)

buildGetFeatureParametersForGet

protected Map<String,String> buildGetFeatureParametersForGet(GetFeatureType request)
                                                      throws IOException
Throws:
IOException

encodeGetFeatureGetFilter

protected String encodeGetFeatureGetFilter(Filter filter)
                                    throws IOException
Returns a single-line string containing the xml representation of the given filter, as appropriate for the FILTER parameter in a GetFeature request.

Throws:
IOException

getFilterConfiguration

protected Configuration getFilterConfiguration()

getWfsConfiguration

public Configuration getWfsConfiguration()
Description copied from interface: WFSStrategy
Returns an xml configuration suitable to parse/encode wfs documents appropriate for the server.

Note: most of the time it will just be WFSConfiguration, but it may be possible, for example, an strategy needs to override some bindings.

Specified by:
getWfsConfiguration in interface WFSStrategy
Returns:
a WFS xml Configuration
See Also:
WFSStrategy.getWfsConfiguration()

splitFilters

public Filter[] splitFilters(Capabilities caps,
                             Filter queryFilter)
Splits the filter provided by the geotools query into the server supported and unsupported ones.

Specified by:
splitFilters in interface WFSStrategy
Parameters:
caps - the server filter capabilities description
queryFilter -
Returns:
a two-element array where the first element is the supported filter and the second the one to post-process
See Also:
WFSStrategy#splitFilters(WFS_1_1_0_Protocol, Filter)


Copyright © 1996-2009 Geotools. All Rights Reserved.