org.geotools.data
Interface FeatureLocking<T extends FeatureType,F extends Feature>
- All Superinterfaces:
- FeatureSource<T,F>, FeatureStore<T,F>
- All Known Implementing Classes:
- AbstractFeatureLocking, ContentFeatureStore, DirectoryFeatureLocking, JDBCFeatureLocking, JDBCFeatureStore, PostgisFeatureLocking, PropertyFeatureSource, ShapefileFeatureLocking
public interface FeatureLocking<T extends FeatureType,F extends Feature>
- extends FeatureStore<T,F>
Provides Feature based locking.
Features from individual shapefiles, database tables, etc. can be protected
or reserved from modification through this interface.
To use please cast your FeatureSource to this interface.
FeatureSource source = dataStore.getFeatureSource("roads");
if( source instanceof FeatureLocking ) {
FeatureLocking locking = (FeatureLocking) source;
...
}
- Author:
- Jody Garnett, Refractions Research, Inc., Ray Gallagher, Rob Hranac, TOPP, Chris Holmes, TOPP
- Module:
modules/library/api (gt-api.jar)
Nested Class Summary |
static class |
FeatureLocking.Response
Idea for a response from a high-level lock( Query ) function. |
Methods inherited from interface FeatureSource |
addFeatureListener, getBounds, getBounds, getCount, getDataStore, getFeatures, getFeatures, getFeatures, getInfo, getName, getQueryCapabilities, getSchema, getSupportedHints, removeFeatureListener |
setFeatureLock
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:
-
Be recorded against the provided FeatureLock.
-
Be recorded against the current transaction if no FeatureLock is
provided.
Calling this method with setFeatureLock( FeatureLock.TRANSACTION
)
will revert to per transaction operation.
This design allows for the following:
-
cross DataSource FeatureLock usage
-
not having pass in the same FeatureLock object multiple times
- Parameters:
lock
- DOCUMENT ME!
lockFeatures
int lockFeatures(Query query)
throws 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:
IOException
- Thrown if anything goes wrong
lockFeatures
int lockFeatures(Filter filter)
throws 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:
IOException
- Thrown if anything goes wrong
lockFeatures
int lockFeatures()
throws 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:
IOException
unLockFeatures
void unLockFeatures()
throws 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:
IOException
unLockFeatures
void unLockFeatures(Filter filter)
throws IOException
- Unlock Features denoted by provided filter.
Authorization must be provided prior before calling this method.
- Parameters:
filter
-
- Throws:
IOException
unLockFeatures
void unLockFeatures(Query query)
throws IOException
- Unlock Features denoted by provided query.
Authorization must be provided prior before calling this method.
- Parameters:
query
- Specifies fatures to unlock
- Throws:
IOException
Copyright © 1996-2009 Geotools. All Rights Reserved.