Package org.apache.jackrabbit.oak.spi.state

Examples of org.apache.jackrabbit.oak.spi.state.NodeStoreBranch.merge()


        NodeState newRoot = rootBuilder.getNodeState();

        NodeStoreBranch branch = store.branch();
        branch.setRoot(newRoot);
        branch.merge();
        store.getRoot(); // triggers the observer

        NodeState before = states[0];
        NodeState after = states[1];
        assertNotNull(before);
View Full Code Here


        NodeState newRoot = rootBuilder.getNodeState();

        NodeStoreBranch branch = store.branch();
        branch.setRoot(newRoot);
        branch.merge();

        NodeState test = store.getRoot().getChildNode("test");
        assertNotNull(test.getChildNode("newNode"));
        assertNotNull(test.getChildNode("fromHook"));
        assertNull(test.getChildNode("a"));
View Full Code Here

        addFolder(root, "folder-1");
        addFolder(root, "folder-2");
        addFile(root, "file-1");

        branch.setRoot(root.getNodeState());
        branch.merge();

        NodeState rootState = store.getRoot();
        NodeTypeIndex index = new NodeTypeIndex();
        FilterImpl filter = new FilterImpl(null, null);
View Full Code Here

        builder.child("x");
        builder.child("y");
        builder.child("z");
        branch.setRoot(builder.getNodeState());

        state = branch.merge();
    }

    @After
    public void tearDown() {
        state = null;
View Full Code Here

        for (int i = 0; i <= N; i++) {
            builder.child("x" + i);
        }
        branch.setRoot(builder.getNodeState());

        state = branch.merge();
    }

    @After
    public void tearDown() {
        state = null;
View Full Code Here

    private static void init(NodeStore store) throws CommitFailedException {
        NodeStoreBranch branch = store.branch();
        NodeBuilder builder = branch.getRoot().builder();
        builder.child("x").child("y").child("z");
        branch.setRoot(builder.getNodeState());
        branch.merge();
    }

    private static void run(NodeStore store) throws CommitFailedException {
        NodeStoreBranch branch = store.branch();
        NodeBuilder builder = branch.getRoot().builder();
View Full Code Here

        // See OAK-531
        assertFalse("child node x/y/z not should not be present", builder
                .child("x").child("y").hasChildNode("z"));

        branch.merge();
    }

}
View Full Code Here

            NodeBuilder privileges = system.child(REP_PRIVILEGES);
            privileges.setProperty(JcrConstants.JCR_PRIMARYTYPE, NT_REP_PRIVILEGES, Type.NAME);

            try {
                branch.setRoot(root.getNodeState());
                branch.merge();
            } catch (CommitFailedException e) {
                log.error("Failed to initialize privilege content ", e);
                throw new RuntimeException(e);
            }
View Full Code Here

        checkArgument(builder instanceof MemoryNodeBuilder);
        checkNotNull(commitHook);
        rebase(builder);
        NodeStoreBranch branch = new MemoryNodeStoreBranch(this, getRoot());
        branch.setRoot(builder.getNodeState());
        NodeState merged = branch.merge(commitHook, info);
        ((MemoryNodeBuilder) builder).reset(merged);
        return merged;
    }

    /**
 
View Full Code Here

        if (exception == null) {
            try {
                async.setProperty(name, checkpoint);
                postAsyncRunStatus(builder);
                branch.setRoot(builder.getNodeState());
                branch.merge(new CommitHook() {
                    @Override
                    @Nonnull
                    public NodeState processCommit(NodeState before,
                            NodeState after) throws CommitFailedException {
                        // check for concurrent updates by this async task
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.