|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.data.AbstractDataStoreFactory
org.geotools.data.wfs.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 org.geotools.data.DataAccessFactory |
---|
DataAccessFactory.Param |
Field Summary | |
---|---|
static WFSDataStoreFactory.WFSFactoryParam<java.lang.Integer> |
BUFFER_SIZE
Optional Integer parameter stating how many Feature instances to buffer at once. |
static WFSDataStoreFactory.WFSFactoryParam<java.lang.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<java.lang.Boolean> |
LENIENT
Optional Boolean DataStore parameter indicating whether to be lenient about parsing
bad data |
static WFSDataStoreFactory.WFSFactoryParam<java.lang.Integer> |
MAXFEATURES
Optional positive Integer used as a hard limit for the amount of Features to retrieve
for each FeatureType. |
static WFSDataStoreFactory.WFSFactoryParam<java.lang.String> |
PASSWORD
Optional String DataStore parameter supplying the password to use when the server
requires HTTP authentication |
protected java.util.Map<java.util.Map,WFSDataStore> |
perParameterSetDataStoreCache
|
static WFSDataStoreFactory.WFSFactoryParam<java.lang.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<java.lang.Integer> |
TIMEOUT
Optional Integer DataStore parameter indicating a timeout in milliseconds for the
HTTP connections. |
static WFSDataStoreFactory.WFSFactoryParam<java.lang.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<java.net.URL> |
URL
Mandatory DataStore parameter indicating the URL for the WFS GetCapabilities document. |
static WFSDataStoreFactory.WFSFactoryParam<java.lang.String> |
USERNAME
Optional String DataStore parameter supplying the user name to use when the server
requires HTTP authentication |
Constructor Summary | |
---|---|
WFSDataStoreFactory()
|
Method Summary | |
---|---|
boolean |
canProcess(java.util.Map params)
Checks whether params contains a valid set of parameters to connecto to a WFS. |
WFSDataStore |
createDataStore(java.util.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 java.net.URL |
createGetCapabilitiesRequest(java.net.URL host)
Creates a HTTP GET Method based WFS GetCapabilities request. |
static java.net.URL |
createGetCapabilitiesRequest(java.net.URL host,
Version version)
Creates a HTTP GET Method based WFS GetCapabilities request for the given protocol
version. |
DataStore |
createNewDataStore(java.util.Map params)
Unsupported operation, can't create a WFS service. |
java.lang.String |
getDescription()
Describe the nature of the datasource constructed by this factory. |
java.lang.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. |
Methods inherited from class org.geotools.data.AbstractDataStoreFactory |
---|
getImplementationHints, getParameters |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final WFSDataStoreFactory.WFSFactoryParam<java.net.URL> URL
public static final WFSDataStoreFactory.WFSFactoryParam<java.lang.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.
Boolean.FALSE
use HTTP GET preferably.
public static final WFSDataStoreFactory.WFSFactoryParam<java.lang.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<java.lang.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<java.lang.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<java.lang.Integer> TIMEOUT
Integer
DataStore parameter indicating a timeout in milliseconds for the
HTTP connections.
public static final WFSDataStoreFactory.WFSFactoryParam<java.lang.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<java.lang.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<java.lang.Boolean> LENIENT
Boolean
DataStore parameter indicating whether to be lenient about parsing
bad data
public static final WFSDataStoreFactory.WFSFactoryParam<java.lang.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.
protected java.util.Map<java.util.Map,WFSDataStore> perParameterSetDataStoreCache
Constructor Detail |
---|
public WFSDataStoreFactory()
Method Detail |
---|
public WFSDataStore createDataStore(java.util.Map params) throws java.io.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
java.io.IOException
- if there were any problems setting up (creating or
connecting) the datasource.DataStoreFactorySpi.createDataStore(java.util.Map)
public DataStore createNewDataStore(java.util.Map params) throws java.io.IOException
java.lang.UnsupportedOperationException
- always, as this operation is not applicable to WFS.
java.io.IOException
DataStoreFactorySpi.createNewDataStore(java.util.Map)
public java.lang.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
public boolean canProcess(java.util.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 java.lang.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 java.net.URL createGetCapabilitiesRequest(java.net.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 java.net.URL createGetCapabilitiesRequest(java.net.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 |