public interface LockManager
Modifier and Type | Method and Description |
---|---|
void |
addLockToken(SessionImpl session,
String lt)
Invoked by a session to inform that a lock token has been added.
|
void |
checkLock(NodeImpl node)
Check whether the node given is locked by somebody else than the
current session.
|
void |
checkLock(Path path,
javax.jcr.Session session)
Check whether the path given is locked by somebody else than the
session described.
|
void |
checkUnlock(javax.jcr.Session session,
NodeImpl node)
Check whether a session is allowed to unlock a node.
|
javax.jcr.lock.Lock |
getLock(NodeImpl node)
Returns the Lock object that applies to a node.
|
javax.jcr.lock.Lock[] |
getLocks(SessionImpl session)
Returns all locks owned by the specified session.
|
boolean |
holdsLock(NodeImpl node)
Returns
true if the node given holds a lock;
otherwise returns false . |
boolean |
isLocked(NodeImpl node)
Returns
true if this node is locked either as a result
of a lock held by this node or by a deep lock on a node above this
node; otherwise returns false |
javax.jcr.lock.Lock |
lock(NodeImpl node,
boolean isDeep,
boolean isSessionScoped)
Lock a node.
|
javax.jcr.lock.Lock |
lock(NodeImpl node,
boolean isDeep,
boolean isSessionScoped,
long timeoutHint,
String ownerInfo)
Lock a node.
|
void |
removeLockToken(SessionImpl session,
String lt)
Invoked by a session to inform that a lock token has been removed.
|
void |
unlock(NodeImpl node)
Removes the lock on a node given by its path.
|
javax.jcr.lock.Lock lock(NodeImpl node, boolean isDeep, boolean isSessionScoped) throws javax.jcr.lock.LockException, javax.jcr.RepositoryException
node
- nodeisDeep
- whether the lock applies to this node onlyisSessionScoped
- whether the lock is session scopedjavax.jcr.lock.LockException
- if this node already is locked, or some descendant
node is locked and isDeep
is true
javax.jcr.RepositoryException
Node.lock(boolean, boolean)
javax.jcr.lock.Lock lock(NodeImpl node, boolean isDeep, boolean isSessionScoped, long timeoutHint, String ownerInfo) throws javax.jcr.lock.LockException, javax.jcr.RepositoryException
node
- Node to create the lock for.isDeep
- whether the lock applies to this node onlyisSessionScoped
- whether the lock is session scopedtimeoutHint
- Desired lock timeout in seconds.ownerInfo
- Optional string acting as information about the owner.javax.jcr.lock.LockException
- if this node already is locked, or some descendant
node is locked and isDeep
is true
javax.jcr.RepositoryException
LockManager.lock(String, boolean, boolean, long, String)
javax.jcr.lock.Lock getLock(NodeImpl node) throws javax.jcr.lock.LockException, javax.jcr.RepositoryException
node
- nodejavax.jcr.lock.LockException
- if this node is not lockedjavax.jcr.RepositoryException
Node.getLock()
javax.jcr.lock.Lock[] getLocks(SessionImpl session) throws javax.jcr.RepositoryException
session
- sessionjavax.jcr.RepositoryException
- if an error occursSessionImpl.getLocks()
void unlock(NodeImpl node) throws javax.jcr.lock.LockException, javax.jcr.RepositoryException
node
- nodejavax.jcr.lock.LockException
- if this node is not locked or the session
does not have the correct lock tokenjavax.jcr.RepositoryException
Node.unlock()
boolean holdsLock(NodeImpl node) throws javax.jcr.RepositoryException
true
if the node given holds a lock;
otherwise returns false
.node
- nodetrue
if the node given holds a lock;
otherwise returns false
javax.jcr.RepositoryException
- If an exception occurs.Node.holdsLock()
boolean isLocked(NodeImpl node) throws javax.jcr.RepositoryException
true
if this node is locked either as a result
of a lock held by this node or by a deep lock on a node above this
node; otherwise returns false
node
- nodetrue
if this node is locked either as a result
of a lock held by this node or by a deep lock on a node above this
node; otherwise returns false
javax.jcr.RepositoryException
- If an exception occurs.Node.isLocked()
void checkLock(NodeImpl node) throws javax.jcr.lock.LockException, javax.jcr.RepositoryException
node
- node to checkjavax.jcr.lock.LockException
- if write access to the specified node is not allowedjavax.jcr.RepositoryException
- if some other error occursvoid checkLock(Path path, javax.jcr.Session session) throws javax.jcr.lock.LockException, javax.jcr.RepositoryException
path
- path to checksession
- sessionjavax.jcr.lock.LockException
- if write access to the specified path is not allowedjavax.jcr.RepositoryException
- if some other error occursvoid checkUnlock(javax.jcr.Session session, NodeImpl node) throws javax.jcr.lock.LockException, javax.jcr.RepositoryException
javax.jcr.lock.LockException
- if unlocking is deniedjavax.jcr.RepositoryException
- if some other error occursvoid addLockToken(SessionImpl session, String lt) throws javax.jcr.lock.LockException, javax.jcr.RepositoryException
session
- session that has a added lock tokenlt
- added lock tokenjavax.jcr.lock.LockException
javax.jcr.RepositoryException
void removeLockToken(SessionImpl session, String lt) throws javax.jcr.lock.LockException, javax.jcr.RepositoryException
session
- session that has a removed lock tokenlt
- removed lock tokenjavax.jcr.lock.LockException
javax.jcr.RepositoryException
Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.