public class WFSDataStoreFactory extends WFSDataAccessFactory implements DataStoreFactorySpi
DataStoreFactorySpi to connect to a Web Feature Service.
Produces a WFSDataStore if the correct set of connection parameters are provided. For
instance, the only mandatory one is WFSDataAccessFactory.URL.
As with all the DataStoreFactorySpi implementations, this one is not intended to be used
directly but through the DataStoreFinder mechanism, hence client applications 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.
WFSDataStore,
WFSClientWFSDataAccessFactory.WFSFactoryParam<T>DataAccessFactory.ParamAXIS_ORDER, AXIS_ORDER_COMPLIANT, AXIS_ORDER_EAST_NORTH, AXIS_ORDER_FILTER, AXIS_ORDER_NORTH_EAST, BUFFER_SIZE, ENCODING, ENTITY_RESOLVER, FILTER_COMPLIANCE, GML_COMPATIBLE_TYPENAMES, GML_COMPLIANCE_LEVEL, LENIENT, MAXFEATURES, NAMESPACE, OUTPUTFORMAT, PASSWORD, PROTOCOL, TIMEOUT, TRY_GZIP, URL, USE_HTTP_CONNECTION_POOLING, USEDEFAULTSRS, USERNAME, WFS_STRATEGY| Constructor and Description |
|---|
WFSDataStoreFactory() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canProcess(Map params)
Checks whether
params contains a valid set of parameters to connecto to a WFS. |
WFSDataStore |
createDataStore(Map<String,Serializable> 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<String,Serializable> params) |
String |
getDescription()
Describe the nature of the datasource constructed by this factory.
|
String |
getDisplayName()
Name suitable for display to end user.
|
HTTPClient |
getHttpClient(Map<String,Serializable> params)
Creates the HttpClient instance used to connect to the WFS service, compatible with the given
parameters.
|
boolean |
isAvailable()
Defaults to true, only a few datastores need to check for drivers.
|
canProcess, getImplementationHints, getParametersInfo, getWFSClientclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetParametersInfogetImplementationHintspublic WFSDataStore createDataStore(Map<String,Serializable> 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(java.net.URL, org.geotools.util.Version) first.
createDataStore in interface DataAccessFactorycreateDataStore in interface DataStoreFactorySpicreateDataStore in class WFSDataAccessFactoryparams - 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, mysqlIOException - if there were any problems setting up (creating or connecting) the
datasource.DataStoreFactorySpi.createDataStore(java.util.Map)public HTTPClient getHttpClient(Map<String,Serializable> params) throws IOException
params - wfs service connection parametersIOExceptionpublic DataStore createNewDataStore(Map<String,Serializable> params) throws IOException
createNewDataStore in interface DataStoreFactorySpiIOExceptionpublic String getDisplayName()
DataAccessFactoryA non localized display name for this data store type.
getDisplayName in interface DataAccessFactorygetDisplayName in class WFSDataAccessFactorypublic String getDescription()
DataAccessFactoryA non localized description of this data store type.
getDescription in interface DataAccessFactorygetDescription in class WFSDataAccessFactorypublic boolean canProcess(Map params)
params contains a valid set of parameters to connecto to a WFS.
Rules are:
WFSDataAccessFactory.URL is provided.
WFSDataAccessFactory.USERNAME and WFSDataAccessFactory.PASSWORD are provided, or none.
canProcess in interface DataAccessFactorycanProcess in class WFSDataAccessFactoryparams - The full set of information needed to construct a live data source.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.public boolean isAvailable()
isAvailable in interface DataAccessFactoryisAvailable in class WFSDataAccessFactorytrueCopyright © 1996–2019 Geotools. All rights reserved.