public class DirectoryFeatureLocking extends DirectoryFeatureStore implements SimpleFeatureLocking
FeatureLocking.Response| Constructor and Description |
|---|
DirectoryFeatureLocking(SimpleFeatureLocking locking) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
SimpleFeatureLocking |
unwrap() |
addFeatures, getTransaction, modifyFeatures, modifyFeatures, modifyFeatures, modifyFeatures, modifyFeatures, modifyFeatures, removeFeatureListener, removeFeatures, setFeatures, setTransactionaddFeatureListener, getBounds, getBounds, getCount, getDataStore, getFeatures, getFeatures, getFeatures, getInfo, getName, getQueryCapabilities, getSchema, getSupportedHintsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFeatures, getFeatures, getFeatures, modifyFeatures, modifyFeaturesaddFeatures, getTransaction, modifyFeatures, modifyFeatures, modifyFeatures, modifyFeatures, removeFeatures, setFeatures, setTransactionaddFeatureListener, getBounds, getBounds, getCount, getDataStore, getInfo, getName, getQueryCapabilities, getSchema, getSupportedHints, removeFeatureListenerpublic DirectoryFeatureLocking(SimpleFeatureLocking locking)
public int lockFeatures()
throws IOException
FeatureLockingThe method does not prevent addFeatures() from being used (we could add a lockDataSource() method if this functionality is required.
lockFeatures in interface FeatureLocking<SimpleFeatureType,SimpleFeature>IOExceptionpublic int lockFeatures(Filter filter) throws IOException
FeatureLockingTo 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.
lockFeatures in interface FeatureLocking<SimpleFeatureType,SimpleFeature>filter - Filter describing the features to lockIOException - Thrown if anything goes wrongpublic void setFeatureLock(FeatureLock lock)
FeatureLockinglock.
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:
setFeatureLock in interface FeatureLocking<SimpleFeatureType,SimpleFeature>lock - FeatureLock configuration including authorization and requested durationpublic int lockFeatures(Query query) throws IOException
FeatureLockingTo 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.
lockFeatures in interface FeatureLocking<SimpleFeatureType,SimpleFeature>query - Query describing the features to lockIOException - Thrown if anything goes wrongpublic void unLockFeatures()
throws IOException
FeatureLockingAuthorization must be provided prior before calling this method.
void releaseLock( String lockId, LockingDataSource ds ){
ds.setAuthorization( "LOCK534" );
ds.unLockFeatures();
}
unLockFeatures in interface FeatureLocking<SimpleFeatureType,SimpleFeature>IOExceptionpublic void unLockFeatures(Filter filter) throws IOException
FeatureLockingAuthorization must be provided prior before calling this method.
unLockFeatures in interface FeatureLocking<SimpleFeatureType,SimpleFeature>IOExceptionpublic void unLockFeatures(Query query) throws IOException
FeatureLockingAuthorization must be provided prior before calling this method.
unLockFeatures in interface FeatureLocking<SimpleFeatureType,SimpleFeature>query - Specifies fatures to unlockIOExceptionpublic SimpleFeatureLocking unwrap()
unwrap in class DirectoryFeatureStoreCopyright © 1996–2019 Geotools. All rights reserved.