deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

org.deegree.feature.persistence
Interface FeatureStore

All Known Implementing Classes:
MemoryFeatureStore, PostGISFeatureStore, ShapeFeatureStore, SimpleSQLDatastore

public interface FeatureStore

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

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

Implementation requirements

Implementations must be thread-safe, because 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.
 void destroy()
          Called by the container to indicate that this FeatureStore instance is being taken out of service.
 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.
 ApplicationSchema getSchema()
          Returns the application schema that this FeatureStore serves.
 CRS getStorageSRS()
          Returns the native CRS used for storing geometries.
 void init()
          Called by the container to indicate that this FeatureStore instance is being placed into service.
 boolean isAvailable()
          Returns whether the store is currently able to perform operations.
 FeatureResultSet query(Query query)
          Performs the given query and returns the matching features as a FeatureResultSet.
 FeatureResultSet query(Query[] queries)
          Performs the given queries and returns the matching features as a FeatureResultSet.
 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.
 

Method Detail

init

void init()
          throws FeatureStoreException
Called by the container to indicate that this FeatureStore instance is being placed into service.

Throws:
FeatureStoreException - if the initialization fails

destroy

void destroy()
Called by the container to indicate that this FeatureStore instance is being taken out of service.


isAvailable

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

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

getSchema

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

Returns:
the served application schema, never null

getStorageSRS

CRS getStorageSRS()
Returns the native CRS used for storing geometries.

Returns:
the native CRS used for storing geometries, can be null

getEnvelope

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

Parameters:
ftName - name of the feature type, must not be null and must be served by this store
Returns:
the envelope (using the native CRS), or null if the feature type is not known

query

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

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

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

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
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. TODO check if a common interface for returned objects should be used here (instead of Object)

Parameters:
id - identifier of the object to be retrieved
Returns:
the stored object (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, never null
Throws:
FeatureStoreException - if the FeatureStore does not implement locking

deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org

]]>