Package nl.info.webdav.locking
Interface IResourceLocks
- All Known Implementing Classes:
ResourceLocks
public interface IResourceLocks
-
Method Summary
Modifier and TypeMethodDescriptionvoidcheckTimeouts(ITransaction transaction, boolean temporary) Deletes LockedObjects, where timeout has reached.booleanexclusiveLock(ITransaction transaction, String path, String owner, int depth, int timeout) Tries to lock the resource at "path" exclusively.getLockedObjectByID(ITransaction transaction, String id) Gets the LockedObject corresponding to specified id.getLockedObjectByPath(ITransaction transaction, String path) Gets the locked object on specified path.getTempLockedObjectByID(ITransaction transaction, String id) Gets the LockedObject corresponding to specified id (lock token).getTempLockedObjectByPath(ITransaction transaction, String path) Gets the LockedObject on specified path.booleanlock(ITransaction transaction, String path, String owner, boolean exclusive, int depth, int timeout, boolean temporary) Tries to lock the resource at "path".booleansharedLock(ITransaction transaction, String path, String owner, int depth, int timeout) Tries to lock the resource at "path" shared.booleanunlock(ITransaction transaction, String id, String owner) Unlocks all resources at "path" (and all sub-folders if existing) that have the same owner.voidunlockTemporaryLockedObjects(ITransaction transaction, String path, String owner) Unlocks all resources at "path" (and all sub-folders if existing) that have the same owner.
-
Method Details
-
lock
boolean lock(ITransaction transaction, String path, String owner, boolean exclusive, int depth, int timeout, boolean temporary) throws LockFailedException Tries to lock the resource at "path".- Parameters:
transaction- the transactionpath- what resource to lockowner- the owner of the lockexclusive- if the lock should be exclusive (or shared)depth- depthtimeout- lock duration in seconds.- Returns:
- true if the resource at path was successfully locked, false if an existing lock prevented this
- Throws:
LockFailedException- if the lock failed
-
unlock
Unlocks all resources at "path" (and all sub-folders if existing) that have the same owner.- Parameters:
transaction- the transactionid- id to the resource to unlockowner- who wants to unlock
-
unlockTemporaryLockedObjects
Unlocks all resources at "path" (and all sub-folders if existing) that have the same owner.- Parameters:
transaction- the transactionpath- what resource to unlockowner- who wants to unlock
-
checkTimeouts
Deletes LockedObjects, where timeout has reached.- Parameters:
transaction- the transactiontemporary- check timeout on temporary or real locks
-
exclusiveLock
boolean exclusiveLock(ITransaction transaction, String path, String owner, int depth, int timeout) throws LockFailedException Tries to lock the resource at "path" exclusively.- Parameters:
transaction- the transactionpath- what resource to lockowner- the owner of the lockdepth- depthtimeout- lock duration in seconds.- Returns:
- true if the resource at path was successfully locked, false if an existing lock prevented this
- Throws:
LockFailedException- if the lock failed
-
getLockedObjectByID
Gets the LockedObject corresponding to specified id.- Parameters:
transaction- the transactionid- lock token to requested resource- Returns:
- LockedObject or null if no LockedObject on specified path exists
-
getLockedObjectByPath
Gets the locked object on specified path.- Parameters:
transaction- the transactionpath- the path to requested resource- Returns:
- LockedObject or null if no LockedObject on specified path exists
-
getTempLockedObjectByID
Gets the LockedObject corresponding to specified id (lock token).- Parameters:
transaction- the transactionid- the lock token to requested resource- Returns:
- LockedObject or null if no LockedObject on specified path exists
-
getTempLockedObjectByPath
Gets the LockedObject on specified path.- Parameters:
transaction- the transactionpath- path to requested resource- Returns:
- LockedObject or null if no LockedObject on specified path exists
-