Interface LockInfo


  • public interface LockInfo
    Interface to represent WebDAV lock info. This interface mainly exists to allow decoupling of the LockStore classes from the rest of the WebDAV code base therefore allowing the LockStore related classes to live in the repository project without creating a dependency on the remote-api project.
    Author:
    Matt Ward
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addSharedLockToken​(java.lang.String token)
      Adds new shared lock token to sharedLockTokens list.
      java.lang.String getDepth()
      Returns lock depth
      java.lang.String getExclusiveLockToken()
      Getter for exclusive lock token.
      java.util.Date getExpires()
      Retrieve the expiry date/time for this lock, or null if it never expires.
      java.lang.String getOwner()
      Retrieves the username of the lock owner.
      long getRemainingTimeoutSeconds()
      Retrieve the remaining time before the lock expires, in seconds
      java.lang.String getScope()
      Returns lock scope
      java.util.Set<java.lang.String> getSharedLockTokens()
      Getter for sharedLockTokens list.
      boolean isExclusive()
      Is it an exclusive lock?
      boolean isExpired()
      Whether this lock has expired.
      boolean isLocked()
      Returns true if node has shared or exclusive locks
      boolean isShared()
      Is it a shared lock?
      void setDepth​(java.lang.String depth)
      Setter for lock depth
      void setExclusiveLockToken​(java.lang.String token)
      Setter for exclusive lock token
      void setExpires​(java.util.Date expires)
      Set the expiry date/time for this lock.
      void setOwner​(java.lang.String owner)
      Set the username of who owns the lock.
      void setScope​(java.lang.String scope)
      Setter for lock scope.
      void setSharedLockTokens​(java.util.Set<java.lang.String> sharedLockTokens)
      Setter for sharedLockTokens list.
      void setTimeoutMinutes​(int lockTimeoutMins)
      Sets the expiry date/time to lockTimeout minutes into the future.
      void setTimeoutSeconds​(int lockTimeoutSecs)
      Sets the expiry date/time to lockTimeout seconds into the future.
      java.lang.String toJSON()
      Return the lock info as a JSON string
    • Method Detail

      • isLocked

        boolean isLocked()
        Returns true if node has shared or exclusive locks
        Returns:
        boolean
      • setExclusiveLockToken

        void setExclusiveLockToken​(java.lang.String token)
        Setter for exclusive lock token
        Parameters:
        token - Lock token
      • getExclusiveLockToken

        java.lang.String getExclusiveLockToken()
        Getter for exclusive lock token.
        Returns:
        String
      • setScope

        void setScope​(java.lang.String scope)
        Setter for lock scope.
        Parameters:
        scope - String
      • getScope

        java.lang.String getScope()
        Returns lock scope
        Returns:
        lock scope
      • setDepth

        void setDepth​(java.lang.String depth)
        Setter for lock depth
        Parameters:
        depth - lock depth
      • getDepth

        java.lang.String getDepth()
        Returns lock depth
        Returns:
        lock depth
      • getSharedLockTokens

        java.util.Set<java.lang.String> getSharedLockTokens()
        Getter for sharedLockTokens list.
      • setSharedLockTokens

        void setSharedLockTokens​(java.util.Set<java.lang.String> sharedLockTokens)
        Setter for sharedLockTokens list.
      • addSharedLockToken

        void addSharedLockToken​(java.lang.String token)
        Adds new shared lock token to sharedLockTokens list.
        Parameters:
        token - The token to add.
      • isShared

        boolean isShared()
        Is it a shared lock?
        Returns:
        true if shared.
      • toJSON

        java.lang.String toJSON()
        Return the lock info as a JSON string
        Returns:
        String
      • isExpired

        boolean isExpired()
        Whether this lock has expired. If no expiry is set (i.e. expires is null) then false is always returned.
        Returns:
        true if expired.
      • isExclusive

        boolean isExclusive()
        Is it an exclusive lock?
        Returns:
        true if exclusive.
      • getOwner

        java.lang.String getOwner()
        Retrieves the username of the lock owner.
        Returns:
        the owner
      • setOwner

        void setOwner​(java.lang.String owner)
        Set the username of who owns the lock.
        Parameters:
        owner - Owner's username
      • setExpires

        void setExpires​(java.util.Date expires)
        Set the expiry date/time for this lock. Set to null for never expires.
        Parameters:
        expires - the expires to set
      • getExpires

        java.util.Date getExpires()
        Retrieve the expiry date/time for this lock, or null if it never expires.
        Returns:
        the expires
      • getRemainingTimeoutSeconds

        long getRemainingTimeoutSeconds()
        Retrieve the remaining time before the lock expires, in seconds
        Returns:
        long
      • setTimeoutSeconds

        void setTimeoutSeconds​(int lockTimeoutSecs)
        Sets the expiry date/time to lockTimeout seconds into the future. Provide a lockTimeout of WebDAV.TIMEOUT_INFINITY for never expires.
        Parameters:
        lockTimeoutSecs - int
      • setTimeoutMinutes

        void setTimeoutMinutes​(int lockTimeoutMins)
        Sets the expiry date/time to lockTimeout minutes into the future. Provide a lockTimeout of WebDAV.TIMEOUT_INFINITY for never expires.
        Parameters:
        lockTimeoutMins - int