org.geotools.data
Interface FeatureLocking

All Superinterfaces:
FeatureSource, FeatureStore
All Known Implementing Classes:
AbstractFeatureLocking, JDBCFeatureLocking

public interface FeatureLocking
extends FeatureStore

Provides Feature based locking.

Features from individual shapefiles, database tables, etc. can be protected or reserved from modification through this interface.

This is a prototype DataSource replacement please see FeatureSource form more information

Version:
$Id: FeatureLocking.java,v 1.4 2003/11/25 04:05:35 jive Exp $
Author:
Jody Garnett, Ray Gallagher, Rob Hranac, TOPP, Chris Holmes, TOPP

Nested Class Summary
static class FeatureLocking.Response
          Idea for a response from a high-level lock( Query ) function.
 
Method Summary
 int lockFeatures()
          FeatureLock all Features.
 int lockFeatures(Filter filter)
          FeatureLock features described by Filter.
 int lockFeatures(Query query)
          FeatureLock features described by Query.
 void setFeatureLock(FeatureLock lock)
          All locking operations will operate against the provided lock.
 void unLockFeatures()
          Unlocks all Features.
 void unLockFeatures(Filter filter)
          Unlock Features denoted by provided filter.
 void unLockFeatures(Query query)
          Unlock Features denoted by provided query.
 
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
 

Method Detail

setFeatureLock

public void setFeatureLock(FeatureLock lock)
All locking operations will operate against the provided lock.

This in in keeping with the stateful spirit of DataSource in which operations are against the "current" transaction. If a FeatureLock is not provided lock operations will only be applicable for the current transaction (they will expire on the next commit or rollback).

That is lockFeatures() operations will:

Calling this method with setFeatureLock( FeatureLock.TRANSACTION ) will revert to per transaction operation.

This design allows for the following:


lockFeatures

public int lockFeatures(Query query)
                 throws java.io.IOException
FeatureLock features described by Query.

To implement WFS parcial Locking retrieve your features with a query operation first before trying to lock them individually. If you are not into WFS please don't ask what parcial locking is.

Parameters:
query - Query describing the features to lock
Returns:
Number of features locked
Throws:
DataSourceException - Thrown if anything goes wrong
java.io.IOException

lockFeatures

public int lockFeatures(Filter filter)
                 throws java.io.IOException
FeatureLock features described by Filter.

To implement WFS parcial Locking retrieve your features with a query operation first before trying to lock them individually. If you are not into WFS please don't ask what parcial locking is.

Parameters:
filter - Filter describing the features to lock
Returns:
Number of features locked
Throws:
DataSourceException - Thrown if anything goes wrong
java.io.IOException

lockFeatures

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

The method does not prevent addFeatures() from being used (we could add a lockDataSource() method if this functionality is required.

Returns:
Number of Features locked by this opperation
Throws:
DataSourceException
java.io.IOException

unLockFeatures

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

Authorization must be provided prior before calling this method.


 void releaseLock( String lockId, LockingDataSource ds ){
    ds.setAuthorization( "LOCK534" );
    ds.unLockFeatures(); 
 }
 

Throws:
DataSourceException
java.io.IOException

unLockFeatures

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

Authorization must be provided prior before calling this method.

Parameters:
filter -
Throws:
DataSourceException
java.io.IOException

unLockFeatures

public void unLockFeatures(Query query)
                    throws java.io.IOException
Unlock Features denoted by provided query.

Authorization must be provided prior before calling this method.

Parameters:
query - Specifies fatures to unlock
Throws:
DataSourceException
java.io.IOException


Copyright © 1996-2003 GeoTools. All Rights Reserved.