Package org.apache.jackrabbit.jcr2spi.hierarchy

Examples of org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntry


               checkIncludesMixReferenceable(nodeInfo);

               // potential uuid conflict
               try {
                   NodeId conflictingId = session.getIdFactory().createNodeId(nodeInfo.getUUID());
                   HierarchyEntry conflicting = session.getHierarchyManager().getHierarchyEntry(conflictingId);
                   // assert that the entry is available
                   conflicting.getItemState();

                   nodeState = resolveUUIDConflict(parent, (NodeEntry) conflicting, nodeInfo);
               } catch (ItemNotFoundException e) {
                   // no conflict: create new with given uuid
                   nodeState = importNode(nodeInfo, parent);
View Full Code Here


     * <code>null</code> in case there are no more items.
     */
    private Item prefetchNext() {
        Item nextItem = null;
        while (nextItem == null && iter.hasNext()) {
            HierarchyEntry entry = (HierarchyEntry) iter.next();
            try {
                nextItem = itemMgr.getItem(entry);
            } catch (ItemNotFoundException e) {
                log.debug("Ignoring nonexistent item " + entry);
                // reduce the size ... and try the next one
View Full Code Here

        }

        // skip the first (skipNum - 1) items without actually retrieving them
        while (--skipNum > 0) {
            pos++;
            HierarchyEntry entry = (HierarchyEntry) iter.next();
            // check if item exists but don't build Item instance.
            while (!itemMgr.itemExists(entry)) {
                log.debug("Ignoring nonexistent item " + entry);
                entry = (HierarchyEntry) iter.next();
            }
View Full Code Here

    /**
     * @see ItemManager#getItem(Path)
     */
    public synchronized Item getItem(Path path)
            throws PathNotFoundException, AccessDeniedException, RepositoryException {
        HierarchyEntry itemEntry = hierMgr.getHierarchyEntry(path);
        try {
            return getItem(itemEntry);
        } catch (ItemNotFoundException infe) {
            throw new PathNotFoundException(LogUtil.safeGetJCRPath(path, session.getPathResolver()));
        }
View Full Code Here

     */
    private Node getNodeById(NodeId id) throws ItemNotFoundException, RepositoryException {
        // check sanity of this session
        checkIsAlive();
        try {
            HierarchyEntry hierarchyEntry = getHierarchyManager().getHierarchyEntry(id);
            Item item = getItemManager().getItem(hierarchyEntry);
            if (item.isNode()) {
                return (Node) item;
            } else {
                log.error("NodeId '" + id + " does not point to a Node");
View Full Code Here

     *
     * @param state
     * @throws RepositoryException
     */
    private static void updateId(ItemState state) throws RepositoryException {
        HierarchyEntry he = state.getHierarchyEntry();
        while (he.getStatus() != Status.INVALIDATED) {
            he = he.getParent();
            if (he == null) {
                // root reached without intermediate invalidated entry
                return;
            }
        }
        // he is INVALIDATED -> force reloading in order to be aware of id changes
        he.getItemState();
    }
View Full Code Here

        if (version.getSession() == this) {
            nodeState = (NodeState) ((NodeImpl) version).getItemState();
        } else {
            Path p = getQPath(version.getPath());
            Path parentPath = p.getAncestor(1);
            HierarchyEntry parentEntry = getHierarchyManager().lookup(parentPath);
            if (parentEntry != null) {
                // make sure the parent entry is up to date
                parentEntry.invalidate(false);
            }
            nodeState = getHierarchyManager().getNodeState(p);
        }
        return nodeState;
    }
View Full Code Here

        if (version.getSession() == this) {
            nodeState = (NodeState) ((NodeImpl) version).getItemState();
        } else {
            Path p = getQPath(version.getPath());
            Path parentPath = p.getAncestor(1);
            HierarchyEntry parentEntry = getHierarchyManager().lookup(parentPath);
            if (parentEntry != null) {
                // make sure the parent entry is up to date
                parentEntry.invalidate(false);
            }
            nodeState = getHierarchyManager().getNodeState(p);
        }
        return nodeState;
    }
View Full Code Here

     *
     * @param state
     * @throws RepositoryException
     */
    private static void updateId(ItemState state) throws RepositoryException {
        HierarchyEntry he = state.getHierarchyEntry();
        while (he.getStatus() != Status.INVALIDATED) {
            he = he.getParent();
            if (he == null) {
                // root reached without intermediate invalidated entry
                return;
            }
        }
        // he is INVALIDATED -> force reloading in order to be aware of id changes
        he.getItemState();
    }
View Full Code Here

        assert status == STATUS_PENDING;
        status = STATUS_PERSISTED;
        if (isActivityMerge()) {
            // TODO be more specific about what needs to be invalidated
            // look for the root entry and invalidate the complete tree
            HierarchyEntry entry = nodeState.getNodeEntry();
            while (entry.getParent() != null) {
                entry = entry.getParent();
            }
            entry.invalidate(true);
        } else {
            try {
                NodeEntry vhe = mgr.getVersionHistoryEntry(nodeState);
                if (vhe != null) {
                    vhe.invalidate(true);
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.