Class PropertyDataStore
- Object
-
- ContentDataStore
-
- PropertyDataStore
-
- All Implemented Interfaces:
DataAccess<SimpleFeatureType,SimpleFeature>
,DataStore
public class PropertyDataStore extends ContentDataStore
Sample DataStore implementation, please see formal tutorial included with users docs.- Author:
- Jody Garnett, Refractions Research Inc., Torben Barsballe (Boundless)
-
-
Field Summary
Fields Modifier and Type Field Description protected File
dir
-
Fields inherited from class ContentDataStore
dataStoreFactory, entries, featureFactory, filterFactory, geometryFactory, JOINED_FEATURE_TYPE, lockingManager, LOGGER, namespaceURI, typeFactory, WRITER_ADD, WRITER_COMMIT, WRITER_UPDATE
-
-
Constructor Summary
Constructors Constructor Description PropertyDataStore(File dir)
PropertyDataStore(File dir, String namespaceURI)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ContentFeatureSource
createFeatureSource(ContentEntry entry)
Instantiates new feature source for the entry.void
createSchema(SimpleFeatureType featureType)
Creates a new schema in the datastore.protected List<Name>
createTypeNames()
Creates a set of qualified names corresponding to the types that the datastore provides.ServiceInfo
getInfo()
Information about this service.List<Name>
getNames()
Returns the same list of names thanContentDataStore.getTypeNames()
meaning the returned Names have no namespace set.void
removeSchema(String typeName)
Used to permanently remove a schema from the underlying storagevoid
removeSchema(Name typeName)
Used to permanently remove a schema from the underlying storagevoid
setNamespaceURI(String namespaceURI)
Sets the namespace uri of the datastore.-
Methods inherited from class ContentDataStore
createContentState, dispose, ensureEntry, ensureFeatureStore, entry, getDataStoreFactory, getEntry, getFeatureFactory, getFeatureReader, getFeatureSource, getFeatureSource, getFeatureSource, getFeatureSource, getFeatureTypeFactory, getFeatureWriter, getFeatureWriter, getFeatureWriterAppend, getFilterFactory, getGeometryFactory, getLockingManager, getLogger, getNamespaceURI, getSchema, getSchema, getTypeNames, name, removeEntry, setDataStoreFactory, setFeatureFactory, setFeatureTypeFactory, setFilterFactory, setGeometryFactory, updateSchema, updateSchema
-
-
-
-
Field Detail
-
dir
protected File dir
-
-
Method Detail
-
createSchema
public void createSchema(SimpleFeatureType featureType) throws IOException
Description copied from class:ContentDataStore
Creates a new schema in the datastore.This implementation throws a
UnsupportedOperationException
. Subclasses should override to support schema creation.- Specified by:
createSchema
in interfaceDataAccess<SimpleFeatureType,SimpleFeature>
- Overrides:
createSchema
in classContentDataStore
- Parameters:
featureType
- FetureType to add to DataStore- Throws:
IOException
- If featureType cannot be created- See Also:
DataAccess.createSchema(FeatureType)
-
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<SimpleFeatureType,SimpleFeature>
- Overrides:
getInfo
in classContentDataStore
- Returns:
- SeviceInfo
-
setNamespaceURI
public void setNamespaceURI(String namespaceURI)
Description copied from class:ContentDataStore
Sets the namespace uri of the datastore.This will be used to qualify the entries or types of the datastore.
- Overrides:
setNamespaceURI
in classContentDataStore
- Parameters:
namespaceURI
- The namespace uri, may benull
.
-
createTypeNames
protected List<Name> createTypeNames() throws IOException
Description copied from class:ContentDataStore
Creates a set of qualified names corresponding to the types that the datastore provides.Namespaces may be left
null
for data stores which do not support namespace qualified type names.- Specified by:
createTypeNames
in classContentDataStore
- Returns:
- A list of
Name
. - Throws:
IOException
- Any errors occuring connecting to data.
-
getNames
public List<Name> getNames() throws IOException
Description copied from class:ContentDataStore
Returns the same list of names thanContentDataStore.getTypeNames()
meaning the returned Names have no namespace set.- Specified by:
getNames
in interfaceDataAccess<SimpleFeatureType,SimpleFeature>
- Overrides:
getNames
in classContentDataStore
- Returns:
- Names of the available contents.
- Throws:
IOException
- See Also:
DataAccess.getNames()
-
createFeatureSource
protected ContentFeatureSource createFeatureSource(ContentEntry entry) throws IOException
Description copied from class:ContentDataStore
Instantiates new feature source for the entry.Subclasses should override this method to return a specific subclass of
ContentFeatureSource
.- Specified by:
createFeatureSource
in classContentDataStore
- Parameters:
entry
- The entry.- Returns:
- An new instance of
ContentFeatureSource
for the entry. - Throws:
IOException
-
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<SimpleFeatureType,SimpleFeature>
- Overrides:
removeSchema
in classContentDataStore
- Throws:
IOException
- if the operation failed- See Also:
DataAccess.removeSchema(Name)
-
removeSchema
public void removeSchema(String typeName) throws IOException
Description copied from interface:DataStore
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 interfaceDataStore
- Overrides:
removeSchema
in classContentDataStore
- Throws:
IOException
- if the operation failed- See Also:
DataStore.removeSchema(String)
-
-