Package org.apache.jackrabbit.oak.spi.commit

Examples of org.apache.jackrabbit.oak.spi.commit.CommitHook


        newNodeBuilder.setProperty("n", 42);

        testBuilder.getChildNode("a").remove();

        store.merge(rootBuilder, new CommitHook() {
            @Override
            public NodeState processCommit(NodeState before, NodeState after) {
                NodeBuilder rootBuilder = after.builder();
                NodeBuilder testBuilder = rootBuilder.child("test");
                testBuilder.child("fromHook");
View Full Code Here


                groupsPath = userConfig.getParameters().getProperty(UserManagerImpl.PARAM_GROUPS_PATH, UserConstants.DEFAULT_GROUP_PATH);
            } else {
                groupsPath = UserConstants.DEFAULT_GROUP_PATH;
            }
            // TODO: default hooks?
            CommitHook hook = new CompositeHook(
                    new EditorHook(new GroupEditorProvider(groupsPath)),
                    new EditorHook(new CompositeEditorProvider(
                            new TypeEditorProvider(),
                            new IndexUpdateProvider(new CompositeIndexEditorProvider(
                                    new ReferenceEditorProvider(),
View Full Code Here

    }

    @Override
    public NodeState merge() throws CommitFailedException {
        checkNotMerged();
        CommitHook commitHook = store.getHook();
        NodeState toCommit = commitHook.processCommit(base, head);
        NodeState oldRoot = head;
        setRoot(toCommit);

        try {
            if (headRevision == null) {
View Full Code Here

        assertEquals(newRoot, after);
    }

    @Test
    public void beforeCommitHook() throws CommitFailedException {
        store.setHook(new CommitHook() {
            @Override
            public NodeState processCommit(NodeState before, NodeState after) {
                NodeBuilder rootBuilder = after.builder();
                NodeBuilder testBuilder = rootBuilder.child("test");
                testBuilder.child("fromHook");
View Full Code Here

                provider, name, after, builder), before, after);
        if (exception == null) {
            try {
                async.setProperty(name, checkpoint);
                postAsyncRunStatus(builder);
                store.merge(builder, 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

            copyNodeTypes(builder);
            copyVersionStore(builder, idxToPrefix);
            copyWorkspaces(builder, idxToPrefix);

            // TODO: default hooks?
            CommitHook hook = new EditorHook(new RegistrationEditorProvider());
            target.merge(builder, hook, null);
        } catch (Exception e) {
            throw new RepositoryException("Failed to copy content", e);
        }
    }
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

        assertFalse(store.getRoot().hasProperty("bar"));

        SegmentNodeStoreBranch b = store.branch();
        b.setMaximumBackoff(100);
        b.setRoot(b.getHead().builder().setProperty("bar", "xyz").getNodeState());
        b.merge(new CommitHook() {
            @Override @Nonnull
            public NodeState processCommit(NodeState before, NodeState after) {
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
View Full Code Here

        NodeState newRoot = rootBuilder.getNodeState();

        NodeStoreBranch branch = store.branch();
        branch.setRoot(newRoot);
        branch.merge(new CommitHook() {
            @Override
            public NodeState processCommit(NodeState before, NodeState after) {
                NodeBuilder rootBuilder = after.builder();
                NodeBuilder testBuilder = rootBuilder.child("test");
                testBuilder.child("fromHook");
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.spi.commit.CommitHook

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.