org.geotools.data.wfs.v1_1_0
Class DefaultWFSStrategy

java.lang.Object
  extended by org.geotools.data.wfs.v1_1_0.DefaultWFSStrategy
All Implemented Interfaces:
WFSStrategy
Direct Known Subclasses:
CubeWerxStrategy, GeoServerStrategy, IonicStrategy

public class DefaultWFSStrategy
extends java.lang.Object
implements WFSStrategy

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

Since:
2.6
Version:
$Id: DefaultWFSStrategy.java 32043 2008-12-19 03:23:35Z jdeolive $
Author:
Gabriel Roldan (OpenGeo)

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.geotools.data.wfs.v1_1_0.WFSStrategy
WFSStrategy.RequestComponents
 
Field Summary
protected static java.lang.String DEFAULT_OUTPUT_FORMAT
           
 
Constructor Summary
DefaultWFSStrategy()
           
 
Method Summary
protected  java.util.Map<java.lang.String,java.lang.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  java.lang.String encodeGetFeatureGetFilter(org.opengis.filter.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.
 java.lang.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.
 org.opengis.filter.Filter[] splitFilters(Capabilities caps, org.opengis.filter.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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_OUTPUT_FORMAT

protected static final java.lang.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 java.lang.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 java.io.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:
java.io.IOException
See Also:
WFSStrategy#createGetFeatureRequest(WFS_1_1_0_DataStore, WFSProtocol, Query, String)

buildGetFeatureParametersForGet

protected java.util.Map<java.lang.String,java.lang.String> buildGetFeatureParametersForGet(GetFeatureType request)
                                                                                    throws java.io.IOException
Throws:
java.io.IOException

encodeGetFeatureGetFilter

protected java.lang.String encodeGetFeatureGetFilter(org.opengis.filter.Filter filter)
                                              throws java.io.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:
java.io.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 org.opengis.filter.Filter[] splitFilters(Capabilities caps,
                                                org.opengis.filter.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-2010 Geotools. All Rights Reserved.