Interface CommitHook
-
- All Known Subinterfaces:
PostValidationHook
- All Known Implementing Classes:
CommitRateLimiter
,CompositeHook
,ConflictHook
,EditorHook
,EmptyHook
,ResetCommitAttributeHook
,VersionHook
public interface CommitHook
Extension point for validating and modifying content changes. Available commit hooks are called in sequence to process incoming content changes before they get persisted and shared with other clients.A commit hook can throw a
CommitFailedException
for a particular change to prevent it from being persisted, or it can modify the changes for example to update an in-content index or to add auto-generated content.Note that instead of implementing this interface directly, most commit editors and validators are better expressed as implementations of the more specific extension interfaces defined in this package.
- See Also:
- The commit hook mechanism
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull NodeState
processCommit(NodeState before, NodeState after, CommitInfo info)
Validates and/or modifies the given content change before it gets persisted.
-
-
-
Method Detail
-
processCommit
@NotNull @NotNull NodeState processCommit(NodeState before, NodeState after, CommitInfo info) throws CommitFailedException
Validates and/or modifies the given content change before it gets persisted.- Parameters:
before
- content tree before the commitafter
- content tree prepared for the commitinfo
- metadata associated with this commit- Returns:
- content tree to be committed
- Throws:
CommitFailedException
- if the commit should be rejected
-
-