public abstract class AbstractWFSStrategy extends WFSStrategy
WFSStrategy
implementations that leverage the GeoTools
xml-xsd
subsystem for schema assisted parsing and encoding of WFS requests and responses.
A conformant WFS client implementation based on this abstract class should only need to
implement the following methods from WFSStrategy
:
WFSStrategy.setCapabilities(org.geotools.data.wfs.internal.WFSGetCapabilities)
WFSStrategy.getFeatureTypeInfo(javax.xml.namespace.QName)
WFSStrategy.getServerSupportedOutputFormats(WFSOperationType operation)
WFSStrategy.getServerSupportedOutputFormats(QName typeName, WFSOperationType operation)
WFSStrategy.getClientSupportedOutputFormats(WFSOperationType operation)
WFSStrategy.getFeatureTypeNames()
WFSStrategy.getFilterCapabilities()
WFSStrategy.getSupportedCRSIdentifiers(QName typeName)
#supports(ResultType resultType)
WFSStrategy.getServiceInfo()
getFilterConfiguration()
getWfsConfiguration()
getOperationName(org.geotools.data.wfs.internal.WFSOperationType)
createDescribeFeatureTypeRequestPost(org.geotools.data.wfs.internal.DescribeFeatureTypeRequest)
createGetFeatureRequestPost(org.geotools.data.wfs.internal.GetFeatureRequest)
createTransactionRequest(org.geotools.data.wfs.internal.TransactionRequest)
Additionaly, specific strategy objects may override any other method to work around specific service implementation oddities. To that end, the following methods might be of special interest:
Modifier and Type | Field and Description |
---|---|
protected WFSConfig |
config |
static Configuration |
FILTER_1_0_CONFIGURATION |
static Configuration |
FILTER_1_1_CONFIGURATION |
static Configuration |
FILTER_2_0_CONFIGURATION |
protected static Logger |
LOGGER |
static Configuration |
WFS_1_0_CAPABILITIES_CONFIGURATION |
static Configuration |
WFS_1_0_CONFIGURATION |
static Configuration |
WFS_1_1_CONFIGURATION |
static Configuration |
WFS_2_0_CONFIGURATION |
Constructor and Description |
---|
AbstractWFSStrategy() |
Modifier and Type | Method and Description |
---|---|
protected Map<String,String> |
buildDescribeFeatureTypeParametersForGET(DescribeFeatureTypeRequest request) |
protected Map<String,String> |
buildDescribeFeatureTypeParametersForGET(Map<String,String> kvp,
QName typeName) |
protected Map<String,String> |
buildDescribeStoredQueriesParametersForGET(DescribeStoredQueriesRequest request) |
protected Map<String,String> |
buildGetFeatureParametersForGET(GetFeatureRequest request) |
protected Map<String,String> |
buildListStoredQueriesParametersForGET(ListStoredQueriesRequest request) |
URL |
buildUrlGET(WFSRequest request) |
protected abstract EObject |
createDescribeFeatureTypeRequestPost(DescribeFeatureTypeRequest request)
Creates the EMF object to be encoded with the
WFS
configuration when a DescribeFeatureType POST request is to be made. |
protected abstract EObject |
createDescribeStoredQueriesRequestPost(DescribeStoredQueriesRequest request) |
GetCapabilitiesRequest |
createGetCapabilitiesRequest(URL server)
Factory method to create GetCapabilities Request
|
protected abstract EObject |
createGetFeatureRequestPost(GetFeatureRequest query)
Creates the EMF object to be encoded with the
WFS
configuration when a GetFeature POST request is to be made. |
protected abstract EObject |
createListStoredQueriesRequestPost(ListStoredQueriesRequest request) |
protected abstract EObject |
createTransactionRequest(TransactionRequest request)
Creates the EMF object to be encoded with the
WFS
configuration when a Transaction request is to be made. |
void |
dispose()
Allows to free any resource held.
|
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. |
protected String |
encodePropertyName(String propertyName) |
WFSConfig |
getConfig() |
String |
getDefaultOutputFormat(WFSOperationType operation) |
Map<QName,Class<?>> |
getFieldTypeMappings()
Provide additional field type mappings
|
protected abstract Configuration |
getFilterConfiguration()
Returns the xml configuration used to encode a filter at
encodeGetFeatureGetFilter(Filter) |
protected abstract QName |
getOperationName(WFSOperationType operation)
Used by
getPostContents(WFSRequest) to get the qualified operation name to encode;
different WFS versions may use different operation names (specially namespaces). |
protected abstract String |
getOperationURI(WFSOperationType operation,
HttpMethod method) |
URL |
getOperationURL(WFSOperationType operation,
HttpMethod method)
Returns the URL for the given operation name and HTTP protocol as stated in the WFS
capabilities.
|
InputStream |
getPostContents(WFSRequest request)
Returns the input stream with the POST body contents for the given request.
|
String |
getPostContentType(WFSRequest wfsRequest) |
protected String |
getPrefixedTypeName(QName qname) |
abstract Version |
getServiceVersion()
Returns the WFS protocol version this facade talks to the WFS instance.
|
String |
getVersion()
Expected version attribute for root element.
|
abstract Configuration |
getWfsConfiguration()
Returns the xml configuration used to encode all POST requests.
|
protected Encoder |
prepareEncoder(WFSRequest request) |
void |
setConfig(WFSConfig config) |
protected Filter |
simplify(Filter filter) |
Filter[] |
splitFilters(QName typeName,
Filter filter)
Splits the filter provided by the geotools query into the server supported and unsupported
ones.
|
boolean |
supportsOperation(WFSOperationType operation,
HttpMethod method)
Returns whether the service supports the given operation for the given HTTP method.
|
canLimit, getClientSupportedOutputFormats, getFeatureTypeInfo, getFeatureTypeNames, getFilterCapabilities, getServerSupportedOutputFormats, getServerSupportedOutputFormats, getServiceInfo, getSupportedCRSIdentifiers, newRequestHandle, setCapabilities, supports, supportsTransaction
protected static final Logger LOGGER
public static final Configuration FILTER_1_0_CONFIGURATION
public static final Configuration WFS_1_0_CAPABILITIES_CONFIGURATION
public static final Configuration WFS_1_0_CONFIGURATION
public static final Configuration FILTER_1_1_CONFIGURATION
public static final Configuration WFS_1_1_CONFIGURATION
public static final Configuration FILTER_2_0_CONFIGURATION
public static final Configuration WFS_2_0_CONFIGURATION
protected WFSConfig config
protected abstract QName getOperationName(WFSOperationType operation)
getPostContents(WFSRequest)
to get the qualified operation name to encode;
different WFS versions may use different operation names (specially namespaces).protected abstract EObject createDescribeFeatureTypeRequestPost(DescribeFeatureTypeRequest request)
WFS
configuration
when a DescribeFeatureType POST request is to be made.protected abstract EObject createGetFeatureRequestPost(GetFeatureRequest query) throws IOException
WFS
configuration
when a GetFeature POST request is to be made.IOException
protected abstract EObject createTransactionRequest(TransactionRequest request) throws IOException
WFS
configuration
when a Transaction request is to be made.IOException
protected abstract EObject createListStoredQueriesRequestPost(ListStoredQueriesRequest request) throws IOException
IOException
protected abstract EObject createDescribeStoredQueriesRequestPost(DescribeStoredQueriesRequest request) throws IOException
IOException
protected abstract Configuration getFilterConfiguration()
encodeGetFeatureGetFilter(Filter)
public abstract Configuration getWfsConfiguration()
getWfsConfiguration
in class WFSStrategy
getPostContents(WFSRequest)
public String getVersion()
Specification
getVersion
in class Specification
public GetCapabilitiesRequest createGetCapabilitiesRequest(URL server)
createGetCapabilitiesRequest
in class Specification
server
- the URL that points to the server's getCapabilities documentpublic void setConfig(WFSConfig config)
setConfig
in class WFSStrategy
public WFSConfig getConfig()
getConfig
in class WFSStrategy
protected Map<String,String> buildGetFeatureParametersForGET(GetFeatureRequest request)
protected String encodeGetFeatureGetFilter(Filter filter) throws IOException
FILTER
parameter in a GetFeature request.IOException
public abstract Version getServiceVersion()
WFSStrategy
getServiceVersion
in class WFSStrategy
WFSStrategy.getServiceVersion()
public boolean supportsOperation(WFSOperationType operation, HttpMethod method)
WFSStrategy
supportsOperation
in class WFSStrategy
operation
- the operation to check if the server supportsmethod
- the HTTP method to check if the server supports for the given operationtrue
if the operation/method is supported as stated in the WFS capabilitiesWFSStrategy.supportsOperation(org.geotools.data.wfs.internal.WFSOperationType, org.geotools.data.wfs.internal.HttpMethod)
public URL getOperationURL(WFSOperationType operation, HttpMethod method)
WFSStrategy
getOperationURL
in class WFSStrategy
operation
- the name of the WFS operationmethod
- the HTTP methodnull
if the
capabilities does not declare an access point for the operation/method combinationWFSStrategy.getOperationURL(org.geotools.data.wfs.internal.WFSOperationType, org.geotools.data.wfs.internal.HttpMethod)
protected abstract String getOperationURI(WFSOperationType operation, HttpMethod method)
public String getDefaultOutputFormat(WFSOperationType operation)
getDefaultOutputFormat
in class WFSStrategy
public void dispose()
WFSStrategy
Successive calls to this method should not result in any exception, but the instance is meant to not be usable after the first invocation.
dispose
in class WFSStrategy
WFSStrategy.dispose()
protected Map<String,String> buildDescribeFeatureTypeParametersForGET(DescribeFeatureTypeRequest request)
protected Map<String,String> buildDescribeFeatureTypeParametersForGET(Map<String,String> kvp, QName typeName)
protected Map<String,String> buildDescribeStoredQueriesParametersForGET(DescribeStoredQueriesRequest request)
protected Map<String,String> buildListStoredQueriesParametersForGET(ListStoredQueriesRequest request)
protected Encoder prepareEncoder(WFSRequest request)
public Filter[] splitFilters(QName typeName, Filter filter)
splitFilters
in class WFSStrategy
org.geotools.data.wfs.internal.WFSStrategy#splitFilters(org.opengis.filter.Filter)
public URL buildUrlGET(WFSRequest request)
buildUrlGET
in class WFSStrategy
public String getPostContentType(WFSRequest wfsRequest)
getPostContentType
in class WFSStrategy
public InputStream getPostContents(WFSRequest request) throws IOException
getPostContents
in class WFSStrategy
IOException
createDescribeFeatureTypeRequestPost(org.geotools.data.wfs.internal.DescribeFeatureTypeRequest)
,
createGetFeatureRequestPost(org.geotools.data.wfs.internal.GetFeatureRequest)
,
prepareEncoder(org.geotools.data.wfs.internal.WFSRequest)
,
getOperationName(org.geotools.data.wfs.internal.WFSOperationType)
public Map<QName,Class<?>> getFieldTypeMappings()
WFSStrategy
getFieldTypeMappings
in class WFSStrategy
Copyright © 1996–2023 Geotools. All rights reserved.