org.geotools.data.jdbc
Class JDBCFeatureLocking

java.lang.Object
  extended byorg.geotools.data.jdbc.JDBCFeatureSource
      extended byorg.geotools.data.jdbc.JDBCFeatureStore
          extended byorg.geotools.data.jdbc.JDBCFeatureLocking
All Implemented Interfaces:
FeatureLocking, FeatureSource, FeatureStore

public class JDBCFeatureLocking
extends JDBCFeatureStore
implements FeatureLocking

A Starting point for your own FeatureLocking implementations.

This class extends JDBCFeatureSource and depends on getDataStore().

The implementation of the following functions depends on getDataStore().getLockingManger() not being null:

JDBCFeatureLocking that have provided their own locking to will need to override the above methods, or provide a custom LockingManger.

Author:
Jody Garnett, Refractions Research

Nested Class Summary
 
Nested classes inherited from class org.geotools.data.FeatureLocking
FeatureLocking.Response
 
Field Summary
 
Fields inherited from class org.geotools.data.jdbc.JDBCFeatureStore
transaction
 
Constructor Summary
JDBCFeatureLocking(JDBC1DataStore jdbcDataStore, FeatureType featureType)
           
 
Method Summary
 int lockFeatures()
          Lock all Features
 int lockFeatures(Filter filter)
          Lock features matching filter.
 int lockFeatures(Query query)
          Lock features matching Query.
 void setFeatureLock(FeatureLock lock)
          Provide a FeatureLock for locking opperations to opperate against.
 void unLockFeatures()
          Unlock all Features.
 void unLockFeatures(Filter filter)
          Unlock Features specified by filter.
 void unLockFeatures(Query query)
          Unlock features specified by the query.
 
Methods inherited from class org.geotools.data.jdbc.JDBCFeatureStore
addFeatures, assertFids, assertFilter, fids, getInProcessLockingManager, getTransaction, modifyFeatures, modifyFeatures, modifyFeatures, removeFeatures, setFeatures, setTransaction
 
Methods inherited from class org.geotools.data.jdbc.JDBCFeatureSource
addFeatureListener, close, close, close, count, getBounds, getBounds, getConnection, getCount, getDataStore, getFeatures, getFeatures, getFeatures, getJDBCDataStore, getSchema, removeFeatureListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.geotools.data.FeatureStore
addFeatures, getTransaction, modifyFeatures, modifyFeatures, removeFeatures, setFeatures, setTransaction
 
Methods inherited from interface org.geotools.data.FeatureSource
addFeatureListener, getBounds, getBounds, getCount, getDataStore, getFeatures, getFeatures, getFeatures, getSchema, removeFeatureListener
 

Constructor Detail

JDBCFeatureLocking

public JDBCFeatureLocking(JDBC1DataStore jdbcDataStore,
                          FeatureType featureType)
Method Detail

setFeatureLock

public void setFeatureLock(FeatureLock lock)
Provide a FeatureLock for locking opperations to opperate against.

Initial Transactional duration locks can be restored with setFeatureLock( FetaureLock.TRANSACTION )

Specified by:
setFeatureLock in interface FeatureLocking
Parameters:
lock - FeatureLock (or FeatureLock.TRANSACTION );
Throws:
java.lang.NullPointerException - DOCUMENT ME!
See Also:
FeatureLocking.setFeatureLock(org.geotools.data.FeatureLock)

lockFeatures

public int lockFeatures()
                 throws java.io.IOException
Lock all Features

Specified by:
lockFeatures in interface FeatureLocking
Returns:
Number of Locked features
Throws:
java.io.IOException
See Also:
FeatureLocking.lockFeatures()

lockFeatures

public int lockFeatures(Filter filter)
                 throws java.io.IOException
Lock features matching filter.

Specified by:
lockFeatures in interface FeatureLocking
Parameters:
filter -
Returns:
Number of locked Features
Throws:
java.io.IOException
See Also:
FeatureLocking.lockFeatures(org.geotools.filter.Filter)

lockFeatures

public int lockFeatures(Query query)
                 throws java.io.IOException
Lock features matching Query.

FeatureStores that have provided their own locking to will need to override this method.

Specified by:
lockFeatures in interface FeatureLocking
Parameters:
query -
Returns:
Number of locked Features
Throws:
java.io.IOException - DOCUMENT ME!
java.lang.UnsupportedOperationException - DOCUMENT ME!
DataSourceException - If we have any lock conflicts
See Also:
FeatureLocking.lockFeatures(org.geotools.data.Query)

unLockFeatures

public void unLockFeatures()
                    throws java.io.IOException
Unlock all Features.

Specified by:
unLockFeatures in interface FeatureLocking
Throws:
java.io.IOException
See Also:
FeatureLocking.unLockFeatures()

unLockFeatures

public void unLockFeatures(Filter filter)
                    throws java.io.IOException
Unlock Features specified by filter.

Specified by:
unLockFeatures in interface FeatureLocking
Parameters:
filter -
Throws:
java.io.IOException
See Also:
FeatureLocking.unLockFeatures(org.geotools.filter.Filter)

unLockFeatures

public void unLockFeatures(Query query)
                    throws java.io.IOException
Unlock features specified by the query.

FeatureStores that have provided their own locking to will need to override this method.

Specified by:
unLockFeatures in interface FeatureLocking
Parameters:
query -
Throws:
java.io.IOException
java.lang.UnsupportedOperationException - DOCUMENT ME!
DataSourceException - DOCUMENT ME!
See Also:
FeatureLocking.unLockFeatures(org.geotools.data.Query)


Copyright © GeoTools. All Rights Reserved.