|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LockManager
Defines the functionality needed for locking and unlocking nodes.
Method Summary | |
---|---|
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,
Session session)
Check whether the path given is locked by somebody else than the session described. |
void |
checkUnlock(Session session,
NodeImpl node)
Returns true if the specified session is allowed to unlock
the node; otherwise returns false . |
Lock |
getLock(NodeImpl node)
Returns the Lock object that applies to a node. |
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 |
Lock |
lock(NodeImpl node,
boolean isDeep,
boolean isSessionScoped)
Lock a node. |
Lock |
lock(NodeImpl node,
boolean isDeep,
boolean isSessionScoped,
long timoutHint,
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. |
Method Detail |
---|
Lock lock(NodeImpl node, boolean isDeep, boolean isSessionScoped) throws LockException, RepositoryException
node
- nodeisDeep
- whether the lock applies to this node onlyisSessionScoped
- whether the lock is session scoped
LockException
- if this node already is locked, or some descendant
node is locked and isDeep
is true
RepositoryException
Node.lock(boolean, boolean)
Lock lock(NodeImpl node, boolean isDeep, boolean isSessionScoped, long timoutHint, String ownerInfo) throws LockException, RepositoryException
node
- Node to create the lock for.isDeep
- whether the lock applies to this node onlyisSessionScoped
- whether the lock is session scopedtimoutHint
- Desired lock timeout in seconds.ownerInfo
- Optional string acting as information about the owner.
LockException
- if this node already is locked, or some descendant
node is locked and isDeep
is true
RepositoryException
LockManager.lock(String, boolean, boolean, long, String)
Lock getLock(NodeImpl node) throws LockException, RepositoryException
node
- node
LockException
- if this node is not locked
RepositoryException
Node.getLock()
Lock[] getLocks(SessionImpl session) throws RepositoryException
session
- session
RepositoryException
- if an error occursSessionImpl.getLocks()
void unlock(NodeImpl node) throws LockException, RepositoryException
node
- node
LockException
- if this node is not locked or the session
does not have the correct lock token
RepositoryException
Node.unlock()
boolean holdsLock(NodeImpl node) throws RepositoryException
true
if the node given holds a lock;
otherwise returns false
.
node
- node
true
if the node given holds a lock;
otherwise returns false
RepositoryException
- If an exception occurs.Node.holdsLock()
boolean isLocked(NodeImpl node) throws 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
- node
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
RepositoryException
- If an exception occurs.Node.isLocked()
void checkLock(NodeImpl node) throws LockException, RepositoryException
node
- node to check
LockException
- if write access to the specified node is not allowed
RepositoryException
- if some other error occursvoid checkLock(Path path, Session session) throws LockException, RepositoryException
path
- path to checksession
- session
LockException
- if write access to the specified path is not allowed
RepositoryException
- if some other error occursvoid checkUnlock(Session session, NodeImpl node) throws LockException, RepositoryException
true
if the specified session is allowed to unlock
the node; otherwise returns false
.
session
- sessionnode
- node
LockException
- if write access to the specified path is not allowed
RepositoryException
- if some other error occursvoid addLockToken(SessionImpl session, String lt) throws LockException, RepositoryException
session
- session that has a added lock tokenlt
- added lock token
LockException
RepositoryException
void removeLockToken(SessionImpl session, String lt) throws LockException, RepositoryException
session
- session that has a removed lock tokenlt
- removed lock token
LockException
RepositoryException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |