|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectAbstractDataStoreFactory
WFSDataStoreFactory
public class WFSDataStoreFactory
A DataStoreFactorySpi
to connect to a Web Feature Service.
Produces a WFSDataStore
is the correct set of connection parameters are provided. For
instance, the only mandatory one is URL
.
As with all the DataStoreFactorySpi implementations, this one is not intended to be used directly
but through the DataStoreFinder
mechanism, so client application should not have strong
dependencies over this module.
Upon a valid URL to a WFS GetCapabilities document, this factory will perform version negotiation
between the server supported protocol versions and this plugin supported ones, and will return a
DataStore
capable of communicating with the server using the agreed WFS protocol version.
In the case the provided GetCapabilities URL explicitly contains a VERSION parameter and both the server and client support that version, that version will be used.
That said, for the time being, the current default version is 1.0.0
instead of 1.1.0
, since the former is the one that supports transactions. When further development provides
transaction support for the WFS 1.1.0 version, propper version negotiation capabilities will be
added.
Among feeding the wfs datastore with a WFSProtocol
that can handle the WFS version agreed
upong the server and this client, this factory will try to provide the datastore with a
WFSStrategy
appropriate for the WFS implementation, if that could be somehow guessed.
That is so the datastore itself nor the protocol need to worry about any implementation specific
limitation or deviation from the standard the actual server may have.
WFSDataStore
,
WFSProtocol
,
WFSStrategy
Nested Class Summary | |
---|---|
static class |
WFSDataStoreFactory.WFSFactoryParam<T>
A WFSDataStoreFactory.WFSFactoryParam subclass that allows to provide a default value to the lookUp method. |
Nested classes/interfaces inherited from interface DataAccessFactory |
---|
DataAccessFactory.Param |
Field Summary | |
---|---|
static WFSDataStoreFactory.WFSFactoryParam<String> |
AXIS_ORDER
Optional String DataStore parameter indicating axis order used by the
remote WFS server in result coordinates. |
static WFSDataStoreFactory.WFSFactoryParam<String> |
AXIS_ORDER_FILTER
|
static WFSDataStoreFactory.WFSFactoryParam<Integer> |
BUFFER_SIZE
Optional Integer parameter stating how many Feature instances to buffer at once. |
static WFSDataStoreFactory.WFSFactoryParam<String> |
ENCODING
Optional String DataStore parameter supplying a JVM supported charset
name to use as the character encoding for XML requests sent to the server. |
static WFSDataStoreFactory.WFSFactoryParam<Integer> |
FILTER_COMPLIANCE
Optional Integer DataStore parameter indicating level of compliance to WFS
specification
XMLHandlerHints.VALUE_FILTER_COMPLIANCE_LOW
XMLHandlerHints.VALUE_FILTER_COMPLIANCE_MEDIUM
XMLHandlerHints.VALUE_FILTER_COMPLIANCE_HIGH
|
static WFSDataStoreFactory.WFSFactoryParam<Boolean> |
LENIENT
Optional Boolean DataStore parameter indicating whether to be lenient about parsing
bad data |
static WFSDataStoreFactory.WFSFactoryParam<Integer> |
MAXFEATURES
Optional positive Integer used as a hard limit for the amount of Features to retrieve
for each FeatureType. |
static WFSDataStoreFactory.WFSFactoryParam<String> |
NAMESPACE
Optional String namespace URI to override the originial namespaces |
static WFSDataStoreFactory.WFSFactoryParam<String> |
OUTPUTFORMAT
|
static WFSDataStoreFactory.WFSFactoryParam<String> |
PASSWORD
Optional String DataStore parameter supplying the password to use when the server
requires HTTP authentication
Shall be used together with USERNAME or not used at all. |
static WFSDataStoreFactory.WFSFactoryParam<Boolean> |
PROTOCOL
Optional Boolean DataStore parameter acting as a hint for the HTTP protocol to use
preferably against the WFS instance, with the following semantics:
null (not supplied): use "AUTO", let the DataStore decide. |
static WFSDataStoreFactory.WFSFactoryParam<Integer> |
TIMEOUT
Optional Integer DataStore parameter indicating a timeout in milliseconds for the
HTTP connections. |
static WFSDataStoreFactory.WFSFactoryParam<Boolean> |
TRY_GZIP
Optional Boolean data store parameter indicating whether to set the accept GZip
encoding on the HTTP request headers sent to the server |
static WFSDataStoreFactory.WFSFactoryParam<URL> |
URL
Mandatory DataStore parameter indicating the URL for the WFS GetCapabilities document. |
static WFSDataStoreFactory.WFSFactoryParam<Boolean> |
USEDEFAULTSRS
Optional String Flag to disable usage of OtherSRS in requests and
always use DefaultSRS (eventually reprojecting locally the results) |
static WFSDataStoreFactory.WFSFactoryParam<String> |
USERNAME
Optional String DataStore parameter supplying the user name to use when the server
requires HTTP authentication
Shall be used together with PASSWORD or not used at all. |
static WFSDataStoreFactory.WFSFactoryParam<String> |
WFS_STRATEGY
Optional String DataStore parameter indicating either "mapserver", "geoserver",
"strict" or "nonstrict" strategy |
Constructor Summary | |
---|---|
WFSDataStoreFactory()
|
Method Summary | |
---|---|
boolean |
canProcess(Map params)
Checks whether params contains a valid set of parameters to connecto to a WFS. |
WFSDataStore |
createDataStore(Map params)
Requests the WFS Capabilities document from the url parameter
in params and returns a WFSDataStore according to the version of the
GetCapabilities document returned. |
static URL |
createGetCapabilitiesRequest(URL host)
Creates a HTTP GET Method based WFS GetCapabilities request. |
static URL |
createGetCapabilitiesRequest(URL host,
Version version)
Creates a HTTP GET Method based WFS GetCapabilities request for the given protocol
version. |
DataStore |
createNewDataStore(Map params)
Unsupported operation, can't create a WFS service. |
String |
getDescription()
Describe the nature of the datasource constructed by this factory. |
String |
getDisplayName()
Default Implementation abuses the naming convention. |
DataAccessFactory.Param[] |
getParametersInfo()
Returns the set of parameter descriptors needed to connect to a WFS. |
boolean |
isAvailable()
Defaults to true, only a few datastores need to check for drivers. |
void |
setHTTPClient(HTTPClient http)
|
Methods inherited from class AbstractDataStoreFactory |
---|
getImplementationHints, getParameters |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final WFSDataStoreFactory.WFSFactoryParam<URL> URL
public static final WFSDataStoreFactory.WFSFactoryParam<Boolean> PROTOCOL
Boolean
DataStore parameter acting as a hint for the HTTP protocol to use
preferably against the WFS instance, with the following semantics:
null
(not supplied): use "AUTO", let the DataStore decide.
Boolean.TRUE
use HTTP POST preferably.
public static final WFSDataStoreFactory.WFSFactoryParam<String> USERNAME
String
DataStore parameter supplying the user name to use when the server
requires HTTP authentication
Shall be used together with PASSWORD
or not used at all.
Authenticator
public static final WFSDataStoreFactory.WFSFactoryParam<String> PASSWORD
String
DataStore parameter supplying the password to use when the server
requires HTTP authentication
Shall be used together with USERNAME
or not used at all.
Authenticator
public static final WFSDataStoreFactory.WFSFactoryParam<String> ENCODING
String
DataStore parameter supplying a JVM supported charset
name to use as the character encoding for XML requests sent to the server.
public static final WFSDataStoreFactory.WFSFactoryParam<Integer> TIMEOUT
Integer
DataStore parameter indicating a timeout in milliseconds for the
HTTP connections.
<>p>
public static final WFSDataStoreFactory.WFSFactoryParam<Integer> BUFFER_SIZE
Integer
parameter stating how many Feature instances to buffer at once. Only
implemented for WFS 1.0.0 support.
public static final WFSDataStoreFactory.WFSFactoryParam<Boolean> TRY_GZIP
Boolean
data store parameter indicating whether to set the accept GZip
encoding on the HTTP request headers sent to the server
public static final WFSDataStoreFactory.WFSFactoryParam<Boolean> LENIENT
Boolean
DataStore parameter indicating whether to be lenient about parsing
bad data
public static final WFSDataStoreFactory.WFSFactoryParam<Integer> MAXFEATURES
Integer
used as a hard limit for the amount of Features to retrieve
for each FeatureType. A value of zero or not providing this parameter means no limit.
public static final WFSDataStoreFactory.WFSFactoryParam<Integer> FILTER_COMPLIANCE
Integer
DataStore parameter indicating level of compliance to WFS
specification
XMLHandlerHints.VALUE_FILTER_COMPLIANCE_LOW
XMLHandlerHints.VALUE_FILTER_COMPLIANCE_MEDIUM
XMLHandlerHints.VALUE_FILTER_COMPLIANCE_HIGH
public static final WFSDataStoreFactory.WFSFactoryParam<String> WFS_STRATEGY
String
DataStore parameter indicating either "mapserver", "geoserver",
"strict" or "nonstrict" strategy
public static final WFSDataStoreFactory.WFSFactoryParam<String> NAMESPACE
String
namespace URI to override the originial namespaces
public static final WFSDataStoreFactory.WFSFactoryParam<Boolean> USEDEFAULTSRS
String
Flag to disable usage of OtherSRS in requests and
always use DefaultSRS (eventually reprojecting locally the results)
public static final WFSDataStoreFactory.WFSFactoryParam<String> AXIS_ORDER
String
DataStore parameter indicating axis order used by the
remote WFS server in result coordinates.
public static final WFSDataStoreFactory.WFSFactoryParam<String> AXIS_ORDER_FILTER
public static final WFSDataStoreFactory.WFSFactoryParam<String> OUTPUTFORMAT
Constructor Detail |
---|
public WFSDataStoreFactory()
Method Detail |
---|
public WFSDataStore createDataStore(Map params) throws IOException
url
parameter
in params
and returns a WFSDataStore
according to the version of the
GetCapabilities document returned.
Note the URL
provided as parameter must refer to the actual GetCapabilities
request. If you need to specify a preferred version or want the GetCapabilities request to be
generated from a base URL build the URL with the
createGetCapabilitiesRequest(URL, Version)
first.
params
- The full set of information needed to construct a live
data store. Typical key values for the map include: url -
location of a resource, used by file reading datasources. dbtype
- the type of the database to connect to, e.g. postgis, mysql
IOException
- if there were any problems setting up (creating or
connecting) the datasource.DataStoreFactorySpi.createDataStore(java.util.Map)
public void setHTTPClient(HTTPClient http)
public DataStore createNewDataStore(Map params) throws IOException
UnsupportedOperationException
- always, as this operation is not applicable to WFS.
IOException
DataStoreFactorySpi.createNewDataStore(java.util.Map)
public String getDescription()
DataAccessFactory
A non localized description of this data store type.
DataAccessFactory.getDescription()
public DataAccessFactory.Param[] getParametersInfo()
DataAccessFactory.getParametersInfo()
,
URL
,
PROTOCOL
,
USERNAME
,
PASSWORD
,
TIMEOUT
,
BUFFER_SIZE
,
TRY_GZIP
,
LENIENT
,
ENCODING
,
USEDEFAULTSRS
public boolean canProcess(Map params)
params
contains a valid set of parameters to connecto to a WFS.
Rules are:
Availability of the other optional parameters is not checked for existence.
canProcess
in interface DataAccessFactory
canProcess
in class AbstractDataStoreFactory
params
- non null map of datastore parameters.
DataAccessFactory.canProcess(java.util.Map)
public String getDisplayName()
AbstractDataStoreFactory
Will return Foo
for
org.geotools.data.foo.FooFactory
.
getDisplayName
in interface DataAccessFactory
getDisplayName
in class AbstractDataStoreFactory
DataAccessFactory.getDisplayName()
public boolean isAvailable()
AbstractDataStoreFactory
isAvailable
in interface DataAccessFactory
isAvailable
in class AbstractDataStoreFactory
true
, no extra or external requisites for datastore availability.DataAccessFactory.isAvailable()
public static URL createGetCapabilitiesRequest(URL host, Version version)
GetCapabilities
request for the given protocol
version.
If the query string in the host
URL already contains a VERSION number, that version
is discarded.
host
- non null URL from which to construct the WFS GetCapabilities
request by
discarding the query string, if any, and appending the propper query string.
public static URL createGetCapabilitiesRequest(URL host)
GetCapabilities
request.
If the query string in the host
URL already contains a VERSION number, that version
is used, otherwise the queried version will be 1.0.0.
NOTE the default version will be 1.0.0 until the support for 1.1.0 gets stable enough for general use. If you want to use a 1.1.0 WFS you'll have to explicitly provide the VERSION=1.1.0 parameter in the GetCapabilities request meanwhile.
host
- non null URL pointing either to a base WFS service access point, or to a full
GetCapabilities
request.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |