| javax.jcr.lock.Lock
Lock | public interface Lock (Code) | | Represents a lock placed on an item.
|
Method Summary | |
public String | getLockOwner() Returns the user ID of the user who owns this lock. | public String | getLockToken() May return the lock token for this lock. | public Node | getNode() Returns the lock holding node. | public boolean | isDeep() Returns true if this is a deep lock; false otherwise. | public boolean | isLive() Returns true if this Lock object represents a lock that is currently in effect.
If this lock has been unlocked either explicitly or due to an implementation-specific limitation
(like a timeout) then it returns false . | public boolean | isLockOwningSession() Returns true if the current session is the owner of this
lock, either because it is session-scoped and bound to this session or
open-scoped and this session currently holds the token for this lock. | public boolean | isSessionScoped() Returns true if this is a session-scoped lock and the scope is bound to
the current session. | public void | refresh() If this lock's time-to-live is governed by a timer, this method resets that timer so that the
lock does not timeout and expire. |
getLockOwner | public String getLockOwner()(Code) | | Returns the user ID of the user who owns this lock. This is the value of the
jcr:lockOwner property of the lock-holding node. It is also the
value returned by Session.getUserID at the time that the lock was
placed. The lock owner's identity is only provided for informational purposes.
It does not govern who can perform an unlock or make changes to the locked nodes;
that depends entirely upon who the token holder is.
a user ID. |
getLockToken | public String getLockToken()(Code) | | May return the lock token for this lock. If this lock is open-scoped and
the current session holds the lock token for this lock, then this method
will return that lock token. Otherwise this method will return
null .
a String . |
getNode | public Node getNode()(Code) | | Returns the lock holding node. Note that N.getLock().getNode()
(where N is a locked node) will only return N
if N is the lock holder. If N is in the subtree
of the lock holder, H , then this call will return H .
an Node . |
isDeep | public boolean isDeep()(Code) | | Returns true if this is a deep lock; false otherwise.
a boolean |
isLive | public boolean isLive() throws RepositoryException(Code) | | Returns true if this Lock object represents a lock that is currently in effect.
If this lock has been unlocked either explicitly or due to an implementation-specific limitation
(like a timeout) then it returns false . Note that this method is intended for
those cases where one is holding a Lock Java object and wants to find out
whether the lock (the JCR-level entity that is attached to the lockable node) that this
object originally represented still exists. For example, a timeout or explicit
unlock will remove a lock from a node but the Lock
Java object corresponding to that lock may still exist, and in that case its
isLive method will return false .
a boolean . throws: RepositoryException - if an error occurs. |
isLockOwningSession | public boolean isLockOwningSession()(Code) | | Returns true if the current session is the owner of this
lock, either because it is session-scoped and bound to this session or
open-scoped and this session currently holds the token for this lock.
Returns false otherwise.
a boolean . since: JCR 2.0 |
isSessionScoped | public boolean isSessionScoped()(Code) | | Returns true if this is a session-scoped lock and the scope is bound to
the current session. Returns false if this is an open-scoped lock or is
session-scoped but the scope is bound to another session.
a boolean . |
refresh | public void refresh() throws LockException, RepositoryException(Code) | | If this lock's time-to-live is governed by a timer, this method resets that timer so that the
lock does not timeout and expire. If this lock's time-to-live is not governed by a timer,
then this method has no effect.
A LockException is thrown if this Session does not hold the correct lock token for this lock.
throws: LockException - if this Session does not hold the correct lock token for this lock. throws: RepositoryException - if another error occurs. |
|
|