Interface WebDAVLockService

  • All Known Implementing Classes:
    WebDAVLockServiceImpl

    public interface 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, Matt Ward
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String BEAN_NAME  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      org.alfresco.repo.webdav.LockInfo getLockInfo​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
      Gets the lock info 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 setCurrentSession​(javax.servlet.http.HttpSession session)
      Caches current session in a thread local variable.
      void unlock​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
      Shared method for webdav/vti to unlock node.
    • Method Detail

      • sessionDestroyed

        void sessionDestroyed()
      • lock

        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.
        Parameters:
        nodeRef - the node to lock
        userName - the current user's user name
        timeout - the number of seconds before the locks expires
      • lock

        void lock​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                  org.alfresco.repo.webdav.LockInfo lockInfo)
      • unlock

        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.
        Parameters:
        nodeRef - the node to lock
      • getLockInfo

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

        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.

        Returns:
        true if the node is locked AND it's not a WRITE_LOCK for the current user
      • setCurrentSession

        void setCurrentSession​(javax.servlet.http.HttpSession session)
        Caches current session in a thread local variable.
        Parameters:
        session - HttpSession