Package org.drjekyll.webdav.locking
Interface IResourceLocks
-
- All Known Implementing Classes:
ResourceLocks
public interface IResourceLocks
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
checkTimeouts(Transaction transaction, boolean temporary)
Deletes LockedObjects, where timeout has reached.boolean
exclusiveLock(Transaction transaction, String path, String owner, int depth, int timeout)
Tries to lock the resource at "path" exclusively.LockedObject
getLockedObjectByID(Transaction transaction, String id)
Gets the LockedObject corresponding to specified id.LockedObject
getLockedObjectByPath(Transaction transaction, String path)
Gets the LockedObject on specified path.LockedObject
getTempLockedObjectByID(Transaction transaction, String id)
Gets the LockedObject corresponding to specified id (locktoken).LockedObject
getTempLockedObjectByPath(Transaction transaction, String path)
Gets the LockedObject on specified path.boolean
lock(Transaction transaction, String path, String owner, boolean exclusive, int depth, int timeout, boolean temporary)
Tries to lock the resource at "path".boolean
sharedLock(Transaction transaction, String path, String owner, int depth, int timeout)
Tries to lock the resource at "path" shared.boolean
unlock(Transaction transaction, String id, String owner)
Unlocks all resources at "path" (and all subfolders if existing)void
unlockTemporaryLockedObjects(Transaction transaction, String path, String owner)
Unlocks all resources at "path" (and all subfolders if existing)
-
-
-
Method Detail
-
lock
boolean lock(Transaction transaction, String path, String owner, boolean exclusive, int depth, int timeout, boolean temporary)
Tries to lock the resource at "path".- Parameters:
transaction
-path
- 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
-
unlock
boolean unlock(Transaction transaction, String id, String owner)
Unlocks all resources at "path" (and all subfolders if existing)that have the same owner.
- Parameters:
transaction
-id
- id to the resource to unlockowner
- who wants to unlock
-
unlockTemporaryLockedObjects
void unlockTemporaryLockedObjects(Transaction transaction, String path, String owner)
Unlocks all resources at "path" (and all subfolders if existing)that have the same owner.
- Parameters:
transaction
-path
- what resource to unlockowner
- who wants to unlock
-
checkTimeouts
void checkTimeouts(Transaction transaction, boolean temporary)
Deletes LockedObjects, where timeout has reached.- Parameters:
transaction
-temporary
- Check timeout on temporary or real locks
-
exclusiveLock
boolean exclusiveLock(Transaction transaction, String path, String owner, int depth, int timeout)
Tries to lock the resource at "path" exclusively.- Parameters:
transaction
- 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
-
sharedLock
boolean sharedLock(Transaction transaction, String path, String owner, int depth, int timeout)
Tries to lock the resource at "path" shared.- Parameters:
transaction
- 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
-
getLockedObjectByID
LockedObject getLockedObjectByID(Transaction transaction, String id)
Gets the LockedObject corresponding to specified id.- Parameters:
transaction
-id
- LockToken to requested resource- Returns:
- LockedObject or null if no LockedObject on specified path exists
-
getLockedObjectByPath
LockedObject getLockedObjectByPath(Transaction transaction, String path)
Gets the LockedObject on specified path.- Parameters:
transaction
-path
- Path to requested resource- Returns:
- LockedObject or null if no LockedObject on specified path exists
-
getTempLockedObjectByID
LockedObject getTempLockedObjectByID(Transaction transaction, String id)
Gets the LockedObject corresponding to specified id (locktoken).- Parameters:
transaction
-id
- LockToken to requested resource- Returns:
- LockedObject or null if no LockedObject on specified path exists
-
getTempLockedObjectByPath
LockedObject getTempLockedObjectByPath(Transaction transaction, String path)
Gets the LockedObject on specified path.- Parameters:
transaction
-path
- Path to requested resource- Returns:
- LockedObject or null if no LockedObject on specified path exists
-
-