|
deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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,
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(String lockId)
Returns the active lock with the given id. |
(package private) FeatureStore |
getStore()
Returns the associated FeatureStore . |
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. |
(package private) void |
releaseExpiredLocks()
Checks for and releases all expired locks. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultLockManager(FeatureStore store, String jdbcConnId) throws FeatureStoreException
DefaultLockManager
for the given FeatureStore
.
store
- jdbcConnId
-
FeatureStoreException
- if the initialization of the locking backend failsMethod Detail |
---|
FeatureStore getStore()
FeatureStore
.
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 LockManager
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 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(String lockId) throws FeatureStoreException
LockManager
getLock
in interface LockManager
FeatureStoreException
public boolean isFeatureLocked(String fid) throws FeatureStoreException
LockManager
isFeatureLocked
in interface LockManager
fid
- id of the feature
FeatureStoreException
public boolean isFeatureModifiable(String fid, String lockId) throws FeatureStoreException
LockManager
isFeatureModifiable
in interface LockManager
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
void releaseExpiredLocks()
|
deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |