@Test(expected = CommitFailedException.class) public void testChildNodeDeleted() throws Exception { try { root.getTree(PRIVILEGES_PATH).getChild(JCR_READ).remove(); root.commit(); } catch (CommitFailedException e) { throw assertCommitFailed(e, 42); } }
@Override public Validator childNodeDeleted(String name, NodeState before) throws CommitFailedException { if (isPrivilegeDefinition(before)) { throw new CommitFailedException(CONSTRAINT, 42, "Attempt to un-register privilege " + name); } else { return null; } }
PrivilegeValidator extends DefaultValidator implements PrivilegeConstants { @Override public Validator childNodeDeleted(String name, NodeState before) throws CommitFailedException { if (isPrivilegeDefinition(before)) { throw new CommitFailedException(CONSTRAINT, 42, "Attempt to un-register privilege " + name); } else { return null; } } }
PrivilegeValidator extends DefaultValidator implements PrivilegeConstants { @Override public Validator childNodeDeleted(String name, NodeState before) throws CommitFailedException { if (isPrivilegeDefinition(before)) { throw new CommitFailedException(CONSTRAINT, 42, "Attempt to un-register privilege " + name); } else { return null; } } PrivilegeValidator(@NotNull Root before, @NotNull Root after, @NotNull TreeProvider treeProvider); }
PrivilegeValidator extends DefaultValidator implements PrivilegeConstants { @Override public Validator childNodeDeleted(String name, NodeState before) throws CommitFailedException { if (isPrivilegeDefinition(before)) { throw new CommitFailedException(CONSTRAINT, 42, "Attempt to un-register privilege " + name); } else { return null; } } PrivilegeValidator(@NotNull Root before, @NotNull Root after, @NotNull TreeProvider treeProvider); @Override void propertyAdded(PropertyState after); @Override void propertyChanged(PropertyState before, PropertyState after); @Override void propertyDeleted(PropertyState before); @Override Validator childNodeAdded(String name, NodeState after); @Override Validator childNodeChanged(String name, NodeState before, NodeState after); @Override Validator childNodeDeleted(String name, NodeState before); }
PrivilegeValidator extends DefaultValidator implements PrivilegeConstants { @Override public Validator childNodeDeleted(String name, NodeState before) throws CommitFailedException { if (isPrivilegeDefinition(before)) { throw new CommitFailedException(CONSTRAINT, 42, "Attempt to un-register privilege " + name); } else { return null; } } PrivilegeValidator(@NotNull Root before, @NotNull Root after, @NotNull TreeProvider treeProvider); @Override void propertyAdded(PropertyState after); @Override void propertyChanged(PropertyState before, PropertyState after); @Override void propertyDeleted(PropertyState before); @Override Validator childNodeAdded(String name, NodeState after); @Override Validator childNodeChanged(String name, NodeState before, NodeState after); @Override Validator childNodeDeleted(String name, NodeState before);  }