Package org.alfresco.repo.webdav
Class WebDAVLockServiceImpl
- java.lang.Object
-
- org.alfresco.repo.webdav.WebDAVLockServiceImpl
-
- All Implemented Interfaces:
WebDAVLockService
public class WebDAVLockServiceImpl extends Object implements WebDAVLockService
WebDAVLockService is used to manage file locks for WebDAV and Sharepoint protocol. It ensures a lock never persists for more than 24 hours, and also ensures locks are timed out on session timeout.
- Author:
- Pavel.Yurkevich
-
-
Field Summary
-
Fields inherited from interface org.alfresco.repo.webdav.WebDAVLockService
BEAN_NAME
-
-
Constructor Summary
Constructors Constructor Description WebDAVLockServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LockInfo
getLockInfo(NodeRef nodeRef)
Gets the lock status for the node reference relative to the current user.boolean
isLockedAndReadOnly(NodeRef nodeRef)
Determines if the node is locked AND it's not a WRITE_LOCK for the current user.void
lock(NodeRef nodeRef, String userName, int timeout)
Shared method for webdav/vti protocols to lock node.void
lock(NodeRef nodeRef, LockInfo lockInfo)
void
sessionDestroyed()
void
setCheckOutCheckInService(CheckOutCheckInService checkOutCheckInService)
Set the CheckOutCheckInServicevoid
setCurrentSession(javax.servlet.http.HttpSession session)
Caches current session to the thread local variablevoid
setLockService(LockService lockService)
Set the LockServicevoid
setNodeService(NodeService nodeService)
Set the NodeServicevoid
setTransactionService(TransactionService transactionService)
Set the TransactionServicevoid
unlock(NodeRef nodeRef)
Shared method for webdav/vti to unlock node.
-
-
-
Method Detail
-
setLockService
public void setLockService(LockService lockService)
Set the LockService- Parameters:
lockService
- LockService
-
setNodeService
public void setNodeService(NodeService nodeService)
Set the NodeService- Parameters:
nodeService
- NodeService
-
setTransactionService
public void setTransactionService(TransactionService transactionService)
Set the TransactionService- Parameters:
transactionService
- TransactionService
-
setCheckOutCheckInService
public void setCheckOutCheckInService(CheckOutCheckInService checkOutCheckInService)
Set the CheckOutCheckInService- Parameters:
checkOutCheckInService
- CheckOutCheckInService
-
setCurrentSession
public void setCurrentSession(javax.servlet.http.HttpSession session)
Caches current session to the thread local variable- Specified by:
setCurrentSession
in interfaceWebDAVLockService
- Parameters:
session
- HttpSession
-
sessionDestroyed
public void sessionDestroyed()
- Specified by:
sessionDestroyed
in interfaceWebDAVLockService
-
lock
public void lock(NodeRef nodeRef, LockInfo lockInfo)
- Specified by:
lock
in interfaceWebDAVLockService
-
lock
public void lock(NodeRef nodeRef, String userName, int timeout)
Shared method for webdav/vti protocols to lock node. If node is locked for more than 24 hours it is automatically added to the current session locked resources list.- Specified by:
lock
in interfaceWebDAVLockService
- Parameters:
nodeRef
- the node to lockuserName
- userNametimeout
- the number of seconds before the locks expires
-
unlock
public void unlock(NodeRef nodeRef)
Shared method for webdav/vti to unlock node. Unlocked node is automatically removed from current sessions's locked resources list.- Specified by:
unlock
in interfaceWebDAVLockService
- Parameters:
nodeRef
- the node to lock
-
getLockInfo
public LockInfo getLockInfo(NodeRef nodeRef)
Gets the lock status for the node reference relative to the current user.- Specified by:
getLockInfo
in interfaceWebDAVLockService
- Parameters:
nodeRef
- the node reference- Returns:
- the lock status
- See Also:
LockService.getLockStatus(org.alfresco.service.cmr.repository.NodeRef, String)
-
isLockedAndReadOnly
public boolean isLockedAndReadOnly(NodeRef nodeRef)
Determines if the node is locked AND it's not a WRITE_LOCK for the current user.- Specified by:
isLockedAndReadOnly
in interfaceWebDAVLockService
- Returns:
- true if the node is locked AND it's not a WRITE_LOCK for the current user
-
-