Class DefaultActiveLock

java.lang.Object
org.apache.jackrabbit.webdav.lock.AbstractActiveLock
org.apache.jackrabbit.webdav.lock.DefaultActiveLock
All Implemented Interfaces:
DavConstants, ActiveLock, XmlSerializable
Direct Known Subclasses:
TxActiveLock

public class DefaultActiveLock extends AbstractActiveLock
DefaultActiveLock implements the ActiveLock interface and represents an exclusive write lock with a random uuid lock token. Lock owner, timeout and depth is retrieved from the LockInfo object passed in the constructor. If the lockinfo is null, the following default values are set:
 - timeout is set to infinity.
 - isDeep is set to true.
 
  • Constructor Details

    • DefaultActiveLock

      public DefaultActiveLock()
      Create a new DefaultActiveLock with default values.
    • DefaultActiveLock

      public DefaultActiveLock(LockInfo lockInfo)
      Create a new lock
      Parameters:
      lockInfo -
      Throws:
      IllegalArgumentException - if either scope or type is invalid.
  • Method Details

    • isLockedByToken

      public boolean isLockedByToken(String lockToken)
      Description copied from interface: ActiveLock
      Return true, if the given token matches the lock token present in this lock thus indicating that any lock relevant operation should not fail due to a lock.
      Parameters:
      lockToken - to be checked
      Returns:
      true if the given lock token matches.
      See Also:
    • isExpired

      public boolean isExpired()
      Description copied from interface: ActiveLock
      Returns true, if this lock is already expired.
      Returns:
      true if the lock is expired
      See Also:
    • getToken

      public String getToken()
      Description copied from interface: ActiveLock
      Return the lock token.
      Returns:
      token string representing the lock token.
      See Also:
    • getOwner

      public String getOwner()
      Description copied from interface: ActiveLock
      Return the name (or id) of the lock owner.
      Returns:
      name (or id) of the lock owner.
      See Also:
    • setOwner

      public void setOwner(String owner)
      Description copied from interface: ActiveLock
      Set the name (or id) of the lock owner
      Parameters:
      owner -
      See Also:
    • getTimeout

      public long getTimeout()
      Description copied from interface: ActiveLock
      Return the number of milliseconds the lock will live until it is expired or -1 if the timeout is not available (or the client is not allowed to retrieve it).
      Returns:
      number of milliseconds.
      See Also:
    • setTimeout

      public void setTimeout(long timeout)
      Description copied from interface: ActiveLock
      Defines the number of milliseconds until the timeout is reached.
      Parameters:
      timeout -
      See Also:
    • isDeep

      public boolean isDeep()
      Description copied from interface: ActiveLock
      Return true if the lock is deep.
      Returns:
      true if the lock is deep.
      See Also:
    • setIsDeep

      public void setIsDeep(boolean isDeep)
      Description copied from interface: ActiveLock
      Set the lock deepness.
      Parameters:
      isDeep -
      See Also:
    • getType

      public Type getType()
      This is always a write lock.
      Returns:
      the lock type
      See Also:
    • getScope

      public Scope getScope()
      This is always an exclusive lock.
      Returns:
      the lock scope.
      See Also: