Class WFSContentDataAccess
- All Implemented Interfaces:
DataAccess<FeatureType,
Feature>
Using a schema parser with local storage. Could be set to a file location to avoid repeated downloads. To do this
use the parameter WFSDataAccessFactory.SCHEMA_CACHE_LOCATION
, or call the function
setCacheLocation(File)
.
- Author:
- Adam Brown (Curtin University of Technology) Inspired by code from WFSContentDataStore and ContentDataStore.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
namespace URL of the datastore itself, or default namespace -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
createSchema
(FeatureType featureType) Creates storage for a newfeatureType
.void
dispose()
Disposes of this data store and releases any resource that it is using.getFeatureSource
(Name typeName) Access to the named resource.getInfo()
Information about this service.getNames()
Populates the names map and returns a list of names.The namespace URL of the datastore.getRemoteTypeName
(Name localTypeName) Look up a QName based on a given Name.Create the FeatureType based on a call to DescribeFeatureType.protected EmfComplexFeatureReader
Get the schema parser, creating it first if necessary.void
removeSchema
(Name typeName) Used to permanently remove a schema from the underlying storagevoid
setCacheLocation
(File cacheLocation) Sets the location of the cache folder to be used by app-schema-resolver.void
setNamespaceURI
(String namespaceURI) Sets the namespace URI of the datastore.void
updateSchema
(Name typeName, FeatureType featureType) Used to update a schema in place.
-
Field Details
-
namespaceURI
namespace URL of the datastore itself, or default namespace
-
-
Constructor Details
-
WFSContentDataAccess
The WFS capabilities document.
-
-
Method Details
-
getNamespaceURI
The namespace URL of the datastore.- Returns:
- The namespace URL, may be
null
.
-
setNamespaceURI
Sets the namespace URI of the datastore.This will be used to qualify the entries or types of the datastore.
- Parameters:
namespaceURI
- The namespace URI, may benull
.
-
getInfo
Description copied from interface:DataAccess
Information about this service.This method offers access to a summary of header or metadata information describing the service. Subclasses may return a specific ServiceInfo instance that has additional information (such as FilterCapabilities).
- Specified by:
getInfo
in interfaceDataAccess<FeatureType,
Feature> - Returns:
- SeviceInfo
-
createSchema
Description copied from interface:DataAccess
Creates storage for a newfeatureType
.The provided
featureType
we be accessable by the typeName provided by featureType.getTypeName().- Specified by:
createSchema
in interfaceDataAccess<FeatureType,
Feature> - Parameters:
featureType
- FetureType to add to DataStore- Throws:
IOException
- If featureType cannot be created
-
updateSchema
Description copied from interface:DataAccess
Used to update a schema in place.This functionality is similar to an "alter table" statement in SQL. Implementation is optional; it may not be supported by all servers or files.
- Specified by:
updateSchema
in interfaceDataAccess<FeatureType,
Feature> - Throws:
IOException
- if the operation failed
-
getNames
Populates the names map and returns a list of names.- Specified by:
getNames
in interfaceDataAccess<FeatureType,
Feature> - Returns:
- Names of the available contents.
- Throws:
IOException
-
getRemoteTypeName
Look up a QName based on a given Name.- Parameters:
localTypeName
- The local type name whose QName equivalent you'd like.- Returns:
- The QName that corresponds to the Name you passed in.
- Throws:
IOException
-
getSchema
Create the FeatureType based on a call to DescribeFeatureType. Using gt-complex to parse the xsd-document, and use the schema cache.- Specified by:
getSchema
in interfaceDataAccess<FeatureType,
Feature> - Parameters:
name
- Type name a the resource from getNames()- Returns:
- Description of the FeatureType being made avaialble
- Throws:
IOException
-
setCacheLocation
Sets the location of the cache folder to be used by app-schema-resolver.- Parameters:
cacheLocation
- the folder to use as the cache.
-
getFeatureSource
Description copied from interface:DataAccess
Access to the named resource.The level of access is represented by the instance of the FeatureSource being returned.
Formally:
- FeatureSource - read-only access
- FeatureStore - read-write access
- FetureLocking - concurrency control
-
Additional interfaces may be supported by the implementation you are using.
- Specified by:
getFeatureSource
in interfaceDataAccess<FeatureType,
Feature> - Returns:
- Access to the named resource being made available
- Throws:
IOException
-
dispose
public void dispose()Description copied from interface:DataAccess
Disposes of this data store and releases any resource that it is using.A
DataStore
cannot be used afterdispose
has been called, neither can any data access object it helped create, such asFeatureReader
,FeatureSource
orFeatureCollection
.This operation can be called more than once without side effects.
There is no thread safety assurance associated with this method. For example, client code will have to make sure this method is not called while retrieving/saving data from/to the storage, or be prepared for the consequences.
- Specified by:
dispose
in interfaceDataAccess<FeatureType,
Feature>
-
getSchemaParser
Get the schema parser, creating it first if necessary.- Returns:
- the schema parser. Guaranteed non-null.
-
removeSchema
Description copied from interface:DataAccess
Used to permanently remove a schema from the underlying storageThis functionality is similar to an "drop table" statement in SQL. Implementation is optional; it may not be supported by all servers or files.
- Specified by:
removeSchema
in interfaceDataAccess<FeatureType,
Feature> - Throws:
IOException
- if the operation failed
-