Examples of HierarchyEntry


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

        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

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

     * <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

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.
            boolean itemExists = false;
            while(!itemExists){
                try{
                    itemExists = itemMgr.itemExists(entry);
View Full Code Here

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

        }

        Set<Operation> ops = new LinkedHashSet<Operation>();
        Set<ItemState> affectedStates = new LinkedHashSet<ItemState>();

        HierarchyEntry he = target.getHierarchyEntry();
        if (he.getParent() == null) {
            // the root entry -> the complete change log can be used for
            // simplicity. collecting ops, states can be omitted.
            if (throwOnStale && !staleStates.isEmpty()) {
                String msg = "Cannot save changes: States has been modified externally.";
                log.debug(msg);
View Full Code Here

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

     * @param parent
     * @param state
     * @return
     */
    private static boolean containedInTree(ItemState parent, ItemState state) {
        HierarchyEntry he = state.getHierarchyEntry();
        HierarchyEntry pHe = parent.getHierarchyEntry();
        // short cuts first
        if (he == pHe || he.getParent() == pHe) {
            return true;
        }
        if (!parent.isNode() || he == pHe.getParent()) {
            return false;
        }
        // none of the simple cases: walk up hierarchy
        HierarchyEntry pe = he.getParent();
        while (pe != null) {
            if (pe == pHe) {
                return true;
            }
            pe = pe.getParent();
        }

        // state isn't descendant of 'parent'
        return false;
    }
View Full Code Here

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

        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

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

            }
        }
        // process all remaining states that were not covered by the
        // operation persistence.
        for (ItemState state : affectedStates) {
            HierarchyEntry he = state.getHierarchyEntry();

            switch (state.getStatus()) {
                case Status.EXISTING_MODIFIED:
                    state.setStatus(Status.EXISTING);
                    if (state.isNode()) {
                        if (changedPrimaryTypes.contains(state)) {
                            // primary type changed for a node -> force reloading upon next
                            // access in order to be aware of modified definition etc...
                            he.invalidate(true);
                        } else if (changedMixins.contains(state)) {
                            // mixin changed for a node -> force reloading upon next
                            // access in order to be aware of modified uniqueID.
                            he.invalidate(false);
                        }
                    }
                    break;
                case Status.EXISTING_REMOVED:
                    he.remove();
                    break;
                case Status.NEW:
                    // illegal. should not get here.
                    log.error("ChangeLog still contains NEW state: " + state.getName());
                    state.setStatus(Status.EXISTING);
                    break;
                case Status.MODIFIED:
                case Status._UNDEFINED_:
                case Status.STALE_DESTROYED:
                case Status.STALE_MODIFIED:
                    // illegal.
                    log.error("ChangeLog contains state (" + state.getName() + ") with illegal status " + Status.getName(state.getStatus()));
                    break;
                case Status.EXISTING:
                    if (state.isNode() && changedMixins.contains(state)) {
                        // mixin changed for a node -> force reloading upon next
                        // access in order to be aware of modified uniqueID.
                        he.invalidate(false);
                    }
                    // otherwise: ignore. operations already have been completed
                    break;
                case Status.INVALIDATED:
                case Status.REMOVED:
                    he.invalidate(false);
                    break;
            }
        }
    }
View Full Code Here

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

        assert status == STATUS_PENDING;
        status = STATUS_PERSISTED;

        // invalidate all references to the removed activity
        while (refs.hasNext()) {
            HierarchyEntry entry = hMgr.lookup(refs.next());
            if (entry != null) {
                entry.invalidate(false);
            }
        }

        // invalidate the activities parent
        parent.getNodeEntry().invalidate(false);
View Full Code Here

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

        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

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

        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
TOP
Copyright © 2018 www.massapi.com. 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.