Class ConflictHook
java.lang.Object
org.apache.jackrabbit.oak.plugins.commit.ConflictHook
- All Implemented Interfaces:
CommitHook
This commit hook implementation is responsible for resolving
conflicts. It does so by detecting the presence of conflict
markers added by the Microkernel and delegating to a
ThreeWayConflictHandler
for resolving the conflicts.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConflictHook
(ThreeWayConflictHandler conflictHandler) Create a new instance of the conflict hook using the passed conflict handler for resolving conflicts. -
Method Summary
Modifier and TypeMethodDescriptionstatic final ConflictHook
of
(ConflictHandler handler) Deprecated.static final ConflictHook
of
(ThreeWayConflictHandler handler) @NotNull NodeState
processCommit
(NodeState before, NodeState after, CommitInfo info) Validates and/or modifies the given content change before it gets persisted.
-
Constructor Details
-
ConflictHook
Create a new instance of the conflict hook using the passed conflict handler for resolving conflicts.- Parameters:
conflictHandler
- a conflict handler
-
-
Method Details
-
of
Deprecated.Useof(ThreeWayConflictHandler)
instead. -
of
-
processCommit
@NotNull public @NotNull NodeState processCommit(NodeState before, NodeState after, CommitInfo info) throws CommitFailedException Description copied from interface:CommitHook
Validates and/or modifies the given content change before it gets persisted.- Specified by:
processCommit
in interfaceCommitHook
- 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
-
of(ThreeWayConflictHandler)
instead.