Class WFSContentDataAccess
- Object
-
- WFSContentDataAccess
-
- All Implemented Interfaces:
DataAccess<FeatureType,Feature>
public class WFSContentDataAccess extends Object implements DataAccess<FeatureType,Feature>
DataAccess for WFS with complex features.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 functionsetCacheLocation(File)
.- Author:
- Adam Brown (Curtin University of Technology) Inspired by code from WFSContentDataStore and ContentDataStore.
-
-
Field Summary
Fields Modifier and Type Field Description protected String
namespaceURI
namespace URL of the datastore itself, or default namespace
-
Constructor Summary
Constructors Constructor Description WFSContentDataAccess(WFSClient client)
The WFS capabilities document.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createSchema(FeatureType featureType)
Creates storage for a newfeatureType
.void
dispose()
Disposes of this data store and releases any resource that it is using.FeatureSource<FeatureType,Feature>
getFeatureSource(Name typeName)
Access to the named resource.ServiceInfo
getInfo()
Information about this service.List<Name>
getNames()
Populates the names map and returns a list of names.String
getNamespaceURI()
The namespace URL of the datastore.QName
getRemoteTypeName(Name localTypeName)
Look up a QName based on a given Name.FeatureType
getSchema(Name name)
Create the FeatureType based on a call to DescribeFeatureType.protected EmfComplexFeatureReader
getSchemaParser()
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 Detail
-
namespaceURI
protected String namespaceURI
namespace URL of the datastore itself, or default namespace
-
-
Constructor Detail
-
WFSContentDataAccess
public WFSContentDataAccess(WFSClient client)
The WFS capabilities document.
-
-
Method Detail
-
getNamespaceURI
public String getNamespaceURI()
The namespace URL of the datastore.- Returns:
- The namespace URL, may be
null
.
-
setNamespaceURI
public void setNamespaceURI(String namespaceURI)
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
public ServiceInfo 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
public void createSchema(FeatureType featureType) throws IOException
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
public void updateSchema(Name typeName, FeatureType featureType) throws IOException
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
public List<Name> getNames() throws IOException
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
public QName getRemoteTypeName(Name localTypeName) throws IOException
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
public FeatureType getSchema(Name name) throws IOException
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
public void setCacheLocation(File cacheLocation)
Sets the location of the cache folder to be used by app-schema-resolver.- Parameters:
cacheLocation
- the folder to use as the cache.
-
getFeatureSource
public FeatureSource<FeatureType,Feature> getFeatureSource(Name typeName) throws IOException
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
protected EmfComplexFeatureReader getSchemaParser()
Get the schema parser, creating it first if necessary.- Returns:
- the schema parser. Guaranteed non-null.
-
removeSchema
public void removeSchema(Name typeName) throws IOException
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
-
-