public class PropertyFeatureStore extends ContentFeatureStore
FeatureLocking.Response
ORIGINAL_FEATURE_KEY, WRITER_ADD, WRITER_COMMIT, WRITER_UPDATE
entry, hints, lock, query, queryCapabilities, schema, transaction
Modifier and Type | Method and Description |
---|---|
protected void |
addHints(Set<Hints.Key> hints)
Subclass hook too add additional hints.
|
protected SimpleFeatureType |
buildFeatureType()
Creates the feature type or schema for the feature source.
|
protected QueryCapabilities |
buildQueryCapabilities()
Builds the query capabilities for this feature source.
|
protected boolean |
canEvent()
We handle events internally
|
protected ReferencedEnvelope |
getBoundsInternal(Query query)
Calculates the bounds of a specified query.
|
protected int |
getCountInternal(Query query)
Calculates the number of features of a specified query.
|
PropertyDataStore |
getDataStore()
The datastore that this feature source originated from.
|
ContentEntry |
getEntry()
The entry for the feature source.
|
ResourceInfo |
getInfo()
A default ResourceInfo with a generic description.
|
Name |
getName()
Returns the same name than the feature type (ie,
getSchema().getName() to honor the
simple feature land common practice of calling the same both the Features produces and their
types |
QueryCapabilities |
getQueryCapabilities()
SimpleFeatureCollection optimized for read-only access.
|
protected FeatureReader<SimpleFeatureType,SimpleFeature> |
getReaderInternal(Query query)
Subclass method for returning a native reader from the datastore.
|
ContentState |
getState()
The current state for the feature source.
|
Transaction |
getTransaction()
The current transaction the feature source is working against.
|
protected FeatureWriter<SimpleFeatureType,SimpleFeature> |
getWriterInternal(Query query,
int flags)
Subclass method for returning a native writer from the datastore.
|
protected boolean |
handleVisitor(Query query,
FeatureVisitor visitor)
Subclass method which allows subclasses to natively handle a visitor.
|
void |
setTransaction(Transaction transaction)
Sets the current transaction the feature source is working against.
|
addFeatures, addFeatures, getWriter, getWriter, getWriter, getWriter, modifyFeatures, modifyFeatures, modifyFeatures, modifyFeatures, modifyFeatures, modifyFeatures, removeFeatures, setFeatures
accepts, addFeatureListener, canFilter, canLimit, canLock, canOffset, canReproject, canRetype, canSort, canTransact, doLockInternal, doUnlockInternal, getAbsoluteSchema, getBounds, getBounds, getCount, getFeatures, getFeatures, getFeatures, getReader, getReader, getReader, getSchema, getSupportedHints, getView, getView, isView, joinQuery, lockFeatures, lockFeatures, lockFeatures, processLock, removeFeatureListener, resolvePropertyNames, resolvePropertyNames, setFeatureLock, unLockFeatures, unLockFeatures, unLockFeatures
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFeatures, getFeatures, getFeatures
lockFeatures, lockFeatures, lockFeatures, setFeatureLock, unLockFeatures, unLockFeatures, unLockFeatures
addFeatureListener, getBounds, getBounds, getCount, getSchema, getSupportedHints, removeFeatureListener
protected void addHints(Set<Hints.Key> hints)
ContentFeatureSource
By default, the followings are already present:
addHints
in class ContentFeatureSource
hints
- The set of hints supported by the feature source.protected boolean canEvent()
canEvent
in class ContentFeatureSource
protected QueryCapabilities buildQueryCapabilities()
ContentFeatureSource
buildQueryCapabilities
in class ContentFeatureSource
protected FeatureWriter<SimpleFeatureType,SimpleFeature> getWriterInternal(Query query, int flags) throws IOException
ContentFeatureStore
It is important to note that if the native writer intends to handle any of the following natively:
true
:
getWriterInternal
in class ContentFeatureStore
query
- Queryflags
- See ContentFeatureStore.WRITER_ADD
and ContentFeatureStore.WRITER_UPDATE
IOException
public void setTransaction(Transaction transaction)
ContentFeatureSource
transaction may be null
. This signifies that the auto-commit
transaction is used: Transaction.AUTO_COMMIT
.
setTransaction
in interface FeatureStore<SimpleFeatureType,SimpleFeature>
setTransaction
in class ContentFeatureSource
transaction
- The new transaction, or null
.protected ReferencedEnvelope getBoundsInternal(Query query) throws IOException
ContentFeatureSource
getBoundsInternal
in class ContentFeatureSource
IOException
protected int getCountInternal(Query query) throws IOException
ContentFeatureSource
getCountInternal
in class ContentFeatureSource
IOException
protected FeatureReader<SimpleFeatureType,SimpleFeature> getReaderInternal(Query query) throws IOException
ContentFeatureSource
It is important to note that if the native reader intends to handle any of the following natively:
true
:
ContentFeatureSource.canReproject()
- handles Query.getCoordinateSystemReproject()
internally.
Example would be PostGIS using Proj to handle reproejction internallyContentFeatureSource.canFilter()
- handles Query#getFilter() internally.getReaderInternal
in class ContentFeatureSource
IOException
protected SimpleFeatureType buildFeatureType() throws IOException
ContentFeatureSource
Implementations should use SimpleFeatureTypeBuilder
to build the feature type.
Also, the builder should be injected with the feature factory which has been set on the
DataStore (see ContentDataStore.getFeatureFactory()
. Example:
SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder(); b.setFeatureTypeFactory( getDataStore().getFeatureTypeFactory() ); //build the feature type ...
buildFeatureType
in class ContentFeatureSource
IOException
protected boolean handleVisitor(Query query, FeatureVisitor visitor) throws IOException
ContentFeatureSource
Subclasses would override this method and return true in cases where the specific visitor could be handled without iterating over the entire result set of query. An example would be handling visitors that calculate aggregate values.
handleVisitor
in class ContentFeatureSource
query
- The query being made.visitor
- The visitor toIOException
public PropertyDataStore getDataStore()
ContentFeatureSource
Subclasses may wish to extend this method in order to type narrow its return type.
getDataStore
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
getDataStore
in class ContentFeatureSource
FeatureSource
public ContentEntry getEntry()
ContentFeatureSource
getEntry
in class ContentFeatureSource
public Transaction getTransaction()
ContentFeatureSource
This transaction is used to derive the state for the feature source. A null
value for a transaction represents the auto commit transaction: Transaction.AUTO_COMMIT
.
getTransaction
in interface FeatureStore<SimpleFeatureType,SimpleFeature>
getTransaction
in class ContentFeatureSource
#getState()}.
public ContentState getState()
ContentFeatureSource
This value is derived from current transaction of the feature source.
getState
in class ContentFeatureSource
#setTransaction(Transaction)}.
public ResourceInfo getInfo()
ContentFeatureSource
Subclasses should override to provide an explicit ResourceInfo object for their content.
getInfo
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
getInfo
in class ContentFeatureSource
public Name getName()
ContentFeatureSource
getSchema().getName()
to honor the
simple feature land common practice of calling the same both the Features produces and their
typesgetName
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
getName
in class ContentFeatureSource
FeatureSource
FeatureSource.getName()
public QueryCapabilities getQueryCapabilities()
ContentFeatureSource
Available via getView( filter ):
In particular this method of data access is intended for rendering and other high speed operations; care should be taken to optimize the use of FeatureVisitor.
getQueryCapabilities
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
getQueryCapabilities
in class ContentFeatureSource
Copyright © 1996–2019 Geotools. All rights reserved.