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

org.deegree.feature.persistence.postgis
Class PostGISFeatureStoreTransaction

java.lang.Object
  extended by org.deegree.feature.persistence.postgis.PostGISFeatureStoreTransaction
All Implemented Interfaces:
FeatureStoreTransaction

public class PostGISFeatureStoreTransaction
extends Object
implements FeatureStoreTransaction

FeatureStoreTransaction implementation used by the PostGISFeatureStore.

Version:
$Revision: 22228 $, $Date: 2010-01-26 18:28:07 +0100 (Di, 26 Jan 2010) $
Author:
Markus Schneider, last edited by: $Author: mschneider $
See Also:
PostGISFeatureStore

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.deegree.feature.persistence.FeatureStoreTransaction
FeatureStoreTransaction.IDGenMode
 
Constructor Summary
PostGISFeatureStoreTransaction(PostGISFeatureStore store, Connection conn)
          Creates a new PostGISFeatureStoreTransaction instance.
 
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.
 Connection getConnection()
          Returns the underlying JDBC connection.
 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, FeatureStoreTransaction.IDGenMode mode)
          Inserts the member features of the given FeatureCollection into the FeatureStore.
 int performUpdate(QName ftName, List<Property<?>> replacementProps, Filter filter, Lock lock)
          Performs an update operation against the FeatureStore.
 void prepareCommit()
           
 void prepareRollbackAndRelease()
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PostGISFeatureStoreTransaction

PostGISFeatureStoreTransaction(PostGISFeatureStore store,
                               Connection conn)
Creates a new PostGISFeatureStoreTransaction instance. NOTE: This method is only supposed to be invoked by the PostGISFeatureStore.

Parameters:
store - invoking feature store instance, never null
conn - JDBC connection associated with the transaction, never null and has autocommit set to false
Method Detail

commit

public void commit()
            throws FeatureStoreException
Description copied from interface: FeatureStoreTransaction
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.

Specified by:
commit in interface FeatureStoreTransaction
Throws:
FeatureStoreException - if the committing fails

prepareCommit

public void prepareCommit()
                   throws FeatureStoreException
Throws:
FeatureStoreException

getStore

public FeatureStore getStore()
Description copied from interface: FeatureStoreTransaction
Returns the underlying FeatureStore instance.

Specified by:
getStore in interface FeatureStoreTransaction
Returns:
the underlying FeatureStore instance

getConnection

public Connection getConnection()
Returns the underlying JDBC connection. Can be used for performing other operations in the same transaction context.

Returns:
the underlying JDBC connection, never null

performDelete

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

Specified by:
performDelete in interface FeatureStoreTransaction
Parameters:
ftName - feature type of the features to be deleted, must not be null and served by the store
filter - filter that determines the features to be deleted
lock - optional lock object, may be null
Returns:
number of deleted feature instances
Throws:
FeatureStoreException - if the deletion fails

performDelete

public int performDelete(IdFilter filter,
                         Lock lock)
                  throws FeatureStoreException
Description copied from interface: FeatureStoreTransaction
Deletes the features from the FeatureStore that are matched by the given filter.

Specified by:
performDelete in interface FeatureStoreTransaction
Parameters:
filter - filter that determines the features to be deleted
lock - optional lock object, may be null
Returns:
number of deleted feature instances
Throws:
FeatureStoreException - if the deletion fails

performInsert

public List<String> performInsert(FeatureCollection fc,
                                  FeatureStoreTransaction.IDGenMode mode)
                           throws FeatureStoreException
Description copied from interface: FeatureStoreTransaction
Inserts the member features of the given FeatureCollection into the FeatureStore.

Specified by:
performInsert in interface FeatureStoreTransaction
Parameters:
fc - contains the member features to be inserted, their types must be served by the feature store and must not be null
mode - mode for deriving the ids of the inserted objects
Returns:
feature ids of the inserted (root) features
Throws:
FeatureStoreException - if the insertion fails

performUpdate

public int performUpdate(QName ftName,
                         List<Property<?>> replacementProps,
                         Filter filter,
                         Lock lock)
                  throws FeatureStoreException
Description copied from interface: FeatureStoreTransaction
Performs an update operation against the FeatureStore.

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

rollback

public void rollback()
              throws FeatureStoreException
Description copied from interface: FeatureStoreTransaction
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.

Specified by:
rollback in interface FeatureStoreTransaction
Throws:
FeatureStoreException - if the rollback fails

prepareRollbackAndRelease

public void prepareRollbackAndRelease()
                               throws FeatureStoreException
Throws:
FeatureStoreException

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

]]>