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

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


                                CommitHook commitHook) {
        MemoryNodeStore store = new MemoryNodeStore();
        NodeStoreBranch branch = store.branch();
        branch.setRoot(workspaceRoot);
        try {
            branch.merge(EmptyHook.INSTANCE, PostCommitHook.EMPTY);
        } catch (CommitFailedException e) {
            throw new RuntimeException(e);
        }

        Root root = new SystemRoot(store, commitHook, workspaceName, securityProvider, indexProvider);
View Full Code Here


    private static void init(NodeStore store) throws CommitFailedException {
        NodeStoreBranch branch = store.branch();
        NodeBuilder builder = branch.getHead().builder();
        builder.child("x").child("y").child("z");
        branch.setRoot(builder.getNodeState());
        branch.merge(EmptyHook.INSTANCE, PostCommitHook.EMPTY);
    }

    private static void run(NodeStore store) throws CommitFailedException {
        NodeStoreBranch branch = store.branch();
        NodeBuilder builder = branch.getHead().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(EmptyHook.INSTANCE, PostCommitHook.EMPTY);
    }

}
View Full Code Here

        builder.setProperty("foo", "bar");
        NodeState newState = builder.getNodeState();

        NodeStoreBranch branch = root.branch();
        branch.setRoot(newState);
        branch.merge(EmptyHook.INSTANCE, PostCommitHook.EMPTY);

        assertEquals(newState, root.getRoot());
        assertEquals(oldState, left.getRoot());
        assertEquals(oldState, right.getRoot());
View Full Code Here

        builder.setProperty("foo", "bar");
        NodeState newState = builder.getNodeState();

        NodeStoreBranch branch = left.branch();
        branch.setRoot(newState);
        branch.merge(EmptyHook.INSTANCE, PostCommitHook.EMPTY);

        assertEquals(oldState, root.getRoot());
        assertEquals(newState, left.getRoot());
        assertEquals(oldState, right.getRoot());
View Full Code Here

        leftBuilder.setProperty("foo", "bar");
        NodeState leftState = leftBuilder.getNodeState();

        NodeStoreBranch leftBranch = left.branch();
        leftBranch.setRoot(leftState);
        leftBranch.merge(EmptyHook.INSTANCE, PostCommitHook.EMPTY);

        assertEquals(oldState, root.getRoot());
        assertEquals(leftState, left.getRoot());
        assertEquals(oldState, right.getRoot());
View Full Code Here

        rightBuilder.setProperty("bar", "foo");
        NodeState rightState = rightBuilder.getNodeState();

        NodeStoreBranch rightBranch = right.branch();
        rightBranch.setRoot(rightState);
        rightBranch.merge(EmptyHook.INSTANCE, PostCommitHook.EMPTY);

        store.getJournal("right").merge();
        NodeState newState = root.getRoot();
        assertEquals("bar", newState.getProperty("foo").getValue(Type.STRING));
        assertEquals("foo", newState.getProperty("bar").getValue(Type.STRING));
View Full Code Here

            copyNodeTypes(builder);
            copyVersionStore(builder);
            copyWorkspaces(builder);

            branch.setRoot(builder.getNodeState());
            branch.merge(new EditorHook(new RegistrationEditorProvider()), PostCommitHook.EMPTY); // TODO: default hooks?
        } catch (Exception e) {
            throw new RepositoryException("Failed to copy content", e);
        }
    }
View Full Code Here

                                  @Nonnull IndexEditorProvider indexEditor) {
        NodeStoreBranch branch = store.branch();
        NodeState before = branch.getHead();
        branch.setRoot(initializer.initialize(before));
        try {
            branch.merge(new EditorHook(new IndexUpdateProvider(indexEditor)), PostCommitHook.EMPTY);
        } catch (CommitFailedException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

        for (WorkspaceInitializer wspInit : initializer) {
            root = wspInit.initialize(root, workspaceName, indexProvider, commitHook);
        }
        branch.setRoot(root);
        try {
            branch.merge(new EditorHook(new IndexUpdateProvider(indexEditor)), PostCommitHook.EMPTY);
        } catch (CommitFailedException e) {
            throw new RuntimeException(e);
        }
    }
}
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.