Package org.apache.jackrabbit.core

Examples of org.apache.jackrabbit.core.ItemManager


    @Override
    protected Result buildResult(Path absPath) throws RepositoryException {
        boolean existingNode = false;
        NodeImpl node;

        ItemManager itemMgr = session.getItemManager();
        try {
            ItemImpl item = itemMgr.getItem(absPath);
            if (item.isNode()) {
                node = (NodeImpl) item;
                existingNode = true;
            } else {
                node = (NodeImpl) item.getParent();
View Full Code Here


        boolean canRead = false;
        synchronized (monitor) {
            if (readCache.containsKey(id)) {
                canRead = readCache.get(id);
            } else {
                ItemManager itemMgr = session.getItemManager();
                NodeId nodeId = (isExistingNode) ? (NodeId) id : ((PropertyId) id).getParentId();
                NodeImpl node = (NodeImpl) itemMgr.getItem(nodeId);

                boolean isAcItem = util.isAcItem(node);
                EntryFilterImpl filter;
                if (path == null) {
                    filter = new EntryFilterImpl(principalNames, id, session);
View Full Code Here

    @Override
    protected Result buildResult(Path absPath) throws RepositoryException {
        boolean existingNode = false;
        NodeImpl node;

        ItemManager itemMgr = session.getItemManager();
        try {
            ItemImpl item = itemMgr.getItem(absPath);
            if (item.isNode()) {
                node = (NodeImpl) item;
                existingNode = true;
            } else {
                node = (NodeImpl) item.getParent();
View Full Code Here

        boolean canRead = false;
        synchronized (monitor) {
            if (readCache.containsKey(id)) {
                canRead = readCache.get(id);
            } else {
                ItemManager itemMgr = session.getItemManager();
                NodeId nodeId = (isExistingNode) ? (NodeId) id : ((PropertyId) id).getParentId();
                NodeImpl node = (NodeImpl) itemMgr.getItem(nodeId);

                boolean isAcItem = util.isAcItem(node);
                EntryFilterImpl filter;
                if (path == null) {
                    filter = new EntryFilterImpl(principalNames, id, session);
View Full Code Here

    @Override
    protected Result buildResult(Path absPath) throws RepositoryException {
        boolean existingNode = false;
        NodeImpl node;

        ItemManager itemMgr = session.getItemManager();
        try {
            ItemImpl item = itemMgr.getItem(absPath);
            if (item.isNode()) {
                node = (NodeImpl) item;
                existingNode = true;
            } else {
                node = (NodeImpl) item.getParent();
View Full Code Here

        boolean canRead = false;
        synchronized (monitor) {
            if (readCache.containsKey(id)) {
                canRead = readCache.get(id);
            } else {
                ItemManager itemMgr = session.getItemManager();
                NodeId nodeId = (isExistingNode) ? (NodeId) id : ((PropertyId) id).getParentId();
                NodeImpl node = (NodeImpl) itemMgr.getItem(nodeId);

                boolean isAcItem = util.isAcItem(node);
                EntryFilterImpl filter;
                if (path == null) {
                    filter = new EntryFilterImpl(principalNames, id, session);
View Full Code Here

        this.nodeTypeName = nodeTypeName;
        this.uuid = uuid;
    }

    public Node perform(SessionContext context) throws RepositoryException {
        ItemManager itemMgr = context.getItemManager();

        // Get the canonical path of the new node
        Path path;
        try {
            path = PathFactoryImpl.getInstance().create(
                    node.getPrimaryPath(), context.getQPath(relPath), true);
        } catch (NameException e) {
            throw new RepositoryException(
                    "Failed to resolve path " + relPath
                    + " relative to " + node, e);
        }

        // Check that the last path element is a simple name
        if (!path.denotesName() || path.getIndex() != Path.INDEX_UNDEFINED) {
            throw new RepositoryException(
                    "Invalid last path element for adding node "
                    + relPath + " relative to " + node);
        }

        // Get the parent node instance
        NodeImpl parentNode;
        Path parentPath = path.getAncestor(1);
        try {
            parentNode = itemMgr.getNode(parentPath);
        } catch (PathNotFoundException e) {
            if (itemMgr.propertyExists(parentPath)) {
                throw new ConstraintViolationException(
                        "Unable to add a child node to property "
                        + context.getJCRPath(parentPath));
            }
            throw e;
        } catch (AccessDeniedException ade) {
            throw new PathNotFoundException(
                    "Failed to resolve path " + relPath
                    + " relative to " + node);
        }

        // Resolve node type name (if any)
        Name typeName = null;
        if (nodeTypeName != null) {
            typeName = context.getQName(nodeTypeName);
        }

        // Check that the given UUID (if any) does not already exist
        NodeId id = null;
        if (uuid != null) {
            id = new NodeId(uuid);
            if (itemMgr.itemExists(id)) {
                throw new ItemExistsException(
                        "A node with this UUID already exists: " + uuid);
            }
        }
View Full Code Here

    @Override
    protected Result buildResult(Path absPath) throws RepositoryException {
        boolean existingNode = false;
        NodeImpl node;

        ItemManager itemMgr = session.getItemManager();
        try {
            ItemImpl item = itemMgr.getItem(absPath);
            if (item.isNode()) {
                node = (NodeImpl) item;
                existingNode = true;
            } else {
                node = (NodeImpl) item.getParent();
View Full Code Here

        boolean canRead = false;
        synchronized (monitor) {
            if (readCache.containsKey(id)) {
                canRead = readCache.get(id);
            } else {
                ItemManager itemMgr = session.getItemManager();
                NodeId nodeId = (isExistingNode) ? (NodeId) id : ((PropertyId) id).getParentId();
                NodeImpl node = (NodeImpl) itemMgr.getItem(nodeId);

                boolean isAcItem = util.isAcItem(node);
                EntryFilterImpl filter;
                if (path == null) {
                    filter = new EntryFilterImpl(principalNames, id, session);
View Full Code Here

    private class FetchNext implements SessionOperation<Object> {

        public Object perform(SessionContext context) {

            ItemManager itemMgr = context.getItemManager();
            while (next == null && scoreNodes.hasNext()) {
                ScoreNode[] sn = scoreNodes.nextScoreNodes();
                try {
                    next = (NodeImpl) itemMgr.getItem(
                            sn[selectorIndex].getNodeId());
                } catch (RepositoryException e) {
                    log.warn("Failed to retrieve query result node "
                            + sn[selectorIndex].getNodeId(), e);
                    // try next
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.ItemManager

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.