Class TxLockManagerImpl
- java.lang.Object
-
- org.apache.jackrabbit.webdav.jcr.transaction.TxLockManagerImpl
-
- All Implemented Interfaces:
LockManager,TxLockManager
public class TxLockManagerImpl extends Object implements TxLockManager
TxLockManagerImplmanages locks with locktype 'dcr:transaction'.
-
-
Constructor Summary
Constructors Constructor Description TxLockManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTransactionListener(TransactionListener listener)Adds a transaction listener to thisTxLockManager.ActiveLockcreateLock(LockInfo lockInfo, DavResource resource)Create a new lock.ActiveLockgetLock(Type type, Scope scope, DavResource resource)Always returns nullActiveLockgetLock(Type type, Scope scope, TransactionResource resource)Return the lock applied to the given resource ornullbooleanhasLock(String token, DavResource resource)Returns true if the given lock token belongs to a lock that applies to the given resource, false otherwise.ActiveLockrefreshLock(LockInfo lockInfo, String lockToken, DavResource resource)Refresh the lock identified by the given lock token.voidreleaseLock(String lockToken, DavResource resource)Throws UnsupportedOperationException.voidreleaseLock(TransactionInfo lockInfo, String lockToken, TransactionResource resource)Release the lock identified by the given lock token.voidremoveTransactionListener(TransactionListener listener)Removes a transaction listener from thisTxLockManager.
-
-
-
Method Detail
-
createLock
public ActiveLock createLock(LockInfo lockInfo, DavResource resource) throws DavException
Create a new lock.- Specified by:
createLockin interfaceLockManager- Parameters:
lockInfo- as present in the request body.resource-- Returns:
- the lock
- Throws:
DavException- if the lock could not be obtained.IllegalArgumentException- if the resource isnullor does not implementTransactionResourceinterface.- See Also:
LockManager.createLock(org.apache.jackrabbit.webdav.lock.LockInfo, org.apache.jackrabbit.webdav.DavResource)
-
refreshLock
public ActiveLock refreshLock(LockInfo lockInfo, String lockToken, DavResource resource) throws DavException
Refresh the lock identified by the given lock token.- Specified by:
refreshLockin interfaceLockManager- Parameters:
lockInfo-lockToken-resource-- Returns:
- the lock
- Throws:
DavExceptionIllegalArgumentException- if the resource isnullor does not implementTransactionResourceinterface.- See Also:
LockManager.refreshLock(org.apache.jackrabbit.webdav.lock.LockInfo, String, org.apache.jackrabbit.webdav.DavResource)
-
releaseLock
public void releaseLock(String lockToken, DavResource resource) throws DavException
Throws UnsupportedOperationException.- Specified by:
releaseLockin interfaceLockManager- Parameters:
lockToken-resource-- Throws:
DavException- See Also:
LockManager.releaseLock(String, org.apache.jackrabbit.webdav.DavResource)
-
releaseLock
public void releaseLock(TransactionInfo lockInfo, String lockToken, TransactionResource resource) throws DavException
Release the lock identified by the given lock token.- Specified by:
releaseLockin interfaceTxLockManager- Parameters:
lockInfo-lockToken-resource-- Throws:
DavException
-
getLock
public ActiveLock getLock(Type type, Scope scope, DavResource resource)
Always returns null- Specified by:
getLockin interfaceLockManager- Parameters:
type-scope-resource-- Returns:
- null
- See Also:
getLock(Type, Scope, TransactionResource),LockManager.getLock(org.apache.jackrabbit.webdav.lock.Type, org.apache.jackrabbit.webdav.lock.Scope, org.apache.jackrabbit.webdav.DavResource)
-
hasLock
public boolean hasLock(String token, DavResource resource)
Returns true if the given lock token belongs to a lock that applies to the given resource, false otherwise. The token may either be retrieved from theLock-Token headeror from theTransactionId header.- Specified by:
hasLockin interfaceLockManager- Parameters:
token-resource-- Returns:
- See Also:
LockManager.hasLock(String token, DavResource resource)
-
getLock
public ActiveLock getLock(Type type, Scope scope, TransactionResource resource)
Return the lock applied to the given resource ornull- Specified by:
getLockin interfaceTxLockManager- Parameters:
type-scope-resource-- Returns:
- lock applied to the given resource or
null - See Also:
todo: is it correct to return one that specific lock, the current session is token-holder of?
-
addTransactionListener
public void addTransactionListener(TransactionListener listener)
Adds a transaction listener to thisTxLockManager.- Parameters:
listener- the listener to add.
-
removeTransactionListener
public void removeTransactionListener(TransactionListener listener)
Removes a transaction listener from thisTxLockManager.- Parameters:
listener- the listener to remove.
-
-