| java.lang.Object org.geotools.data.AbstractDataStore
All known Subclasses: org.geotools.data.feature.memory.MemoryDataAccess, org.geotools.data.memory.MemoryDataStore, org.geotools.arcsde.data.ArcSDEDataStore, org.geotools.data.tiger.TigerDataStore, org.geotools.data.ogr.OGRDataStore, org.geotools.data.mif.MIFDataStore, org.geotools.data.vpf.file.VPFFileStore, org.geotools.data.vpf.VPFLibrary, org.geotools.data.AbstractFileDataStore, org.geotools.data.wfs.WFSDataStore, org.geotools.data.collection.CollectionDataStore, org.geotools.data.gml.FileGMLDataStore, org.geotools.caching.impl.AbstractDataCache, org.geotools.caching.impl.InMemoryDataCache, org.geotools.data.property.PropertyDataStore,
AbstractDataStore | abstract public class AbstractDataStore implements DataStore(Code) | | Represents a stating point for implementing your own DataStore.
The goal is to have this class provide everything else if you can
only provide:
-
String[] getFeatureTypes()
-
FeatureType getSchema(String typeName)
-
FeatureReader getFeatureReader( typeName )
-
FeatureWriter getFeatureWriter( typeName )
and optionally this protected methods to allow custom query optimizations:
-
Filter getUnsupportedFilter(String typeName, Filter filter)
-
FeatureReader getFeatureReader(String typeName, Query query)
All remaining functionality is implemented against these methods, including
Transaction and Locking Support. These implementations will not be optimal
but they will work.
Pleae note that there may be a better place for you to start out from, (like
JDBCDataStore).
author: jgarnett |
Constructor Summary | |
public | AbstractDataStore() | public | AbstractDataStore(boolean isWriteable) AbstractDataStore creation.
Parameters: isWriteable - true for writeable DataStore. |
Method Summary | |
protected FeatureWriter | createFeatureWriter(String typeName, Transaction transaction) Subclass should implement this to provide writing support.
A feature writer writes to the resource so it should considered to always be committing.
The transaction is passed in so that it can be known what FeatureListeners should be notified of the
changes. | protected InProcessLockingManager | createLockingManager() Currently returns an InProcessLockingManager. | protected Map | createMetadata(String typeName) Subclass override to provide access to metadata. | public void | createSchema(FeatureType featureType) Subclass should implement to provide writing support. | public void | dispose() Dummy implementation, it's a no-op. | protected Envelope | getBounds(Query query) Computes the bounds of the features for the specified feature type that
satisfy the query provided that there is a fast way to get that result.
Will return null if there is not fast way to compute the bounds. | protected int | getCount(Query query) Gets the number of the features that would be returned by this query for
the specified feature type.
If getBounds(Query) returns -1 due to expense consider
using getFeatures(Query).getCount() as a an alternative.
Parameters: query - Contains the Filter and MaxFeatures to find the bounds for. | abstract protected FeatureReader | getFeatureReader(String typeName) Subclass must implement. | public FeatureReader | getFeatureReader(Query query, Transaction transaction) | protected FeatureReader | getFeatureReader(String typeName, Query query) GR: this method is called from inside getFeatureReader(Query ,Transaction )
to allow subclasses return an optimized FeatureReader wich supports the
filter and attributes truncation specified in query
A subclass that supports the creation of such an optimized FeatureReader
shold override this method. | public FeatureSource | getFeatureSource(String typeName) Default implementation based on getFeatureReader and getFeatureWriter. | protected FeatureWriter | getFeatureWriter(String typeName) Subclass can implement this to provide writing support. | public FeatureWriter | getFeatureWriter(String typeName, Filter filter, Transaction transaction) | public FeatureWriter | getFeatureWriter(String typeName, Transaction transaction) | public FeatureWriter | getFeatureWriterAppend(String typeName, Transaction transaction) | public LockingManager | getLockingManager() Locking manager used for this DataStore. | abstract public FeatureType | getSchema(String typeName) | protected Set | getSupportedHints() If you are using the automated FeatureSource/Store/Locking creation, this method
allows for the specification of the supported hints. | abstract public String[] | getTypeNames() | protected Filter | getUnsupportedFilter(String typeName, Filter filter) GR: if a subclass supports filtering, it should override this method
to return the unsupported part of the passed filter, so a
FilteringFeatureReader will be constructed upon it. | public FeatureSource | getView(Query query) | TransactionStateDiff | state(Transaction transaction) | public void | updateSchema(String typeName, FeatureType featureType) |
LOGGER | final protected static Logger LOGGER(Code) | | The logger for the filter module.
|
isWriteable | final protected boolean isWriteable(Code) | | Flags AbstractDataStore to allow Modification.
GetFeatureSource will return a FeatureStore is this is true.
|
AbstractDataStore | public AbstractDataStore()(Code) | | Default (Writeable) DataStore
|
AbstractDataStore | public AbstractDataStore(boolean isWriteable)(Code) | | AbstractDataStore creation.
Parameters: isWriteable - true for writeable DataStore. |
createFeatureWriter | protected FeatureWriter createFeatureWriter(String typeName, Transaction transaction) throws IOException(Code) | | Subclass should implement this to provide writing support.
A feature writer writes to the resource so it should considered to always be committing.
The transaction is passed in so that it can be known what FeatureListeners should be notified of the
changes. If the Transaction is AUTOCOMMIT then all listeners should be notified. If not
all listeners that are NOT registered with that transaction should be notified.
Parameters: typeName - Parameters: transaction - a feature writer FeatureWriter over contents of typeName throws: IOException - throws: IOException - Subclass may throw IOException throws: UnsupportedOperationException - Subclass may implement |
createLockingManager | protected InProcessLockingManager createLockingManager()(Code) | | Currently returns an InProcessLockingManager.
Subclasses that implement real locking may override this method to
return null .
InProcessLockingManager or null. |
createMetadata | protected Map createMetadata(String typeName)(Code) | | Subclass override to provide access to metadata.
CreateTypeEntry uses this method to aquire metadata information,
if available.
|
dispose | public void dispose()(Code) | | Dummy implementation, it's a no-op. Subclasses holding to system resources must
override this method and release them.
|
getBounds | protected Envelope getBounds(Query query) throws IOException(Code) | | Computes the bounds of the features for the specified feature type that
satisfy the query provided that there is a fast way to get that result.
Will return null if there is not fast way to compute the bounds. Since
it's based on some kind of header/cached information, it's not guaranteed
to be real bound of the features
Parameters: query - the bounds, or null if too expensive throws: SchemaNotFoundException - throws: IOException - |
getCount | protected int getCount(Query query) throws IOException(Code) | | Gets the number of the features that would be returned by this query for
the specified feature type.
If getBounds(Query) returns -1 due to expense consider
using getFeatures(Query).getCount() as a an alternative.
Parameters: query - Contains the Filter and MaxFeatures to find the bounds for. The number of Features provided by the Query or -1 if count is too expensive to calculate or any errors or occur. throws: IOException - throws: IOException - if there are errors getting the count |
getFeatureReader | abstract protected FeatureReader getFeatureReader(String typeName) throws IOException(Code) | | Subclass must implement.
Parameters: typeName - FeatureReader over contents of typeName |
getFeatureReader | protected FeatureReader getFeatureReader(String typeName, Query query) throws IOException(Code) | | GR: this method is called from inside getFeatureReader(Query ,Transaction )
to allow subclasses return an optimized FeatureReader wich supports the
filter and attributes truncation specified in query
A subclass that supports the creation of such an optimized FeatureReader
shold override this method. Otherwise, it just returns
getFeatureReader(typeName)
|
getSupportedHints | protected Set getSupportedHints()(Code) | | If you are using the automated FeatureSource/Store/Locking creation, this method
allows for the specification of the supported hints.
|
getTypeNames | abstract public String[] getTypeNames() throws IOException(Code) | | Convience method for retriving all the names from the Catalog Entires
|
getUnsupportedFilter | protected Filter getUnsupportedFilter(String typeName, Filter filter)(Code) | | GR: if a subclass supports filtering, it should override this method
to return the unsupported part of the passed filter, so a
FilteringFeatureReader will be constructed upon it. Otherwise it will
just return the same filter.
If the complete filter is supported, the subclass must return Filter.INCLUDE
|
|
|