|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.data.store.AbstractDataStore2
Represents a stating point for implementing your own DataStore.
The goal is to have this class provide everything else if you only need to provide:
All remaining functionality is implemented against these methods, including Transaction and Locking Support. These implementations will not be optimal but they will work.
To support custom query optimizations:Pleae note that there may be a better place for you to start out from, (like JDBCDataStore).
Field Summary | |
protected static java.util.logging.Logger |
LOGGER
The logger for the filter module. |
Constructor Summary | |
AbstractDataStore2()
Default (Writeable) DataStore |
Method Summary | |
protected java.util.List |
createContents()
Subclass must overrride to connet to contents. |
protected InProcessLockingManager |
createLockingManager()
Currently returns an InProcessLockingManager. |
void |
createSchema(FeatureType featureType)
Subclass should implement to provide for creation. |
java.util.List |
entries()
List of ActiveTypeEntry entries - one for each featureType provided by this Datastore |
org.geotools.data.store.ActiveTypeEntry |
entry(java.lang.String typeName)
|
FeatureReader |
getFeatureReader(Query query,
Transaction transaction)
Access a FeatureReader providing access to Feature information. |
FeatureSource |
getFeatureSource(java.lang.String typeName)
Aqure FeatureSource for indicated typeName. |
FeatureWriter |
getFeatureWriter(java.lang.String typeName,
Filter filter,
Transaction transaction)
Access FeatureWriter for modification of existing DataStore contents. |
FeatureWriter |
getFeatureWriter(java.lang.String typeName,
Transaction transaction)
TODO summary sentence for getFeatureWriter ... |
FeatureWriter |
getFeatureWriterAppend(java.lang.String typeName,
Transaction transaction)
FeatureWriter setup to add new content. |
LockingManager |
getLockingManager()
Locking manager used for this DataStore. |
FeatureType |
getSchema(java.lang.String typeName)
Retrive schema information for typeName |
java.lang.String[] |
getTypeNames()
Convience method for retriving all the names from the Catalog Entires |
FeatureSource |
getView(Query query)
Create a FeatureSource that represents your Query. |
void |
updateSchema(java.lang.String typeName,
FeatureType featureType)
Subclass should implement to provide modification support. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.util.logging.Logger LOGGER
Constructor Detail |
public AbstractDataStore2()
Method Detail |
protected InProcessLockingManager createLockingManager()
Subclasses that implement real locking may override this method to
return null
.
public java.util.List entries()
protected java.util.List createContents()
An implementation that has any doubt about its contents should aquire them during object creation (where an IOException can be thrown).
This method is lazyly called to create a List of ActiveTypeEntry for each FeatureCollection in this DataStore.
public java.lang.String[] getTypeNames()
getTypeNames
in interface DataStore
public org.geotools.data.store.ActiveTypeEntry entry(java.lang.String typeName)
public FeatureType getSchema(java.lang.String typeName) throws java.io.IOException
getSchema
in interface DataStore
typeName
- typeName of requested FeatureType
java.io.IOException
- If typeName cannot be foundpublic void createSchema(FeatureType featureType) throws java.io.IOException
createSchema
in interface DataStore
featureType
- Requested FeatureType
java.io.IOException
- Subclass may throw IOException
java.lang.UnsupportedOperationException
- Subclass may implementpublic void updateSchema(java.lang.String typeName, FeatureType featureType) throws java.io.IOException
updateSchema
in interface DataStore
typeName
-
java.io.IOException
public FeatureSource getView(Query query) throws java.io.IOException, SchemaException
If we can make this part of the public API, we can phase out FeatureResults. (and reduce the number of classes people need to know about).
getView
in interface DataStore
SchemaException
- If fetureType is not covered by existing schema
java.io.IOException
- If FeatureSource is not availablepublic FeatureSource getFeatureSource(java.lang.String typeName) throws java.io.IOException
Note this API is not sufficient; Namespace needs to be used as well.
getFeatureSource
in interface DataStore
typeName
-
java.io.IOException
public FeatureReader getFeatureReader(Query query, Transaction transaction) throws java.io.IOException
This implementation passes off responsibility to the following overrideable methods:
If you can handle some aspects of Query natively (say expressions or reprojection) override the following:
getFeatureReader
in interface DataStore
query
- Requested form of the returned Features and the filter used
to constraints the resultstransaction
- Transaction this query opperates against
java.io.IOException
public FeatureWriter getFeatureWriter(java.lang.String typeName, Filter filter, Transaction transaction) throws java.io.IOException
DataStore
To limit FeatureWriter to the FeatureTypes defined by this DataStore, typeName is used to indicate FeatureType. The resulting feature writer will allow modifications against the same FeatureType provided by getSchema( typeName )
The FeatureWriter will provide access to the existing contents of the FeatureType referenced by typeName. The provided filter will be used to skip over Features as required.
Notes For Implementing DataStore
The returned FeatureWriter does not support the addition of new
Features to FeatureType (it would need to police your modifications to
agree with filer
). As such it will return
false
for getNext() when it reaches the end of the Query
and NoSuchElementException when next() is called.
Helper classes for implementing a FeatureWriter (in order):
getFeatureWriter
in interface DataStore
typeName
- Indicates featureType to be modifiedfilter
- constraints used to limit the modificationtransaction
- Transaction this query opperates against
java.io.IOException
public FeatureWriter getFeatureWriter(java.lang.String typeName, Transaction transaction) throws java.io.IOException
getFeatureWriter
in interface DataStore
typeName
- transaction
-
java.io.IOException
DataStore.getFeatureWriter(java.lang.String, org.geotools.data.Transaction)
public FeatureWriter getFeatureWriterAppend(java.lang.String typeName, Transaction transaction) throws java.io.IOException
getFeatureWriterAppend
in interface DataStore
typeName
- transaction
-
java.io.IOException
DataStore.getFeatureWriterAppend(java.lang.String, org.geotools.data.Transaction)
public LockingManager getLockingManager()
By default AbstractDataStore makes use of InProcessLockingManager.
getLockingManager
in interface DataStore
DataStore.getLockingManager()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |