Package org.apache.jackrabbit.jcr2spi.state

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


        this.stateMgr = stateManager;
        this.uuidBehavior = uuidBehavior;

        // perform preliminary checks
        try {
            ItemState itemState = session.getHierarchyManager().getItemState(parentPath);
            if (!itemState.isNode()) {
                throw new PathNotFoundException(LogUtil.safeGetJCRPath(parentPath, session.getPathResolver()));
            }
            importTarget = (NodeState) itemState;

            // check if import target is writable, not-locked and checked-out.
View Full Code Here


         * Executes the operations on the repository service.
         */
        private void execute(ChangeLog changeLog) throws RepositoryException, ConstraintViolationException, AccessDeniedException, ItemExistsException, NoSuchNodeTypeException, UnsupportedRepositoryOperationException, VersionException {
            RepositoryException ex = null;
            try {
                ItemState target = changeLog.getTarget();
                batch = service.createBatch(sessionInfo, target.getId());
                Iterator it = changeLog.getOperations();
                while (it.hasNext()) {
                    Operation op = (Operation) it.next();
                    log.debug("executing " + op.getName());
                    op.accept(this);
View Full Code Here

     * @see ItemManager#itemExists(Path)
     */
    public boolean itemExists(Path path) {
        try {
            // session-sanity & permissions are checked upon itemExists(ItemState)
            ItemState itemState = hierMgr.getItemState(path);
            return itemExists(itemState);
        } catch (PathNotFoundException pnfe) {
            return false;
        } catch (ItemNotFoundException infe) {
            return false;
View Full Code Here

     * @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, AccessDeniedException, RepositoryException {
        ItemState itemState = hierarchyEntry.getItemState();
        return getItem(itemState);
    }
View Full Code Here

        ps.println();
        ps.println("Items in cache:");
        ps.println();
        Iterator iter = itemCache.keySet().iterator();
        while (iter.hasNext()) {
            ItemState state = (ItemState) iter.next();
            Item item = (Item) itemCache.get(state);
            if (item.isNode()) {
                ps.print("Node: ");
            } else {
                ps.print("Property: ");
View Full Code Here

     * @see HierarchyManager#getItemState(Path)
     */
    public ItemState getItemState(Path qPath) throws PathNotFoundException, RepositoryException {
        HierarchyEntry entry = getHierarchyEntry(qPath);
        try {
            ItemState state = entry.getItemState();
            if (state.isValid()) {
                return state;
            } else {
                throw new PathNotFoundException();
            }
        } catch (ItemNotFoundException e) {
View Full Code Here

        Path targetPath = getQPath(absPath);

        boolean isGranted;
        // The given abs-path may point to a non-existing item
        if (itemExists(absPath)) {
            ItemState itemState = getHierarchyManager().getItemState(targetPath);
            isGranted = getAccessManager().isGranted(itemState, actionsArr);
        } else {
            NodeState parentState = null;
            Path parentPath = targetPath;
            while (parentState == null) {
                parentPath = parentPath.getAncestor(1);
                if (itemManager.itemExists(parentPath)) {
                    ItemState itemState = getHierarchyManager().getItemState(parentPath);
                    if (itemState.isNode()) {
                        parentState = (NodeState) itemState;
                    }
                }
            }
            // parentState is the nearest existing nodeState or the root state.
View Full Code Here

     *
     * @param version
     * @return
     */
    NodeState getVersionState(Version version) throws RepositoryException {
        ItemState itemState;
        if (version.getSession() == this) {
            itemState = ((NodeImpl) version).getItemState();
        } else {
            Path p = getQPath(version.getPath());
            itemState = getHierarchyManager().getItemState(p);
View Full Code Here

     * @see Dumpable#dump(PrintStream)
     */
    public void dump(PrintStream ps) {
        Iterator iter = cache.keySet().iterator();
        while (iter.hasNext()) {
            ItemState state = (ItemState) iter.next();
            Item item = (Item) cache.get(state);
            if (item.isNode()) {
                ps.print("Node: ");
            } else {
                ps.print("Property: ");
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.