Class LockInfoImpl

java.lang.Object
org.apache.jackrabbit.spi.commons.LockInfoImpl
All Implemented Interfaces:
Serializable, LockInfo

public class LockInfoImpl extends Object implements LockInfo, Serializable
LockInfoImpl implements a serializable LockInfo based on another lock info.
See Also:
  • Constructor Details

    • LockInfoImpl

      public LockInfoImpl(String lockToken, String lockOwner, boolean isDeep, boolean isSessionScoped, NodeId nodeId)
      Creates a new lock info for the given lock info.
      Parameters:
      lockToken - the lock token
      lockOwner - the lock owner
      isDeep - whether this lock is deep or not
      isSessionScoped - whether this lock is session scoped or not
      nodeId - the node id of the locked node.
    • LockInfoImpl

      public LockInfoImpl(String lockToken, String lockOwner, boolean isDeep, boolean isSessionScoped, long secondsRemaining, boolean isLockOwner, NodeId nodeId)
      Creates a new lock info for the given lock info.
      Parameters:
      lockToken - the lock token
      lockOwner - the lock owner
      isDeep - whether this lock is deep or not
      isSessionScoped - whether this lock is session scoped or not
      secondsRemaining - Number of seconds until the lock timeout is reached.
      isLockOwner - true if the calling session is lock owner; false otherwise.
      nodeId - the node id of the locked node.
      Since:
      JCR 2.0
  • Method Details

    • getLockToken

      public String getLockToken()
      Returns the lock token for this lock or null if the token should not be exposed to the API user.
      Specified by:
      getLockToken in interface LockInfo
      Returns:
      lock token or null
      See Also:
    • getOwner

      public String getOwner()
      Returns the user ID of the user who owns this lock or some user defined information about the lock owner.
      Specified by:
      getOwner in interface LockInfo
      Returns:
      user ID of the user who owns this lock.
      See Also:
    • isDeep

      public boolean isDeep()
      Returns true if the Lock is deep. False otherwise.
      Specified by:
      isDeep in interface LockInfo
      Returns:
      true if the Lock is deep. False otherwise.
      See Also:
    • isSessionScoped

      public boolean isSessionScoped()
      Returns true if the Lock is session scoped. False otherwise.
      Specified by:
      isSessionScoped in interface LockInfo
      Returns:
      true if the Lock is session scoped. False otherwise.
      See Also:
    • getSecondsRemaining

      public long getSecondsRemaining()
      Returns the seconds remaining until the lock times out or (Long.MAX_VALUE if the timeout is unknown or infinite).
      Specified by:
      getSecondsRemaining in interface LockInfo
      Returns:
      number of seconds until the lock times out.
      See Also:
    • isLockOwner

      public boolean isLockOwner()
      Returns true if the SessionInfo used to retrieve this LockInfo is the lock holder and thus enabled to refresh or release the lock.
      Specified by:
      isLockOwner in interface LockInfo
      Returns:
      true if the SessionInfo used to retrieve this LockInfo is the lock holder.
      See Also:
    • getNodeId

      public NodeId getNodeId()
      Returns the NodeId of the lock-holding Node.
      Specified by:
      getNodeId in interface LockInfo
      Returns:
      the NodeId of the lock-holding Node.