Class DecoratingDataStore
- All Implemented Interfaces:
Serializable,Wrapper,DataAccess<SimpleFeatureType,,SimpleFeature> DataStore,Wrapper
- Author:
- Andrea Aime
- See Also:
-
Field Summary
Fields inherited from class AbstractDecorator
delegate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateSchema(SimpleFeatureType featureType) Creates storage for a newfeatureType.voiddispose()Disposes of this data store and releases any resource that it is using.getFeatureReader(Query query, Transaction transaction) Gets aFeatureReaderfor features selected by the givenQuery.getFeatureSource(String typeName) Gets aSimpleFeatureSourcefor features of the specified type.getFeatureSource(Name typeName) Gets aSimpleFeatureSourcefor features of the type specified by a qualified name (namespace plus type name).getFeatureWriter(String typeName, Transaction transaction) Gets aFeatureWriterto modify features in thisDataStore.getFeatureWriter(String typeName, Filter filter, Transaction transaction) Gets aFeatureWriterto modify features in thisDataStore.getFeatureWriterAppend(String typeName, Transaction transaction) Gets aFeatureWriterthat can add new features to theDataStore.getInfo()Information about this service.Retrieve a per featureID based locking service from thisDataStore.getNames()Names of the available Resources.Gets the type information (schema) for the specified feature type.Description of the named resource.String[]Gets the names of feature types available in thisDataStore.voidremoveSchema(String typeName) Used to permanently remove a schema from the underlying storagevoidremoveSchema(Name typeName) Used to permanently remove a schema from the underlying storagevoidupdateSchema(String typeName, SimpleFeatureType featureType) Applies a new schema to the given feature type.voidupdateSchema(Name typeName, SimpleFeatureType featureType) Used to update a schema in place.Methods inherited from class AbstractDecorator
equals, hashCode, isWrapperFor, toString, unwrap
-
Constructor Details
-
DecoratingDataStore
-
-
Method Details
-
createSchema
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<SimpleFeatureType,SimpleFeature> - Parameters:
featureType- FetureType to add to DataStore- Throws:
IOException- If featureType cannot be created
-
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<SimpleFeatureType,SimpleFeature>
-
getFeatureReader
public FeatureReader<SimpleFeatureType,SimpleFeature> getFeatureReader(Query query, Transaction transaction) throws IOException Description copied from interface:DataStoreGets 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.- Specified by:
getFeatureReaderin interfaceDataStore- 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
-
getFeatureSource
Description copied from interface:DataStoreGets aSimpleFeatureSourcefor features of the type specified by a qualified name (namespace plus type name).- Specified by:
getFeatureSourcein interfaceDataAccess<SimpleFeatureType,SimpleFeature> - Specified by:
getFeatureSourcein interfaceDataStore- 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
Description copied from interface:DataStoreGets 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"); }- Specified by:
getFeatureSourcein interfaceDataStore- 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:
-
getFeatureWriter
public FeatureWriter<SimpleFeatureType,SimpleFeature> getFeatureWriter(String typeName, Filter filter, Transaction transaction) throws IOException Description copied from interface:DataStoreGets aFeatureWriterto modify features in thisDataStore.FeatureWriterprovides an iterator style API to features.The returned writer does not allow features to be added.
- Specified by:
getFeatureWriterin interfaceDataStore- 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:
-
getFeatureWriter
public FeatureWriter<SimpleFeatureType,SimpleFeature> getFeatureWriter(String typeName, Transaction transaction) throws IOException Description copied from interface:DataStoreGets aFeatureWriterto modify features in thisDataStore.FeatureWriterprovides an iterator style API to features.The returned writer does not allow features to be added.
- Specified by:
getFeatureWriterin interfaceDataStore- 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
public FeatureWriter<SimpleFeatureType,SimpleFeature> getFeatureWriterAppend(String typeName, Transaction transaction) throws IOException Description copied from interface:DataStoreGets aFeatureWriterthat can add new features to theDataStore.The
FeatureWriterwill returnfalsewhen itshasNext()method is called, butnext()can be used to acquire new features.- Specified by:
getFeatureWriterAppendin interfaceDataStore- 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
-
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<SimpleFeatureType,SimpleFeature> - Returns:
- SeviceInfo
-
getLockingManager
Description copied from interface:DataStoreRetrieve a per featureID based locking service from thisDataStore.- Specified by:
getLockingManagerin interfaceDataStore- Returns:
- an instance of
LockingManager; ornullif locking is handled by theDataStorein a different fashion
-
getNames
Description copied from interface:DataAccessNames of the available Resources.For additional information please see getInfo( Name ) and getSchema( Name ).
- Specified by:
getNamesin interfaceDataAccess<SimpleFeatureType,SimpleFeature> - Returns:
- Names of the available contents.
- Throws:
IOException
-
getSchema
Description copied from interface:DataAccessDescription of the named resource.The FeatureType returned describes the contents being published. For additional metadata please review getInfo( Name ).
- Specified by:
getSchemain interfaceDataAccess<SimpleFeatureType,SimpleFeature> - Parameters:
name- Type name a the resource from getNames()- Returns:
- Description of the FeatureType being made avaialble
- Throws:
IOException
-
getSchema
Description copied from interface:DataStoreGets the type information (schema) for the specified feature type.- Specified by:
getSchemain interfaceDataStore- Parameters:
typeName- the feature type name- Returns:
- the requested feature type
- Throws:
IOException- iftypeNameis not available
-
getTypeNames
Description copied from interface:DataStoreGets 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.- Specified by:
getTypeNamesin interfaceDataStore- Returns:
- names of feature types available in this
DataStore - Throws:
IOException- if data access errors occur
-
updateSchema
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<SimpleFeatureType,SimpleFeature> - Throws:
IOException- if the operation failed
-
updateSchema
Description copied from interface:DataStoreApplies a new schema to the given feature type. This can be used to add or remove properties. The resulting update will be persistent.- Specified by:
updateSchemain interfaceDataStore- Parameters:
typeName- name of the feature type to updatefeatureType- the new schema to apply- Throws:
IOException- on error
-
removeSchema
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<SimpleFeatureType,SimpleFeature> - Throws:
IOException- if the operation failed
-
removeSchema
Description copied from interface:DataStoreUsed 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 interfaceDataStore- Throws:
IOException- if the operation failed
-