Class ConflictHook
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.commit.ConflictHook
-
- All Implemented Interfaces:
CommitHook
public class ConflictHook extends java.lang.Object implements 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 aThreeWayConflictHandler
for resolving the conflicts.
-
-
Constructor Summary
Constructors Constructor Description ConflictHook(ThreeWayConflictHandler conflictHandler)
Create a new instance of the conflict hook using the passed conflict handler for resolving conflicts.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ConflictHook
of(ConflictHandler handler)
Deprecated.Useof(ThreeWayConflictHandler)
instead.static 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 Detail
-
ConflictHook
public ConflictHook(ThreeWayConflictHandler conflictHandler)
Create a new instance of the conflict hook using the passed conflict handler for resolving conflicts.- Parameters:
conflictHandler
- a conflict handler
-
-
Method Detail
-
of
@Deprecated public static final ConflictHook of(ConflictHandler handler)
Deprecated.Useof(ThreeWayConflictHandler)
instead.
-
of
public static final ConflictHook of(ThreeWayConflictHandler handler)
-
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
-
-