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

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


    public void addExistingNode() throws CommitFailedException {
        // FIXME OAK-1550 Incorrect handling of addExistingNode conflict in NodeStore
        assumeTrue(fixture != NodeStoreFixture.MONGO_MK);
        assumeTrue(fixture != NodeStoreFixture.MONGO_NS);

        CommitHook hook = new CompositeHook(
                new ConflictHook(JcrConflictHandler.JCR_CONFLICT_HANDLER),
                new EditorHook(new ConflictValidatorProvider())
        );

        NodeBuilder b1 = store.getRoot().builder();
View Full Code Here


        newNodeBuilder.setProperty("n", 42);

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

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

        NodeBuilder b = store.getRoot().builder();
        b.child("bar");
        store.merge(b, EmptyHook.INSTANCE, CommitInfo.EMPTY);

        try {
            store.merge(rootBuilder, new CommitHook() {
                @Nonnull
                @Override
                public NodeState processCommit(
                        NodeState before, NodeState after, CommitInfo info)
                        throws CommitFailedException {
View Full Code Here

        NodeBuilder b2 = ns.getRoot().builder();
        createNodes(b2, "/etc/workflow/instance1");

        tds.reset();
        //3. Merge which does a rebase
        ns.merge(b2, new CommitHook() {
            public NodeState processCommit(NodeState before, NodeState after, CommitInfo info) throws CommitFailedException {
                NodeBuilder rb = after.builder();
                createNodes(rb, "/oak:index/prop-a/a1");

                //2.1 Commit some change under prop-
View Full Code Here

        CommitFailedException exception = EditorDiff.process(indexUpdate,
                before, after);
        if (exception == null && callback.dirty) {
            async.setProperty(name, checkpoint);
            try {
                store.merge(builder, new CommitHook() {
                    @Override @Nonnull
                    public NodeState processCommit(
                            NodeState before, NodeState after, CommitInfo info)
                            throws CommitFailedException {
                        // check for concurrent updates by this async task
View Full Code Here

    public void addExistingNode() throws CommitFailedException {
        // FIXME OAK-1550 Incorrect handling of addExistingNode conflict in NodeStore
        assumeTrue(fixture != NodeStoreFixture.MONGO_MK);
        assumeTrue(fixture != NodeStoreFixture.MONGO_NS);

        CommitHook hook = new CompositeHook(
                new ConflictHook(JcrConflictHandler.JCR_CONFLICT_HANDLER),
                new EditorHook(new ConflictValidatorProvider())
        );

        NodeBuilder b1 = store.getRoot().builder();
View Full Code Here

        newNodeBuilder.setProperty("n", 42);

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

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

        NodeBuilder b = store.getRoot().builder();
        b.child("bar");
        store.merge(b, EmptyHook.INSTANCE, CommitInfo.EMPTY);

        try {
            store.merge(rootBuilder, new CommitHook() {
                @Nonnull
                @Override
                public NodeState processCommit(
                        NodeState before, NodeState after, CommitInfo info)
                        throws CommitFailedException {
View Full Code Here

        // add index hooks later to prevent the OakInitializer to do excessive indexing
        with(new IndexUpdateProvider(indexEditors));
        with(new EventQueueWriterProvider());
        withEditorHook();
        CommitHook commitHook = CompositeHook.compose(commitHooks);
        return new ContentRepositoryImpl(
                store,
                commitHook,
                defaultWorkspaceName,
                indexProvider,
View Full Code Here

    }

    private void mergeWithConcurrencyCheck(
            NodeBuilder builder, final String checkpoint, final long lease)
            throws CommitFailedException {
        CommitHook concurrentUpdateCheck = new CommitHook() {
            @Override @Nonnull
            public NodeState processCommit(
                    NodeState before, NodeState after, CommitInfo info)
                    throws CommitFailedException {
                // check for concurrent updates by this async task
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.