Package org.apache.jackrabbit.mk.model

Examples of org.apache.jackrabbit.mk.model.NodeState


            throw new IllegalStateException("not initialized");
        } else if (!PathUtils.isAbsolute(path)) {
            throw new IllegalArgumentException("illegal path");
        }

        NodeState node = rs.getNodeState(rs.getRootNode(revId));
        for (String name : PathUtils.elements(path)) {
            node = node.getChildNode(name);
            if (node == null) {
                break;
            }
        }
        return node;
View Full Code Here


            throw new IllegalStateException("not initialized");
        } else if (!PathUtils.isAbsolute(path)) {
            throw new IllegalArgumentException("illegal path");
        }

        NodeState node = rs.getNodeState(rs.getRootNode(revId));
        for (String name : PathUtils.elements(path)) {
            node = node.getChildNode(name);
            if (node == null) {
                return false;
            }
        }
        return true;
View Full Code Here

            // maps (key: id of target node, value: path/to/target)
            // for tracking added/removed nodes; this allows us
            // to detect 'move' operations
            final HashMap<Id, String> addedNodes = new HashMap<Id, String>();
            final HashMap<Id, String> removedNodes = new HashMap<Id, String>();
            NodeState node1, node2;
            try {
                node1 = rep.getNodeState(fromRevisionId, path);
            } catch (NotFoundException e) {
                node1 = null;
            }
View Full Code Here

    private NodeDelta getNodeDelta() {
        return nodeDelta = getNodeStateProvider().getNodeDelta(nodeDelta.getPath());
    }

    private static NodeState getPersistentNodeState(Connection connection, Path path) {
        NodeState state = connection.getCurrentRoot();
        for (String name : path.getNames()) {
            state = state.getChildNode(name);
            if (state == null) {
                return null;
            }
        }
View Full Code Here

            throw new IllegalStateException("not initialized");
        } else if (!PathUtils.isAbsolute(path)) {
            throw new IllegalArgumentException("illegal path");
        }

        NodeState node = rs.getNodeState(rs.getRootNode(revId));
        for (String name : PathUtils.split(path)) {
            node = node.getChildNode(name);
            if (node == null) {
                throw new NotFoundException(
                        "Path " + path + " not found in revision " + revId);
            }
        }
View Full Code Here

        } else if (!PathUtils.isAbsolute(path)) {
            throw new IllegalArgumentException("illegal path");
        }

        try {
            NodeState node = rs.getNodeState(rs.getRootNode(revId));
            for (String name : PathUtils.split(path)) {
                node = node.getChildNode(name);
                if (node == null) {
                    return false;
                }
            }
            return true;
View Full Code Here

    static Connection createWorkspaceConnection(SimpleCredentials credentials,
            String workspace, MicroKernel microKernel, String revision) throws NoSuchWorkspaceException {

        NodeStore store = new KernelNodeStore(microKernel); // TODO: pass revision?
        NodeState wspRoot = store.getRoot().getChildNode(workspace);
        if (wspRoot == null) {
            throw new NoSuchWorkspaceException(workspace);
        }

        return new ConnectionImpl(credentials, workspace, store, wspRoot);
View Full Code Here

    }

    @Override
    public NodeState getChildNode(String name) {
        init();
        NodeState child = childNodes.get(name);
        if (child == null && childNodeCount > MAX_CHILD_NODE_NAMES) {
            String childPath = getChildPath(name);
            try {
                kernel.getNodes(childPath, revision, 0, 0, 0, null);
                child = new KernelNodeState(kernel, childPath, revision);
View Full Code Here

                String name = reader.readString();
                reader.read(':');
                if (reader.matches('{')) {
                    reader.read('}');
                    String childPath = getChildPath(name);
                    NodeState child =
                            new KernelNodeState(kernel, childPath, revision);
                    entries.add(new KernelChildNodeEntry(name, child));
                } else {
                    reader.read();
                }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.mk.model.NodeState

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.