/** * Find the next access control ancestor in the hierarchy 'null' indicates * that there is no ac-controlled ancestor. * * @param node The target node for which the cache needs to be updated. * @return The NodeId of the next access controlled ancestor in the hierarchy * or null */ private NodeId getNextID(NodeImpl node) throws RepositoryException { NodeImpl n = node; NodeId nextId = null; while (nextId == null && !isRootId(n.getNodeId())) { NodeId parentId = n.getParentId(); if (cache.containsKey(parentId)) { nextId = parentId; } else { NodeImpl parent = (NodeImpl) n.getParent(); if (hasEntries(parent)) { nextId = parentId; } else { // try next ancestor n = parent; } } } return nextId; }
/** * Find the next access control ancestor in the hierarchy 'null' indicates * that there is no ac-controlled ancestor. * * @param node The target node for which the cache needs to be updated. * @return The NodeId of the next access controlled ancestor in the hierarchy * or null */ private NodeId getNextID(NodeImpl node) throws RepositoryException { NodeImpl n = node; NodeId nextId = null; while (nextId == null && !isRootId(n.getNodeId())) { NodeId parentId = n.getParentId(); if (cache.containsKey(parentId)) { nextId = parentId; } else { NodeImpl parent = (NodeImpl) n.getParent(); if (hasEntries(parent)) { nextId = parentId; } else { // try next ancestor n = parent; } } } return nextId; }