Package org.apache.jackrabbit.jcr2spi.state

Examples of org.apache.jackrabbit.jcr2spi.state.ItemState


     * @see ItemManager#itemExists(HierarchyEntry)
     */
    public boolean itemExists(HierarchyEntry hierarchyEntry) {
        try {
            // session-sanity & permissions are checked upon itemExists(ItemState)
            ItemState state = hierarchyEntry.getItemState();
            return itemExists(state);
        } catch (ItemNotFoundException e) {
            return false;
        } catch (RepositoryException e) {
            return false;
View Full Code Here


    /**
     * @see ItemManager#getItem(HierarchyEntry)
     */
    public Item getItem(HierarchyEntry hierarchyEntry) throws ItemNotFoundException, RepositoryException {
        session.checkIsAlive();
        ItemState state = hierarchyEntry.getItemState();
        if (!state.isValid()) {
            throw new ItemNotFoundException(LogUtil.safeGetJCRPath(state, session.getPathResolver()));
        }

        // first try to access item from cache
        Item item = itemCache.getItem(state);
View Full Code Here

        session.checkSupportedOption(Repository.LEVEL_2_SUPPORTED);
        session.checkIsAlive();

        Path parentPath = session.getQPath(parentAbsPath);
        ItemState parentState = getHierarchyManager().getItemState(parentPath);
        if (parentState.isNode()) {
            // make sure the given import target is accessible, not locked and checked out.
            int options = ItemStateValidator.CHECK_ACCESS | ItemStateValidator.CHECK_LOCK | ItemStateValidator.CHECK_VERSIONING;
            getValidator().checkIsWritable((NodeState) parentState, options);

            // build the content handler
View Full Code Here

        session.checkSupportedOption(Repository.LEVEL_2_SUPPORTED);
        session.checkIsAlive();

        Path parentPath = session.getQPath(parentAbsPath);
        ItemState itemState = getHierarchyManager().getItemState(parentPath);
        if (itemState.isNode()) {
            // make sure the given import target is accessible, not locked and checked out.
            NodeState parentState = (NodeState) itemState;
            int options = ItemStateValidator.CHECK_ACCESS | ItemStateValidator.CHECK_LOCK | ItemStateValidator.CHECK_VERSIONING;
            getValidator().checkIsWritable(parentState, options);
View Full Code Here

        private RevertInfo(NodeEntryImpl oldParent, Name oldName, int oldIndex) {
            this.oldParent = oldParent;
            this.oldName = oldName;
            this.oldIndex = oldIndex;

            ItemState state = internalGetItemState();
            if (state != null) {
                state.addListener(this);
            } // else: should never be null.
        }
View Full Code Here

                state.addListener(this);
            } // else: should never be null.
        }

        private void dispose() {
            ItemState state = internalGetItemState();
            if (state != null) {
                state.removeListener(this);
            }

            if (reorderedChildren != null) {
                // special handling of SNS-children  TODO: improve
                // since reordered sns-children are not marked modified (unless they
View Full Code Here

     * does not exist.
     * @throws RepositoryException if an error occurs.
     */
    ItemState resolve() throws ItemNotFoundException, RepositoryException {
        // check if already resolved
        ItemState state = internalGetItemState();
        // not yet resolved. retrieve and keep weak reference to state
        if (state == null) {
            try {
                state = doResolve();
                // only set 'target' if not already by upon resolution
                if (!isAvailable()) {
                    setItemState(state);
                }
            } catch (ItemNotFoundException e) {
                remove();
                throw e;
            }
        } else if (state.getStatus() == Status.INVALIDATED) {
            // completely reload this entry, but don't reload recursively
            reload(false, false);
        }
        return state;
    }
View Full Code Here

    /**
     *
     * @return
     */
    ItemState internalGetItemState() {
        ItemState state = null;
        if (target != null) {
            state = (ItemState) target.get();
        }
        return state;
    }
View Full Code Here

    /**
     *
     * @param entry
     */
    static void removeEntry(HierarchyEntryImpl entry) {
        ItemState state = entry.internalGetItemState();
        if (state != null) {
            state.setStatus(Status.REMOVED);
        }
    }
View Full Code Here

     */
    AbstractCopy(Path srcPath, Path destPath, String srcWorkspaceName,
                 ManagerProvider srcMgrProvider, ManagerProvider destMgrProvider)
        throws RepositoryException {

        ItemState srcItemState = srcMgrProvider.getHierarchyManager().getItemState(srcPath);
        if (!srcItemState.isNode()) {
            throw new PathNotFoundException("Source path " + LogUtil.safeGetJCRPath(srcPath, srcMgrProvider.getPathResolver()) + " is not a valid path.");
        }
        this.srcState = (NodeState)srcItemState;
        this.destParentState = getNodeState(destPath.getAncestor(1), destMgrProvider.getHierarchyManager(), destMgrProvider.getNamePathResolver());

View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.jcr2spi.state.ItemState

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.