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 StringnamespaceURInamespace 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 voidcreateSchema(FeatureType featureType)Creates storage for a newfeatureType.voiddispose()Disposes of this data store and releases any resource that it is using.FeatureSource<FeatureType,Feature>getFeatureSource(Name typeName)Access to the named resource.ServiceInfogetInfo()Information about this service.List<Name>getNames()Populates the names map and returns a list of names.StringgetNamespaceURI()The namespace URL of the datastore.QNamegetRemoteTypeName(Name localTypeName)Look up a QName based on a given Name.FeatureTypegetSchema(Name name)Create the FeatureType based on a call to DescribeFeatureType.protected EmfComplexFeatureReadergetSchemaParser()Get the schema parser, creating it first if necessary.voidremoveSchema(Name typeName)Used to permanently remove a schema from the underlying storagevoidsetCacheLocation(File cacheLocation)Sets the location of the cache folder to be used by app-schema-resolver.voidsetNamespaceURI(String namespaceURI)Sets the namespace URI of the datastore.voidupdateSchema(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:DataAccessInformation 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:
getInfoin interfaceDataAccess<FeatureType,Feature>- Returns:
- SeviceInfo
-
createSchema
public void createSchema(FeatureType featureType) throws IOException
Description copied from interface:DataAccessCreates storage for a newfeatureType.The provided
featureTypewe be accessable by the typeName provided by featureType.getTypeName().- Specified by:
createSchemain 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:DataAccessUsed 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:
updateSchemain 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:
getNamesin 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:
getSchemain 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:DataAccessAccess 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:
getFeatureSourcein interfaceDataAccess<FeatureType,Feature>- Returns:
- Access to the named resource being made available
- Throws:
IOException
-
dispose
public void dispose()
Description copied from interface:DataAccessDisposes of this data store and releases any resource that it is using.A
DataStorecannot be used afterdisposehas been called, neither can any data access object it helped create, such asFeatureReader,FeatureSourceorFeatureCollection.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:
disposein 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:DataAccessUsed 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:
removeSchemain interfaceDataAccess<FeatureType,Feature>- Throws:
IOException- if the operation failed
-
-