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 Details

    • isLocked

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

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

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

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

      String getScope()
      Returns lock scope
      Returns:
      lock scope
    • setDepth

      void setDepth(String depth)
      Setter for lock depth
      Parameters:
      depth - lock depth
    • getDepth

      String getDepth()
      Returns lock depth
      Returns:
      lock depth
    • getSharedLockTokens

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

      void setSharedLockTokens(Set<String> sharedLockTokens)
      Setter for sharedLockTokens list.
    • addSharedLockToken

      void addSharedLockToken(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

      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

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

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

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

      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