Package org.apache.jackrabbit.jcr2spi.hierarchy

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


        }

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

        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

        throws ItemNotFoundException, RepositoryException {
        this.itemMgr = itemMgr;
        List<HierarchyEntry> entries = new ArrayList<HierarchyEntry>();
        while (itemIds.hasNext()) {
            ItemId id = itemIds.next();
            HierarchyEntry entry;
            if (id.denotesNode()) {
                entry = hierarchyMgr.getNodeEntry((NodeId) id);
            } else {
                entry = hierarchyMgr.getPropertyEntry((PropertyId) id);
            }
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 = iter.next();
            try {
                nextItem = itemMgr.getItem(entry);
            } catch (RepositoryException e) {
                log.warn("Failed to fetch item " + entry.getName() + ", skipping.", e.getMessage());
                // reduce the size... and try the next one
                size--;
            }
        }
        return nextItem;
View Full Code Here

        }

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

                    targetEntry = getNodeEntry().getNodeEntry(pe.getName(), pe.getNormalizedIndex(), true);
                }
            } else {
                // rp length > 1
                Path p = getQPath(rp);
                HierarchyEntry entry = session.getHierarchyManager().getHierarchyEntry(p.getCanonicalPath());
                if (entry.denotesNode()) {
                    targetEntry = (NodeEntry) entry;
                } // else:  not a node
            }
        } catch (PathNotFoundException e) {
            // item does not exist -> ignore and return null
View Full Code Here

                targetEntry = getNodeEntry().getPropertyEntry(propName, true);
            } else {
                // build and resolve absolute path
                Path p = getQPath(rp).getCanonicalPath();
                try {
                    HierarchyEntry entry = session.getHierarchyManager().getHierarchyEntry(p);
                    if (!entry.denotesNode()) {
                        targetEntry = (PropertyEntry) entry;
                    } // else: not a property
                } catch (PathNotFoundException e) {
                    // ignore -> return null;
                }
View Full Code Here

     * @see Operation#persisted()
     */
    public void persisted() {
        if (removeExisting) {
            // invalidate the complete tree -> find root-hierarchy-entry
            HierarchyEntry he = destParentState.getHierarchyEntry();
            while (he.getParent() != null) {
                he = he.getParent();
            }
            he.invalidate(true);
        } else {
            super.persisted();
        }
    }
View Full Code Here

        NodeId lockNodeId = lockInfo.getNodeId();
        if (lockNodeId.equals(nId)) {
            lockHoldingState = nodeState;
        } else {
            HierarchyEntry lockedEntry = wspManager.getHierarchyManager().getHierarchyEntry(lockNodeId);
            if (lockedEntry.denotesNode()) {
                try {
                    lockHoldingState = ((NodeEntry) lockedEntry).getNodeState();
                } catch (RepositoryException e) {
                    log.warn("Cannot build LockState");
                    throw new RepositoryException("Cannot build LockState", e);
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.