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

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


            return false;
        }

        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


@Service(ValidatorProvider.class)
public class NamespaceValidatorProvider implements ValidatorProvider {

    @Override
    public Validator getRootValidator(NodeState before, NodeState after) {
        Validator validator = new NamespaceValidator(
                Namespaces.getNamespaceMap(new ReadOnlyTree(before)));
        return new SubtreeValidator(validator, JCR_SYSTEM, REP_NAMESPACES);
    }
View Full Code Here

        ImmutableTree parent = moveCtx.rootBefore.getTree("/");
        TreePermission tp = getPermissionProvider().getTreePermission(parent, TreePermission.EMPTY);
        for (String n : PathUtils.elements(source.getPath())) {
            tp = tp.getChildPermission(n, parent.getChild(n).getNodeState());
        }
        Validator validator = createValidator(source, dest, tp, this);
        return new VisibleValidator(validator, true, false);
    }
View Full Code Here

            return false;
        }

        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

    @Nonnull
    private Validator nextValidator(@Nullable ImmutableTree parentBefore,
                                    @Nullable ImmutableTree parentAfter,
                                    @Nonnull TreePermission treePermission) {
        Validator validator = createValidator(parentBefore, parentAfter, treePermission, this);
        return new VisibleValidator(validator, true, false);
    }
View Full Code Here

        ImmutableTree parent = moveCtx.rootBefore.getTree("/");
        TreePermission tp = getPermissionProvider().getTreePermission(parent, TreePermission.EMPTY);
        for (String n : source.getPath().split("/")) {
            tp = tp.getChildPermission(n, parent.getChild(n).getNodeState());
        }
        Validator validator = createValidator(source, dest, tp, this);
        return new VisibleValidator(validator, true, false);
    }
View Full Code Here

            return false;
        }

        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

    @Nonnull
    private Validator nextValidator(@Nullable ImmutableTree parentBefore,
                                    @Nullable ImmutableTree parentAfter,
                                    @Nonnull TreePermission treePermission) {
        Validator validator = createValidator(parentBefore, parentAfter, treePermission, this);
        return new VisibleValidator(validator, true, false);
    }
View Full Code Here

        return checkPermissions(child, true, Permissions.REMOVE_NODE);
    }

    //------------------------------------------------------------< private >---
    private Validator nextValidator(@Nullable Tree parentBefore, @Nullable Tree parentAfter, @Nonnull TreePermission treePermission) {
        Validator validator = new PermissionValidator(parentBefore, parentAfter, treePermission, this);
        return new VisibleValidator(validator, true, false);
    }
View Full Code Here

    }

    @Override
    public Validator childNodeAdded(String name, NodeState after) throws CommitFailedException {
        if (canRead(beforeTree.getChild(name), afterTree.getChild(name))) {
            Validator childValidator = validator.childNodeAdded(name, secure(after));
            return childValidator == null
                ? null
                : create(beforeTree.getChild(name), afterTree.getChild(name), childValidator);
        } else {
            return null;
View Full Code Here

TOP

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

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.