Class WebDAVLockServiceImpl

  • All Implemented Interfaces:
    WebDAVLockService

    public class WebDAVLockServiceImpl
    extends java.lang.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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.alfresco.repo.webdav.LockInfo getLockInfo​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
      Gets the lock status for the node reference relative to the current user.
      boolean isLockedAndReadOnly​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
      Determines if the node is locked AND it's not a WRITE_LOCK for the current user.
      void lock​(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.lang.String userName, int timeout)
      Shared method for webdav/vti protocols to lock node.
      void lock​(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.repo.webdav.LockInfo lockInfo)  
      void sessionDestroyed()  
      void setCheckOutCheckInService​(org.alfresco.service.cmr.coci.CheckOutCheckInService checkOutCheckInService)
      Set the CheckOutCheckInService
      void setCurrentSession​(javax.servlet.http.HttpSession session)
      Caches current session to the thread local variable
      void setLockService​(org.alfresco.service.cmr.lock.LockService lockService)
      Set the LockService
      void setNodeService​(org.alfresco.service.cmr.repository.NodeService nodeService)
      Set the NodeService
      void setTransactionService​(org.alfresco.service.transaction.TransactionService transactionService)
      Set the TransactionService
      void unlock​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
      Shared method for webdav/vti to unlock node.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WebDAVLockServiceImpl

        public WebDAVLockServiceImpl()
    • Method Detail

      • setLockService

        public void setLockService​(org.alfresco.service.cmr.lock.LockService lockService)
        Set the LockService
        Parameters:
        lockService - LockService
      • setNodeService

        public void setNodeService​(org.alfresco.service.cmr.repository.NodeService nodeService)
        Set the NodeService
        Parameters:
        nodeService - NodeService
      • setTransactionService

        public void setTransactionService​(org.alfresco.service.transaction.TransactionService transactionService)
        Set the TransactionService
        Parameters:
        transactionService - TransactionService
      • setCheckOutCheckInService

        public void setCheckOutCheckInService​(org.alfresco.service.cmr.coci.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 interface WebDAVLockService
        Parameters:
        session - HttpSession
      • lock

        public void lock​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                         org.alfresco.repo.webdav.LockInfo lockInfo)
        Specified by:
        lock in interface WebDAVLockService
      • lock

        public void lock​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                         java.lang.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 interface WebDAVLockService
        Parameters:
        nodeRef - the node to lock
        userName - userName
        timeout - the number of seconds before the locks expires
      • unlock

        public void unlock​(org.alfresco.service.cmr.repository.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 interface WebDAVLockService
        Parameters:
        nodeRef - the node to lock
      • getLockInfo

        public org.alfresco.repo.webdav.LockInfo getLockInfo​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Gets the lock status for the node reference relative to the current user.
        Specified by:
        getLockInfo in interface WebDAVLockService
        Parameters:
        nodeRef - the node reference
        Returns:
        the lock status
        See Also:
        LockService.getLockStatus(org.alfresco.service.cmr.repository.NodeRef, String)
      • isLockedAndReadOnly

        public boolean isLockedAndReadOnly​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Determines if the node is locked AND it's not a WRITE_LOCK for the current user.

        Specified by:
        isLockedAndReadOnly in interface WebDAVLockService
        Returns:
        true if the node is locked AND it's not a WRITE_LOCK for the current user