public class MoveDetector extends Object implements Validator
MoveDetector is a validator that can detect certain move operations
and reports these to the wrapped MoveValidator by calling
MoveValidator.move(String, String, NodeState). That method is called additional
to MoveValidator.childNodeAdded(String, NodeState) for the destination of the move
operation and MoveValidator.childNodeDeleted(String, NodeState) for the source of
the move operation.
Detection of move operations relies on the presence of the SOURCE_PATH property.
New nodes with this property set have been moved from the path indicated by the value of the
property to its current location.
Limitations:
| Modifier and Type | Field and Description |
|---|---|
static String |
SOURCE_PATH |
| Constructor and Description |
|---|
MoveDetector(MoveValidator moveValidator) |
| Modifier and Type | Method and Description |
|---|---|
Validator |
childNodeAdded(String name,
NodeState after)
Validate an added node
|
Validator |
childNodeChanged(String name,
NodeState before,
NodeState after)
Validate a changed node
|
Validator |
childNodeDeleted(String name,
NodeState before)
Validate a deleted node
|
void |
enter(NodeState before,
NodeState after)
Called before the given before and after states are compared.
|
void |
leave(NodeState before,
NodeState after)
Called after the given before and after states are compared.
|
void |
propertyAdded(org.apache.jackrabbit.oak.api.PropertyState after)
Validate an added property
|
void |
propertyChanged(org.apache.jackrabbit.oak.api.PropertyState before,
org.apache.jackrabbit.oak.api.PropertyState after)
Validate a changed property
|
void |
propertyDeleted(org.apache.jackrabbit.oak.api.PropertyState before)
Validate a deleted property
|
public static final String SOURCE_PATH
public MoveDetector(MoveValidator moveValidator)
public void enter(NodeState before, NodeState after) throws org.apache.jackrabbit.oak.api.CommitFailedException
Editorenter in interface Editorbefore - before state, non-existent if this node was addedafter - after state, non-existent if this node was removedorg.apache.jackrabbit.oak.api.CommitFailedException - if this commit should be rejectedpublic void leave(NodeState before, NodeState after) throws org.apache.jackrabbit.oak.api.CommitFailedException
Editorleave in interface Editorbefore - before state, non-existent if this node was addedafter - after state, non-existent if this node was removedorg.apache.jackrabbit.oak.api.CommitFailedException - if this commit should be rejectedpublic void propertyAdded(org.apache.jackrabbit.oak.api.PropertyState after) throws org.apache.jackrabbit.oak.api.CommitFailedException
ValidatorpropertyAdded in interface EditorpropertyAdded in interface Validatorafter - the added propertyorg.apache.jackrabbit.oak.api.CommitFailedException - if validation fails.public void propertyChanged(org.apache.jackrabbit.oak.api.PropertyState before, org.apache.jackrabbit.oak.api.PropertyState after) throws org.apache.jackrabbit.oak.api.CommitFailedException
ValidatorpropertyChanged in interface EditorpropertyChanged in interface Validatorbefore - the original propertyafter - the changed propertyorg.apache.jackrabbit.oak.api.CommitFailedException - if validation fails.public void propertyDeleted(org.apache.jackrabbit.oak.api.PropertyState before) throws org.apache.jackrabbit.oak.api.CommitFailedException
ValidatorpropertyDeleted in interface EditorpropertyDeleted in interface Validatorbefore - the original propertyorg.apache.jackrabbit.oak.api.CommitFailedException - if validation fails.public Validator childNodeAdded(String name, NodeState after) throws org.apache.jackrabbit.oak.api.CommitFailedException
ValidatorchildNodeAdded in interface EditorchildNodeAdded in interface Validatorname - the name of the added nodeafter - the added nodeValidator for after or null if validation
should not decent into the subtree rooted at after.org.apache.jackrabbit.oak.api.CommitFailedException - if validation fails.public Validator childNodeChanged(String name, NodeState before, NodeState after) throws org.apache.jackrabbit.oak.api.CommitFailedException
ValidatorchildNodeChanged in interface EditorchildNodeChanged in interface Validatorname - the name of the changed nodebefore - the original nodeafter - the changed nodeValidator for after or null if validation
should not decent into the subtree rooted at after.org.apache.jackrabbit.oak.api.CommitFailedException - if validation fails.public Validator childNodeDeleted(String name, NodeState before) throws org.apache.jackrabbit.oak.api.CommitFailedException
ValidatorchildNodeDeleted in interface EditorchildNodeDeleted in interface Validatorname - The name of the deleted node.before - the original nodeValidator for the removed subtree or
null if validation should not decent into the subtreeorg.apache.jackrabbit.oak.api.CommitFailedException - if validation fails.Copyright © 2012–2017 The Apache Software Foundation. All rights reserved.