Package org.apache.jackrabbit.oak.jcr.delegate

Examples of org.apache.jackrabbit.oak.jcr.delegate.NodeDelegate


    @Nonnull
    public NodeDefinition getDefinition() throws RepositoryException {
        return perform(new NodeOperation<NodeDefinition>(dlg) {
            @Override
            public NodeDefinition perform() throws RepositoryException {
                NodeDelegate parent = node.getParent();
                if (parent == null) {
                    return getNodeTypeManager().getRootDefinition();
                } else {
                    return getNodeTypeManager().getDefinition(
                            parent.getTree(), node.getTree());
                }
            }
        });
    }
View Full Code Here


        });
    }

    @Override @Nonnull
    public Lock getLock() throws RepositoryException {
        NodeDelegate lock = perform(
                new LockOperation<NodeDelegate>(sessionDelegate, dlg) {
                    @Override
                    public NodeDelegate perform(NodeDelegate node) {
                        return node.getLock();
                    }
View Full Code Here

        delegate.perform(new SessionOperation<Void>() {
            @Override
            public Void perform() throws RepositoryException {
                Iterator<String> iterator = sessionScopedLocks.iterator();
                while (iterator.hasNext()) {
                    NodeDelegate node = delegate.getNode(iterator.next());
                    if (node != null) {
                        try {
                            node.unlock(); // TODO: use a single commit
                        } catch (RepositoryException e) {
                            log.warn("Failed to unlock a session scoped lock", e);
                        }
                    }
                    iterator.remove();
View Full Code Here

    @Nonnull
    public Node getRootNode() throws RepositoryException {
        return perform(new ReadOperation<Node>() {
            @Override
            public Node perform() throws RepositoryException {
                NodeDelegate nd = sd.getRootNode();
                if (nd == null) {
                    throw new AccessDeniedException("Root node is not accessible.");
                }
                return NodeImpl.createNodeOrNull(nd, sessionContext);
            }
View Full Code Here

    @Nonnull
    private Node getNodeById(final String id) throws RepositoryException {
        return perform(new ReadOperation<Node>() {
            @Override
            public Node perform() throws RepositoryException {
                NodeDelegate nd = sd.getNodeByIdentifier(id);
                if (nd == null) {
                    throw new ItemNotFoundException("Node with id " + id + " does not exist.");
                }
                return NodeImpl.createNodeOrNull(nd, sessionContext);
            }
View Full Code Here

            @Override
            public Node perform() throws RepositoryException {
                if (node.isRoot()) {
                    throw new ItemNotFoundException("Root has no parent");
                } else {
                    NodeDelegate parent = node.getParent();
                    if (parent == null) {
                        throw new AccessDeniedException();
                    }
                    return NodeImpl.createNode(parent, sessionContext);
                }
View Full Code Here

    }

    @CheckForNull
    private ItemImpl<?> getItemInternal(@Nonnull String oakPath)
            throws RepositoryException {
        NodeDelegate nd = sd.getNode(oakPath);
        if (nd != null) {
            return sessionContext.createNodeOrNull(nd);
        }
        PropertyDelegate pd = sd.getProperty(oakPath);
        if (pd != null) {
View Full Code Here

    @Nonnull
    public Node getRootNode() throws RepositoryException {
        return perform(new CheckedSessionOperation<Node>() {
            @Override
            protected Node perform() throws AccessDeniedException, RepositoryException {
                NodeDelegate nd = sd.getRootNode();
                if (nd == null) {
                    throw new AccessDeniedException("Root node is not accessible.");
                }
                return sessionContext.createNodeOrNull(nd);
            }
View Full Code Here

    @Nonnull
    private Node getNodeById(final String id) throws RepositoryException {
        return perform(new CheckedSessionOperation<Node>() {
            @Override
            public Node perform() throws ItemNotFoundException, RepositoryException {
                NodeDelegate nd = sd.getNodeByIdentifier(id);
                if (nd == null) {
                    throw new ItemNotFoundException("Node with id " + id + " does not exist.");
                }
                return sessionContext.createNodeOrNull(nd);
            }
View Full Code Here

            @Override
            public Node perform() throws RepositoryException {
                if (dlg.isRoot()) {
                    throw new ItemNotFoundException("Root has no parent");
                } else {
                    NodeDelegate parent = dlg.getParent();
                    if (parent == null) {
                        throw new AccessDeniedException();
                    }
                    return sessionContext.createNodeOrNull(parent);
                }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.jcr.delegate.NodeDelegate

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.