|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Lock
Represents a lock placed on an item.
Method Summary | |
---|---|
java.lang.String |
getLockOwner()
Returns the value of the jcr:lockOwner property. |
java.lang.String |
getLockToken()
May return the lock token for this lock. |
Node |
getNode()
Returns the lock holding node. |
long |
getSecondsRemaining()
Returns the number of seconds remaining until this locks times out. |
boolean |
isDeep()
Returns true if this is a deep lock; false
otherwise. |
boolean |
isLive()
Returns true if this Lock object represents a lock that is
currently in effect. |
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. |
boolean |
isSessionScoped()
Returns true if this is a session-scoped lock and the scope
is bound to the current session. |
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. |
Method Detail |
---|
java.lang.String getLockOwner()
jcr:lockOwner
property. This is
either the client supplied owner information (see LockManager.lock(String, boolean, boolean, long, String)
), an
implementation-dependent string identifying the user who either created
the lock or who is bound to the session holding the lock, or
null
if none of these are available. 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.
boolean isDeep()
true
if this is a deep lock; false
otherwise.
Node getNode()
N.getLock().getNode()
(where N
is a locked node) will only return N
if N
is the lock holder. If N
is in the
subgraph of the lock holder, H
, then this call will return
H
.
Node
.java.lang.String getLockToken()
null
.
String
.long getSecondsRemaining() throws RepositoryException
Long.MAX_VALUE
is returned.
RepositoryException
- if an error occurs.boolean isLive() throws RepositoryException
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
.
boolean
.
RepositoryException
- if an error occurs.boolean isSessionScoped()
true
if this is a session-scoped lock and the scope
is bound to the current session. Returns false
otherwise.
boolean
.boolean isLockOwningSession()
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.
boolean
.void refresh() throws LockException, RepositoryException
LockException
- if this Session
does not hold the
correct lock token for this lock.
RepositoryException
- if another error occurs.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |