org.geotools.data
Class AbstractFeatureLocking

Object
  extended by AbstractFeatureSource
      extended by AbstractFeatureStore
          extended by AbstractFeatureLocking
All Implemented Interfaces:
FeatureLocking<SimpleFeatureType,SimpleFeature>, FeatureSource<SimpleFeatureType,SimpleFeature>, FeatureStore<SimpleFeatureType,SimpleFeature>, SimpleFeatureLocking, SimpleFeatureSource, SimpleFeatureStore
Direct Known Subclasses:
PropertyFeatureStore

public abstract class AbstractFeatureLocking
extends AbstractFeatureStore
implements FeatureLocking<SimpleFeatureType,SimpleFeature>, SimpleFeatureLocking

A Starting point for your own FeatureLocking implementations.

This class extends AbstractFeatureSource and depends on getDataStore().

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

FeatureStores 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/interfaces inherited from interface FeatureLocking
FeatureLocking.Response
 
Field Summary
 
Fields inherited from class AbstractFeatureStore
transaction
 
Fields inherited from class AbstractFeatureSource
hints, queryCapabilities
 
Constructor Summary
AbstractFeatureLocking()
           
AbstractFeatureLocking(Set hints)
          This constructors allows to set the supported hints
 
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 AbstractFeatureStore
addFeatures, addFeatures, getTransaction, modifyFeatures, modifyFeatures, modifyFeatures, modifyFeatures, modifyFeatures, modifyFeatures, removeFeatures, setFeatures, setTransaction
 
Methods inherited from class AbstractFeatureSource
getBounds, getBounds, getCount, getDataStore, getFeatures, getFeatures, getFeatures, getInfo, getName, getQueryCapabilities, getSupportedHints, namedQuery
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface SimpleFeatureStore
getFeatures, getFeatures, getFeatures, modifyFeatures, modifyFeatures
 
Methods inherited from interface FeatureStore
addFeatures, getTransaction, modifyFeatures, modifyFeatures, modifyFeatures, modifyFeatures, removeFeatures, setFeatures, setTransaction
 
Methods inherited from interface FeatureSource
addFeatureListener, getBounds, getBounds, getCount, getDataStore, getInfo, getName, getQueryCapabilities, getSchema, getSupportedHints, removeFeatureListener
 

Constructor Detail

AbstractFeatureLocking

public AbstractFeatureLocking()

AbstractFeatureLocking

public AbstractFeatureLocking(Set hints)
This constructors allows to set the supported hints

Parameters:
hints -
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<SimpleFeatureType,SimpleFeature>
Parameters:
lock - FeatureLock (or FeatureLock.TRANSACTION );
Throws:
NullPointerException - If lock was null
See Also:
FeatureLocking.setFeatureLock(org.geotools.data.FeatureLock)

lockFeatures

public int lockFeatures()
                 throws IOException
Lock all Features

Specified by:
lockFeatures in interface FeatureLocking<SimpleFeatureType,SimpleFeature>
Returns:
Number of Locked features
Throws:
IOException
See Also:
FeatureLocking.lockFeatures()

lockFeatures

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

Specified by:
lockFeatures in interface FeatureLocking<SimpleFeatureType,SimpleFeature>
Parameters:
filter -
Returns:
Number of locked Features
Throws:
IOException

lockFeatures

public int lockFeatures(Query query)
                 throws 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<SimpleFeatureType,SimpleFeature>
Parameters:
query -
Returns:
Number of locked Features
Throws:
IOException - If we could not determine which feature to lock based on Query
UnsupportedOperationException - When DataStore does not provide a LockingManager
DataSourceException - If feature to be locked does not exist
See Also:
FeatureLocking.lockFeatures(org.geotools.data.Query)

unLockFeatures

public void unLockFeatures()
                    throws IOException
Unlock all Features.

Specified by:
unLockFeatures in interface FeatureLocking<SimpleFeatureType,SimpleFeature>
Throws:
IOException
See Also:
FeatureLocking.unLockFeatures()

unLockFeatures

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

Specified by:
unLockFeatures in interface FeatureLocking<SimpleFeatureType,SimpleFeature>
Parameters:
filter -
Throws:
IOException

unLockFeatures

public void unLockFeatures(Query query)
                    throws 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<SimpleFeatureType,SimpleFeature>
Parameters:
query -
Throws:
IOException
UnsupportedOperationException - If lockingManager is not provided by DataStore subclass
DataSourceException - Filter describes an unlocked Feature, or authorization not held
See Also:
FeatureLocking.unLockFeatures(org.geotools.data.Query)


Copyright © 1996-2014 Geotools. All Rights Reserved.