}
private LockInfo retrieveLockInfo(LockDiscovery lockDiscovery, SessionInfo sessionInfo,
NodeId nodeId, NodeId parentId) throws RepositoryException {
List<ActiveLock> activeLocks = lockDiscovery.getValue();
ActiveLock activeLock = null;
for (ActiveLock l : activeLocks) {
Scope sc = l.getScope();
if (l.getType() == Type.WRITE && (Scope.EXCLUSIVE.equals(sc) || sc == ItemResourceConstants.EXCLUSIVE_SESSION)) {
if (activeLock != null) {
throw new RepositoryException("Node " + saveGetIdString(nodeId, sessionInfo) + " contains multiple exclusive write locks.");
} else {
activeLock = l;
}
}
}
if (activeLock == null) {
log.debug("No lock present on node " + saveGetIdString(nodeId, sessionInfo));
return null;
}
if (activeLock.isDeep() && parentId != null) {
// try if lock is inherited
LockInfo pLockInfo = getLockInfo(sessionInfo, parentId);
if (pLockInfo != null) {
return pLockInfo;
}