Class CrossMountReferenceValidator
java.lang.Object
org.apache.jackrabbit.oak.spi.commit.DefaultValidator
org.apache.jackrabbit.oak.composite.CrossMountReferenceValidator
-
Field Summary
Fields inherited from class org.apache.jackrabbit.oak.spi.commit.DefaultValidator
INSTANCE
-
Constructor Summary
ConstructorsConstructorDescriptionCrossMountReferenceValidator
(NodeState root, MountInfoProvider mip, boolean failOnDetection) -
Method Summary
Modifier and TypeMethodDescriptionchildNodeAdded
(String name, NodeState after) Validate an added nodechildNodeChanged
(String name, NodeState before, NodeState after) Validate a changed nodevoid
Called before the given before and after states are compared.void
Called after the given before and after states are compared.void
propertyAdded
(PropertyState after) Validate an added propertyvoid
propertyChanged
(PropertyState before, PropertyState after) Validate a changed propertyMethods inherited from class org.apache.jackrabbit.oak.spi.commit.DefaultValidator
childNodeDeleted, propertyDeleted
-
Constructor Details
-
CrossMountReferenceValidator
-
-
Method Details
-
enter
Description copied from interface:Editor
Called before the given before and after states are compared. The implementation can use this method to initialize any internal state needed for processing the results of the comparison. For example an implementation could look up the effective node type of the after state to know what constraints to apply to on the content changes.- Specified by:
enter
in interfaceEditor
- Overrides:
enter
in classDefaultValidator
- Parameters:
before
- before state, non-existent if this node was addedafter
- after state, non-existent if this node was removed- Throws:
CommitFailedException
- if this commit should be rejected
-
leave
Description copied from interface:Editor
Called after the given before and after states are compared. The implementation can use this method to post-process information collected during the content diff. For example an implementation that during the diff just recorded the fact that this node was modified in some way could then use this method to trigger an index update based on that modification flag.- Specified by:
leave
in interfaceEditor
- Overrides:
leave
in classDefaultValidator
- Parameters:
before
- before state, non-existent if this node was addedafter
- after state, non-existent if this node was removed- Throws:
CommitFailedException
- if this commit should be rejected
-
propertyAdded
Description copied from interface:Validator
Validate an added property- Specified by:
propertyAdded
in interfaceEditor
- Specified by:
propertyAdded
in interfaceValidator
- Overrides:
propertyAdded
in classDefaultValidator
- Parameters:
after
- the added property- Throws:
CommitFailedException
- if validation fails.
-
propertyChanged
Description copied from interface:Validator
Validate a changed property- Specified by:
propertyChanged
in interfaceEditor
- Specified by:
propertyChanged
in interfaceValidator
- Overrides:
propertyChanged
in classDefaultValidator
- Parameters:
before
- the original propertyafter
- the changed property- Throws:
CommitFailedException
- if validation fails.
-
childNodeAdded
Description copied from interface:Validator
Validate an added node- Specified by:
childNodeAdded
in interfaceEditor
- Specified by:
childNodeAdded
in interfaceValidator
- Overrides:
childNodeAdded
in classDefaultValidator
- Parameters:
name
- the name of the added nodeafter
- the added node- Returns:
- a
Validator
forafter
ornull
if validation should not decent into the subtree rooted atafter
. - Throws:
CommitFailedException
- if validation fails.
-
childNodeChanged
public Validator childNodeChanged(String name, NodeState before, NodeState after) throws CommitFailedException Description copied from interface:Validator
Validate a changed node- Specified by:
childNodeChanged
in interfaceEditor
- Specified by:
childNodeChanged
in interfaceValidator
- Overrides:
childNodeChanged
in classDefaultValidator
- Parameters:
name
- the name of the changed nodebefore
- the original nodeafter
- the changed node- Returns:
- a
Validator
forafter
ornull
if validation should not decent into the subtree rooted atafter
. - Throws:
CommitFailedException
- if validation fails.
-