Package org.apache.jackrabbit.oak.api

Examples of org.apache.jackrabbit.oak.api.CommitFailedException


                    NodeState newHead = AbstractNodeStoreBranch.this.persist(toCommit, base, info);
                    dispatcher.contentChanged(newHead, info);
                    branchState = new Merged(base);
                    return newHead;
                } catch (Exception e) {
                    throw new CommitFailedException(MERGE, 1,
                            "Failed to merge changes to the underlying store", e);
                }
            } finally {
                dispatcher.contentChanged(getRoot(), null);
            }
View Full Code Here


                } finally {
                    if (!success) {
                        try {
                            AbstractNodeStoreBranch.this.reset(newRoot, head);
                        } catch (Exception e) {
                            CommitFailedException ex = new CommitFailedException(
                                            OAK, 100, "Branch reset failed", e);
                            branchState = new ResetFailed(base, ex);
                        }
                    }
                }
View Full Code Here

        }

        private boolean diff(ImmutableTree source, ImmutableTree dest,
                             MoveAwarePermissionValidator validator) throws CommitFailedException {
            Validator nextValidator = validator.visibleValidator(source, dest);
            CommitFailedException e = EditorDiff.process(nextValidator , source.getNodeState(), dest.getNodeState());
            if (e != null) {
                throw e;
            }
            return true;
        }
View Full Code Here

            return true;
        }

        private void checkPermissions(@Nonnull Tree tree, long permissions) throws CommitFailedException {
            if (!getPermissionProvider().isGranted(tree, null, permissions)) {
                throw new CommitFailedException(ACCESS, 0, "Access denied");
            }
        }
View Full Code Here

                return merged;
            } finally {
                commitSemaphore.release();
            }
        } catch (InterruptedException e) {
            throw new CommitFailedException(
                    "Segment", 2, "Merge interrupted", e);
        }
    }
View Full Code Here

        if (parent == null) {
            Set<String> offending = newHashSet(rmIds);
            offending.removeAll(rmRefs.keySet());
            offending.removeAll(newIds);
            if (!offending.isEmpty()) {
                throw new CommitFailedException(INTEGRITY, 1,
                        "Unable to delete referenced node");
            }
            rmIds.addAll(discardedIds);

            // update references
View Full Code Here

            path = Text.getRelativeParent(aclPath, 1);
        }
        try {
            restrictionProvider.validateRestrictions(path, aceTree);
        } catch (AccessControlException e) {
            throw new CommitFailedException(ACCESS_CONTROL, 1, "Access control violation", e);
        } catch (RepositoryException e) {
            throw new CommitFailedException(OAK, 13, "Internal error", e);
        }
    }
View Full Code Here

            throw accessViolation(12, "Only root can store repository level policies.");
        }
    }

    private static CommitFailedException accessViolation(int code, String message) {
        return new CommitFailedException(ACCESS_CONTROL, code, message);
    }
View Full Code Here

    public void enter(NodeState before, NodeState after)
            throws CommitFailedException {
        collectIndexEditors(builder.getChildNode(INDEX_DEFINITIONS_NAME));

        // no-op when reindex is empty
        CommitFailedException exception = EditorDiff.process(
                CompositeEditor.compose(reindex), MISSING_NODE, after);
        if (exception != null) {
            throw exception;
        }
View Full Code Here

        }
        if (before == null) {
            before = MISSING_NODE;
        }

        CommitFailedException exception = EditorDiff.process(new IndexUpdate(
                provider, name, after, builder), before, after);
        if (exception == null) {
            try {
                async.setProperty(name, checkpoint);
                postAsyncRunStatus(builder);
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.api.CommitFailedException

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.