org.deegree.feature.persistence
Interface FeatureStoreTransaction

All Known Implementing Classes:
GeoCouchFeatureStoreTransaction, SQLFeatureStoreTransaction

public interface FeatureStoreTransaction

Provides transactional access to a FeatureStore.

Please note that a transaction must always be ended by calling either commit() or rollback().

Version:
$Revision: 31438 $, $Date: 2011-08-04 21:53:56 +0200 (Thu, 04 Aug 2011) $
Author:
Markus Schneider, last edited by: $Author: mschneider $
See Also:
FeatureStore.acquireTransaction()

Method Summary
 void commit()
          Makes the changes persistent that have been performed in this transaction and releases the transaction instance so other clients may acquire a transaction on the FeatureStore.
 FeatureStore getStore()
          Returns the underlying FeatureStore instance.
 int performDelete(IdFilter filter, Lock lock)
          Deletes the features from the FeatureStore that are matched by the given filter.
 int performDelete(QName ftName, OperatorFilter filter, Lock lock)
          Deletes the features from the FeatureStore that are matched by the given filter and type.
 List<String> performInsert(FeatureCollection fc, IDGenMode mode)
          Inserts the given FeatureCollection into the FeatureStore (including subfeatures).
 int performUpdate(QName ftName, List<Property> replacementProps, Filter filter, Lock lock)
          Performs an update operation against the FeatureStore.
 void rollback()
          Aborts the changes that have been performed in this transaction and releases the transaction instance so other clients may acquire a transaction on the FeatureStore.
 

Method Detail

getStore

FeatureStore getStore()
Returns the underlying FeatureStore instance.

Returns:
the underlying FeatureStore instance, never null

commit

void commit()
            throws FeatureStoreException
Makes the changes persistent that have been performed in this transaction and releases the transaction instance so other clients may acquire a transaction on the FeatureStore.

Throws:
FeatureStoreException - if the committing fails

rollback

void rollback()
              throws FeatureStoreException
Aborts the changes that have been performed in this transaction and releases the transaction instance so other clients may acquire a transaction on the FeatureStore.

Throws:
FeatureStoreException - if the rollback fails

performInsert

List<String> performInsert(FeatureCollection fc,
                           IDGenMode mode)
                           throws FeatureStoreException
Inserts the given FeatureCollection into the FeatureStore (including subfeatures).

Parameters:
fc - features to be inserted, must not be null
mode - mode for deriving the ids of the inserted objects, must not be null
Returns:
effective ids of the inserted feature and subfeatures (in document order)
Throws:
FeatureStoreException - if the insertion fails

performUpdate

int performUpdate(QName ftName,
                  List<Property> replacementProps,
                  Filter filter,
                  Lock lock)
                  throws FeatureStoreException
Performs an update operation against the FeatureStore.

Parameters:
ftName - feature type of the features to be updated, must not be null
replacementProps - properties and their replacement values, must not be null
filter - selects the feature instances that are to be updated, must not be null
lock - optional lock object, may be null
Returns:
number of updated feature instances
Throws:
FeatureStoreException - if the update fails

performDelete

int performDelete(QName ftName,
                  OperatorFilter filter,
                  Lock lock)
                  throws FeatureStoreException
Deletes the features from the FeatureStore that are matched by the given filter and type.

Parameters:
ftName - feature type of the features to be deleted, must not be null
filter - filter that determines the features to be deleted, must not be null
lock - optional lock object, may be null
Returns:
number of deleted feature instances
Throws:
FeatureStoreException - if the deletion fails

performDelete

int performDelete(IdFilter filter,
                  Lock lock)
                  throws FeatureStoreException
Deletes the features from the FeatureStore that are matched by the given filter.

Parameters:
filter - filter that determines the features to be deleted, must not be null
lock - optional lock object, may be null
Returns:
number of deleted feature instances
Throws:
FeatureStoreException - if the deletion fails (*not* if a specified id does not exist)


Copyright © 2011. All Rights Reserved.