|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LockManager
Keeps track of the lock state of the features stored in a FeatureStore
.
Locked features cannot be updated or deleted except by transactions that specify their lock identifier.
Implementations must ensure that the active locks survive a restart of the VM (e.g. by persisting them in a database).
Method Summary | |
---|---|
Lock |
acquireLock(LockOperation[] lockRequests,
boolean mustLockAll,
long expireTimeout)
Acquires a lock for the specified features instances. |
CloseableIterator<Lock> |
getActiveLocks()
Returns all active locks. |
Lock |
getLock(String lockId)
Returns the active lock with the given id. |
boolean |
isFeatureLocked(String fid)
Returns whether an active lock on the specified feature exists. |
boolean |
isFeatureModifiable(String fid,
String lockId)
Returns whether the specified feature is modifiable for the owner of the specified lock. |
Method Detail |
---|
Lock acquireLock(LockOperation[] lockRequests, boolean mustLockAll, long expireTimeout) throws FeatureStoreException
If mustLockAll
is true and not all of the specified features can be locked, a
FeatureStoreException
is thrown.
If no features have been locked at all, a lock will be issued, but the lock is not registered (as requested by the WFS spec.).
lockRequests
- lock requests to be executed, must not be null
mustLockAll
- if true, a FeatureStoreException
is thrown if any of the requested feature instances could not
be lockedexpireTimeout
- number of milliseconds before the lock is automatically released
null
FeatureStoreException
- if an internal error occurs or if mustLockAll
is true
and at least one
feature could not be lockedLock getLock(String lockId) throws FeatureStoreException
lockId
-
FeatureStoreException
CloseableIterator<Lock> getActiveLocks() throws FeatureStoreException
NOTE: The caller must invoke CloseableIterator.close()
after it's not needed anymore -- otherwise,
backing resources (such as database connections) may not be freed.
FeatureStoreException
boolean isFeatureLocked(String fid) throws FeatureStoreException
fid
- id of the feature
FeatureStoreException
boolean isFeatureModifiable(String fid, String lockId) throws FeatureStoreException
fid
- id of the feature, must not be null
lockId
- if of the lock, may be null (in this case the feature is only modifiable if the feature is not locked
at all)
FeatureStoreException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |