Interface DataStore
-
- All Superinterfaces:
DataAccess<SimpleFeatureType,SimpleFeature>
- All Known Subinterfaces:
FileDataStore
- All Known Implementing Classes:
ContentDataStore,CSVDataStore,DataStoreWrapper,DecoratingDataStore,DirectoryDataStore,ForwardingDataStore,GeoJSONDataStore,GeoparquetDataStore,GraticuleDataStore,JDBCDataStore,MBTilesDataStore,MemoryDataStore,MongoDataStore,OGRDataStore,OracleDatastoreWrapper,PostgisDatastoreWrapper,PreGeneralizedDataStore,PropertyDataStore,ShapefileDataStore,SingleFeatureSourceDataStore,SQLServerDatastoreWrapper,STACDataStore,VectorMosaicStore,VPFFileStore,VPFLibrary,WFSDataStore
public interface DataStore extends DataAccess<SimpleFeatureType,SimpleFeature>
This represents a physical source of feature data, such as a shapefiles or database, where the features will be instances ofSimpleFeature. It is derived from theDataAccessinterface (which works at the more generalFeaturelevel).- Author:
- Jody Garnett, Refractions Research
- See Also:
DataAccess,Feature,SimpleFeature
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FeatureReader<SimpleFeatureType,SimpleFeature>getFeatureReader(Query query, Transaction transaction)Gets aFeatureReaderfor features selected by the givenQuery.SimpleFeatureSourcegetFeatureSource(String typeName)Gets aSimpleFeatureSourcefor features of the specified type.SimpleFeatureSourcegetFeatureSource(Name typeName)Gets aSimpleFeatureSourcefor features of the type specified by a qualified name (namespace plus type name).FeatureWriter<SimpleFeatureType,SimpleFeature>getFeatureWriter(String typeName, Transaction transaction)Gets aFeatureWriterto modify features in thisDataStore.FeatureWriter<SimpleFeatureType,SimpleFeature>getFeatureWriter(String typeName, Filter filter, Transaction transaction)Gets aFeatureWriterto modify features in thisDataStore.FeatureWriter<SimpleFeatureType,SimpleFeature>getFeatureWriterAppend(String typeName, Transaction transaction)Gets aFeatureWriterthat can add new features to theDataStore.LockingManagergetLockingManager()Retrieve a per featureID based locking service from thisDataStore.SimpleFeatureTypegetSchema(String typeName)Gets the type information (schema) for the specified feature type.String[]getTypeNames()Gets the names of feature types available in thisDataStore.voidremoveSchema(String typeName)Used to permanently remove a schema from the underlying storagevoidupdateSchema(String typeName, SimpleFeatureType featureType)Applies a new schema to the given feature type.-
Methods inherited from interface DataAccess
createSchema, dispose, getInfo, getNames, getSchema, removeSchema, updateSchema
-
-
-
-
Method Detail
-
updateSchema
void updateSchema(String typeName, SimpleFeatureType featureType) throws IOException
Applies a new schema to the given feature type. This can be used to add or remove properties. The resulting update will be persistent.- Parameters:
typeName- name of the feature type to updatefeatureType- the new schema to apply- Throws:
IOException- on error
-
removeSchema
void removeSchema(String typeName) throws IOException
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.
- Throws:
IOException- if the operation failedUnsupportedOperation- if functionality is not available
-
getTypeNames
String[] getTypeNames() throws IOException
Gets the names of feature types available in thisDataStore. Please note that this is not guaranteed to return a list of unique names since the same unqualified name may be present in separate namespaces within theDataStore.- Returns:
- names of feature types available in this
DataStore - Throws:
IOException- if data access errors occur
-
getSchema
SimpleFeatureType getSchema(String typeName) throws IOException
Gets the type information (schema) for the specified feature type.- Parameters:
typeName- the feature type name- Returns:
- the requested feature type
- Throws:
IOException- iftypeNameis not available
-
getFeatureSource
SimpleFeatureSource getFeatureSource(String typeName) throws IOException
Gets aSimpleFeatureSourcefor features of the specified type.SimpleFeatureSourceprovides a high-level API for feature operations.The resulting
SimpleFeatureSourcemay implment more functionality as in this example:SimpleFeatureSource fsource = dataStore.getFeatureSource("roads"); if (fsource instanceof SimpleFeatureStore) { // we have write access to the feature data SimpleFeatureStore fstore = (SimpleFeatureStore) fs; } else { // System.out.println("We do not have write access to roads"); }- Parameters:
typeName- the feature type- Returns:
- a
SimpleFeatureSource(or possibly a subclass) providing operations for features of the specified type - Throws:
IOException- if data access errors occur- See Also:
SimpleFeatureSource,SimpleFeatureStore
-
getFeatureSource
SimpleFeatureSource getFeatureSource(Name typeName) throws IOException
Gets aSimpleFeatureSourcefor features of the type specified by a qualified name (namespace plus type name).- Specified by:
getFeatureSourcein interfaceDataAccess<SimpleFeatureType,SimpleFeature>- Parameters:
typeName- the qualified name of the feature type- Returns:
- a
SimpleFeatureSource(or possibly a subclass) providing operations for features of the specified type - Throws:
IOException- if data access errors occur- See Also:
getFeatureSource(String),SimpleFeatureSource,SimpleFeatureStore
-
getFeatureReader
FeatureReader<SimpleFeatureType,SimpleFeature> getFeatureReader(Query query, Transaction transaction) throws IOException
Gets aFeatureReaderfor features selected by the givenQuery.FeatureReaderprovies an iterator-style API to feature data.The
Queryprovides the schema for the form of the returned features as well as aFilterto constrain the features available via the reader.The
Transactioncan be used to externalize the state of theDataStore. Examples of this include aJDBCDataStoresharing a connection for use across severalFeatureReaderrequests; and aShapefileDataStoreredirecting requests to an alternate file during the course of aTransaction.- Parameters:
query- a query providing the schema and constraints for features that the reader will returntransaction- a transaction that this reader will operate against- Returns:
- an instance of
FeatureReader - Throws:
IOException- if data access errors occur
-
getFeatureWriter
FeatureWriter<SimpleFeatureType,SimpleFeature> getFeatureWriter(String typeName, Filter filter, Transaction transaction) throws IOException
Gets aFeatureWriterto modify features in thisDataStore.FeatureWriterprovides an iterator style API to features.The returned writer does not allow features to be added.
- Parameters:
typeName- the type name for features that will be accessiblefilter- defines additional constraints on the features that will be accessibletransaction- the transaction that the returned writer operates against- Returns:
- an instance of
FeatureWriter - Throws:
IOException- if data access errors occur- See Also:
getFeatureWriterAppend(String, Transaction)
-
getFeatureWriter
FeatureWriter<SimpleFeatureType,SimpleFeature> getFeatureWriter(String typeName, Transaction transaction) throws IOException
Gets aFeatureWriterto modify features in thisDataStore.FeatureWriterprovides an iterator style API to features.The returned writer does not allow features to be added.
- Parameters:
typeName- the type name for features that will be accessibletransaction- the transaction that the returned writer operates against- Returns:
- an instance of
FeatureWriter - Throws:
IOException- if data access errors occur- See Also:
getFeatureWriterAppend(String, Transaction)
-
getFeatureWriterAppend
FeatureWriter<SimpleFeatureType,SimpleFeature> getFeatureWriterAppend(String typeName, Transaction transaction) throws IOException
Gets aFeatureWriterthat can add new features to theDataStore.The
FeatureWriterwill returnfalsewhen itshasNext()method is called, butnext()can be used to acquire new features.- Parameters:
typeName- name of the feature type for which features will be addedtransaction- the transaction to operate against- Returns:
- an instance of
FeatureWriterthat can only be used to append new features - Throws:
IOException- if data access errors occur
-
getLockingManager
LockingManager getLockingManager()
Retrieve a per featureID based locking service from thisDataStore.- Returns:
- an instance of
LockingManager; ornullif locking is handled by theDataStorein a different fashion
-
-