org.deegree.feature.persistence
Interface FeatureStore

All Superinterfaces:
Resource
All Known Implementing Classes:
GeoCouchFeatureStore, MemoryFeatureStore, RemoteWFSFeatureStore, ShapeFeatureStore, SimpleSQLFeatureStore, SQLFeatureStore

public interface FeatureStore
extends Resource

Base interface of the Feature persistence layer, provides access to stored Feature instances.

Note that a FeatureStore instance is always associated with exactly one AppSchema instance.

NOTE: Implementations must be thread-safe, as FeatureStore instances are usually used in multiple threads concurrently.

Version:
$Revision: $, $Date: $
Author:
Markus Schneider, last edited by: $Author: schneider $

Method Summary
 FeatureStoreTransaction acquireTransaction()
          Acquires transactional access to the feature store.
 Envelope calcEnvelope(QName ftName)
          Recalculates the envelope for all stored features of the given type.
 Envelope getEnvelope(QName ftName)
          Returns the envelope for all stored features of the given type.
 LockManager getLockManager()
          Returns the associated LockManager.
 GMLObject getObjectById(String id)
          Retrieves the stored object with a certain id.
 AppSchema getSchema()
          Returns the application schema that this FeatureStore serves.
 boolean isAvailable()
          Returns whether the store is currently able to perform operations.
 FeatureInputStream query(Query query)
          Performs the given query and returns the matching features as a FeatureInputStream.
 FeatureInputStream query(Query[] queries)
          Performs the given queries and returns the matching features as a FeatureInputStream.
 int queryHits(Query query)
          Returns the number of features that are matched by the given query.
 int[] queryHits(Query[] queries)
          Returns the number of features that are matched by the given queries.
 
Methods inherited from interface org.deegree.commons.config.Resource
destroy, init
 

Method Detail

isAvailable

boolean isAvailable()
Returns whether the store is currently able to perform operations.

Returns:
true, if the store is functional, false otherwise

getSchema

AppSchema getSchema()
Returns the application schema that this FeatureStore serves.

Returns:
the served application schema, never null

getEnvelope

Envelope getEnvelope(QName ftName)
                     throws FeatureStoreException
Returns the envelope for all stored features of the given type.

NOTE: This method may return incorrect (cached) results. Use calcEnvelope(QName) to force the recalculation of the Envelope.

Parameters:
ftName - name of the feature type, must not be null and must be served by this store
Returns:
the envelope (using the storage CRS), or null if the feature type does not have an envelope (no geometry properties or no instances)
Throws:
FeatureStoreException

calcEnvelope

Envelope calcEnvelope(QName ftName)
                      throws FeatureStoreException
Recalculates the envelope for all stored features of the given type.

NOTE: This method may potentially be expensive. Depending on the implementation, it may involve fetching all features of the specified type.

Parameters:
ftName - name of the feature type, must not be null and must be served by this store
Returns:
the envelope (using the storage CRS), or null if the feature type does not have an envelope (no geometry properties or no instances)
Throws:
FeatureStoreException

query

FeatureInputStream query(Query query)
                         throws FeatureStoreException,
                                FilterEvaluationException
Performs the given query and returns the matching features as a FeatureInputStream.

Parameters:
query - query to be performed, must not be null
Returns:
matching features, never null
Throws:
FeatureStoreException - if the query could not be performed
FilterEvaluationException - if the filter contained in the query could not be evaluated

query

FeatureInputStream query(Query[] queries)
                         throws FeatureStoreException,
                                FilterEvaluationException
Performs the given queries and returns the matching features as a FeatureInputStream.

Parameters:
queries - queries to be performed, must not be null and contain at least one entry
Returns:
matching features, never null
Throws:
FeatureStoreException - if the query could not be performed
FilterEvaluationException - if the filter contained in the query could not be evaluated

queryHits

int queryHits(Query query)
              throws FeatureStoreException,
                     FilterEvaluationException
Returns the number of features that are matched by the given query.

Parameters:
query - query to be performed, must not be null
Returns:
number of matching featuress
Throws:
FeatureStoreException - if the query could not be performed
FilterEvaluationException - if the filter contained in the query could not be evaluated

queryHits

int[] queryHits(Query[] queries)
                throws FeatureStoreException,
                       FilterEvaluationException
Returns the number of features that are matched by the given queries.

Parameters:
queries - queries to be performed, must not be null and contain at least one entry
Returns:
number of matching features, one entry per query
Throws:
FeatureStoreException - if the query could not be performed
FilterEvaluationException - if the filter contained in the query could not be evaluated

getObjectById

GMLObject getObjectById(String id)
                        throws FeatureStoreException
Retrieves the stored object with a certain id.

Parameters:
id - identifier of the object to be retrieved
Returns:
the stored object (currently either a Feature or a Geometry) or null if no object with the given id is known
Throws:
FeatureStoreException - if the query could not be performed

acquireTransaction

FeatureStoreTransaction acquireTransaction()
                                           throws FeatureStoreException
Acquires transactional access to the feature store.

Returns:
transaction object that allows to perform transactions operations on the datastore, never null
Throws:
FeatureStoreException - if the transactional access could not be acquired or is not implemented for this FeatureStore

getLockManager

LockManager getLockManager()
                           throws FeatureStoreException
Returns the associated LockManager.

Returns:
the associated LockManager instance, or null if the FeatureStore does not implement locking
Throws:
FeatureStoreException - if the lock manager could not be acquired


Copyright © 2011. All Rights Reserved.