private LockInfo retrieveLockInfo(LockDiscovery lockDiscovery, SessionInfo sessionInfo,
NodeId nodeId, NodeId parentId) throws RepositoryException {
List activeLocks = (List) lockDiscovery.getValue();
Iterator it = activeLocks.iterator();
ActiveLock activeLock = null;
while (it.hasNext()) {
ActiveLock l = (ActiveLock) it.next();
Scope sc = l.getScope();
if (l.getType() == Type.WRITE && (sc == Scope.EXCLUSIVE || sc == ItemResourceConstants.EXCLUSIVE_SESSION)) {
if (activeLock != null) {
throw new RepositoryException("Node " + saveGetIdString(nodeId, sessionInfo) + " contains multiple exclusive write locks.");
} else {
activeLock = l;
}