|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.deegree.feature.persistence.lock.DefaultLockManager
public class DefaultLockManager
LockManager implementation that is based on an SQL database.
TODO Currently this class is only tested with Derby 10, but it should be easy to make it work with PostGIS, Oracle and other SQL DBs.
| Constructor Summary | |
|---|---|
DefaultLockManager(FeatureStore store,
java.lang.String jdbcConnId)
Creates a new DefaultLockManager for the given FeatureStore. |
|
| 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(java.lang.String lockId)
Returns the active lock with the given id. |
boolean |
isFeatureLocked(java.lang.String fid)
Returns whether an active lock on the specified feature exists. |
boolean |
isFeatureModifiable(java.lang.String fid,
java.lang.String lockId)
Returns whether the specified feature is modifiable for the owner of the specified lock. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultLockManager(FeatureStore store,
java.lang.String jdbcConnId)
throws FeatureStoreException
DefaultLockManager for the given FeatureStore.
store - jdbcConnId -
FeatureStoreException - if the initialization of the locking backend fails| Method Detail |
|---|
public Lock acquireLock(LockOperation[] lockRequests,
boolean mustLockAll,
long expireTimeout)
throws FeatureStoreException
LockManager
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.).
acquireLock in interface LockManagerlockRequests - lock requests to be executed, must not be nullmustLockAll - 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 lockedpublic CloseableIterator<Lock> getActiveLocks()
LockManager
NOTE: The caller must invoke CloseableIterator.close() after it's not needed anymore -- otherwise,
backing resources (such as database connections) may not be freed.
getActiveLocks in interface LockManager
public Lock getLock(java.lang.String lockId)
throws FeatureStoreException
LockManager
getLock in interface LockManagerFeatureStoreException
public boolean isFeatureLocked(java.lang.String fid)
throws FeatureStoreException
LockManager
isFeatureLocked in interface LockManagerfid - id of the feature
FeatureStoreException
public boolean isFeatureModifiable(java.lang.String fid,
java.lang.String lockId)
throws FeatureStoreException
LockManager
isFeatureModifiable in interface LockManagerfid - id of the feature, must not be nulllockId - 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 | |||||||||