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

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


        final SessionDelegate sessionDelegate = sessionContext.getSessionDelegate();
        return sessionDelegate.perform(new SessionOperation<Version>() {
            @Override
            public Version perform() throws RepositoryException {
                String oakPath = getOakPathOrThrowNotFound(absPath);
                NodeDelegate nodeDelegate = sessionDelegate.getNode(oakPath);
                if (nodeDelegate == null) {
                    throw new PathNotFoundException(absPath);
                }
                return new VersionImpl(
                        versionManagerDelegate.getBaseVersion(nodeDelegate), sessionContext);
View Full Code Here


        final SessionDelegate sessionDelegate = sessionContext.getSessionDelegate();
        sessionDelegate.perform(new SessionOperation<Void>(true) {
            @Override
            public Void perform() throws RepositoryException {
                String oakPath = getOakPathOrThrowNotFound(absPath);
                NodeDelegate nodeDelegate = sessionDelegate.getNode(oakPath);
                if (nodeDelegate == null) {
                    throw new PathNotFoundException(absPath);
                }
                checkNotLocked(absPath);
                versionManagerDelegate.checkout(nodeDelegate);
View Full Code Here

        final SessionDelegate sessionDelegate = sessionContext.getSessionDelegate();
        return sessionDelegate.perform(new SessionOperation<Version>(true) {
            @Override
            public Version perform() throws RepositoryException {
                String oakPath = getOakPathOrThrowNotFound(absPath);
                NodeDelegate nodeDelegate = sessionDelegate.getNode(oakPath);
                if (nodeDelegate == null) {
                    throw new PathNotFoundException(absPath);
                }
                return new VersionImpl(versionManagerDelegate.checkin(nodeDelegate), sessionContext);
            }
View Full Code Here

    private NodeDelegate ensureParentExists(@Nonnull SessionDelegate sessionDelegate,
                                            @Nonnull String absPath)
            throws PathNotFoundException {
        String oakParentPath = getOakPathOrThrowNotFound(
                PathUtils.getParentPath(checkNotNull(absPath)));
        NodeDelegate parent = checkNotNull(sessionDelegate).getNode(oakParentPath);
        if (parent == null) {
            throw new PathNotFoundException(PathUtils.getParentPath(absPath));
        }
        return parent;
    }
View Full Code Here

        if (uuids.isEmpty()) {
            return Collections.emptyList();
        }
        List<NodeDelegate> existing = new ArrayList<NodeDelegate>();
        for (String uuid : uuids) {
            NodeDelegate node = delegate.getNodeByIdentifier(uuid);
            if (node != null) {
                boolean inSubGraph = false;
                for (String versionablePath : versionablePaths) {
                    if (node.getPath().startsWith(versionablePath)) {
                        inSubGraph = true;
                        break;
                    }
                }
                if (!inSubGraph) {
View Full Code Here

    private VersionHistoryDelegate internalGetVersionHistory(
            @Nonnull String absPathVersionable)
            throws RepositoryException, UnsupportedRepositoryOperationException {
        SessionDelegate sessionDelegate = sessionContext.getSessionDelegate();
        String oakPath = getOakPathOrThrowNotFound(checkNotNull(absPathVersionable));
        NodeDelegate nodeDelegate = sessionDelegate.getNode(oakPath);
        if (nodeDelegate == null) {
            throw new PathNotFoundException(absPathVersionable);
        }
        return versionManagerDelegate.getVersionHistory(nodeDelegate);
View Full Code Here

    @CheckForNull
    NodeImpl<? extends NodeDelegate> getNode(String path) throws RepositoryException {
        if (path == null) {
            return null;
        }
        NodeDelegate d = sessionDelegate.getNode(path);
        return d == null ? null : NodeImpl.createNode(d, sessionContext);
    }
View Full Code Here

    }

    @CheckForNull
    NodeImpl<? extends NodeDelegate> getNode(Tree tree) throws RepositoryException {
        if (tree != null && tree.exists()) {
            NodeDelegate node = new NodeDelegate(sessionDelegate, tree);
            return NodeImpl.createNode(node, sessionContext);
        } else {
            return null;
        }
    }
View Full Code Here

        });
    }

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

        final SessionDelegate sessionDelegate = sessionContext.getSessionDelegate();
        sessionDelegate.perform(new SessionOperation<Void>(true) {
            @Override
            public Void perform() throws RepositoryException {
                String oakPath = getOakPathOrThrowNotFound(absPath);
                NodeDelegate nodeDelegate = sessionDelegate.getNode(oakPath);
                if (nodeDelegate != null) {
                    throw new VersionException(
                            "VersionManager.restore(String, Version, boolean)"
                                    + " not allowed on existing nodes; use"
                                    + " VersionManager.restore(Version, boolean) instead: "
                                    + absPath);
                }
                // check if parent exists
                NodeDelegate parent = ensureParentExists(sessionDelegate, absPath);
                // check for pending changes
                checkPendingChangesForRestore(sessionDelegate);
                // check lock status
                checkNotLocked(parent.getPath());
                // check for existing nodes
                List<NodeDelegate> existing = getExisting(version,
                        Collections.<String>emptySet());
                boolean success = false;
                try {
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.