Class DefaultThreeWayConflictHandler
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.commit.DefaultThreeWayConflictHandler
-
- All Implemented Interfaces:
ThreeWayConflictHandler
- Direct Known Subclasses:
JcrLastModifiedConflictHandler
public class DefaultThreeWayConflictHandler extends Object implements ThreeWayConflictHandler
This implementation of aThreeWayConflictHandler
always returns the same resolution. It can be used to implement default behaviour or as a base class for more specialised implementations.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.jackrabbit.oak.spi.commit.ThreeWayConflictHandler
ThreeWayConflictHandler.Resolution
-
-
Field Summary
Fields Modifier and Type Field Description static ThreeWayConflictHandler
OURS
AConflictHandler
which always returnThreeWayConflictHandler.Resolution.OURS
.static ThreeWayConflictHandler
THEIRS
AConflictHandler
which always returnThreeWayConflictHandler.Resolution.THEIRS
.
-
Constructor Summary
Constructors Constructor Description DefaultThreeWayConflictHandler(ThreeWayConflictHandler.Resolution resolution)
Create a newConflictHandler
which always returnsresolution
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull ThreeWayConflictHandler.Resolution
addExistingNode(@NotNull NodeBuilder parent, @NotNull String name, @NotNull NodeState ours, @NotNull NodeState theirs)
The nodeours
has been added toparent
which conflicts with nodetheirs
which has been added in the persistence store.@NotNull ThreeWayConflictHandler.Resolution
addExistingProperty(@NotNull NodeBuilder parent, @NotNull PropertyState ours, @NotNull PropertyState theirs)
The propertyours
has been added toparent
which conflicts with propertytheirs
which has been added in the persistence store.@NotNull ThreeWayConflictHandler.Resolution
changeChangedProperty(@NotNull NodeBuilder parent, @NotNull PropertyState ours, @NotNull PropertyState theirs, @NotNull PropertyState base)
The propertyours
has been changed inparent
while it was also changed to a different value (theirs
) in the persistence store.@NotNull ThreeWayConflictHandler.Resolution
changeDeletedNode(@NotNull NodeBuilder parent, @NotNull String name, @NotNull NodeState ours, @NotNull NodeState base)
The nodeours
has been changed inparent
while it was removed in the persistence store.@NotNull ThreeWayConflictHandler.Resolution
changeDeletedProperty(@NotNull NodeBuilder parent, @NotNull PropertyState ours, @NotNull PropertyState base)
The propertyours
has been changed inparent
while it was removed in the persistence store.@NotNull ThreeWayConflictHandler.Resolution
deleteChangedNode(@NotNull NodeBuilder parent, @NotNull String name, @NotNull NodeState theirs, @NotNull NodeState base)
The nodetheirs
changed in the persistence store while it has been deleted locally.@NotNull ThreeWayConflictHandler.Resolution
deleteChangedProperty(@NotNull NodeBuilder parent, @NotNull PropertyState theirs, @NotNull PropertyState base)
The propertytheirs
changed in the persistence store while it has been deleted locally.@NotNull ThreeWayConflictHandler.Resolution
deleteDeletedNode(@NotNull NodeBuilder parent, @NotNull String name, @NotNull NodeState base)
The nodename
has been removed inparent
while it was also removed in the persistence store.@NotNull ThreeWayConflictHandler.Resolution
deleteDeletedProperty(@NotNull NodeBuilder parent, @NotNull PropertyState base)
The propertyours
has been removed inparent
while it was also removed in the persistence store.
-
-
-
Field Detail
-
OURS
public static final ThreeWayConflictHandler OURS
AConflictHandler
which always returnThreeWayConflictHandler.Resolution.OURS
.
-
THEIRS
public static final ThreeWayConflictHandler THEIRS
AConflictHandler
which always returnThreeWayConflictHandler.Resolution.THEIRS
.
-
-
Constructor Detail
-
DefaultThreeWayConflictHandler
public DefaultThreeWayConflictHandler(ThreeWayConflictHandler.Resolution resolution)
Create a newConflictHandler
which always returnsresolution
.- Parameters:
resolution
- the resolution to return from all methods of thisConflictHandler
instance.
-
-
Method Detail
-
addExistingProperty
@NotNull public @NotNull ThreeWayConflictHandler.Resolution addExistingProperty(@NotNull @NotNull NodeBuilder parent, @NotNull @NotNull PropertyState ours, @NotNull @NotNull PropertyState theirs)
Description copied from interface:ThreeWayConflictHandler
The propertyours
has been added toparent
which conflicts with propertytheirs
which has been added in the persistence store.- Specified by:
addExistingProperty
in interfaceThreeWayConflictHandler
- Parameters:
parent
- root of the conflictours
- our version of the propertytheirs
- their version of the property- Returns:
ThreeWayConflictHandler.Resolution
of the conflict
-
changeDeletedProperty
@NotNull public @NotNull ThreeWayConflictHandler.Resolution changeDeletedProperty(@NotNull @NotNull NodeBuilder parent, @NotNull @NotNull PropertyState ours, @NotNull @NotNull PropertyState base)
Description copied from interface:ThreeWayConflictHandler
The propertyours
has been changed inparent
while it was removed in the persistence store.- Specified by:
changeDeletedProperty
in interfaceThreeWayConflictHandler
- Parameters:
parent
- root of the conflictours
- our version of the propertybase
- the base version of the property- Returns:
ThreeWayConflictHandler.Resolution
of the conflict
-
changeChangedProperty
@NotNull public @NotNull ThreeWayConflictHandler.Resolution changeChangedProperty(@NotNull @NotNull NodeBuilder parent, @NotNull @NotNull PropertyState ours, @NotNull @NotNull PropertyState theirs, @NotNull @NotNull PropertyState base)
Description copied from interface:ThreeWayConflictHandler
The propertyours
has been changed inparent
while it was also changed to a different value (theirs
) in the persistence store.- Specified by:
changeChangedProperty
in interfaceThreeWayConflictHandler
- Parameters:
parent
- root of the conflictours
- our version of the propertytheirs
- their version of the propertybase
- the base version of the property- Returns:
ThreeWayConflictHandler.Resolution
of the conflict
-
deleteDeletedProperty
@NotNull public @NotNull ThreeWayConflictHandler.Resolution deleteDeletedProperty(@NotNull @NotNull NodeBuilder parent, @NotNull @NotNull PropertyState base)
Description copied from interface:ThreeWayConflictHandler
The propertyours
has been removed inparent
while it was also removed in the persistence store.- Specified by:
deleteDeletedProperty
in interfaceThreeWayConflictHandler
- Parameters:
parent
- root of the conflictbase
- the base version of the property- Returns:
ThreeWayConflictHandler.Resolution
of the conflict
-
deleteChangedProperty
@NotNull public @NotNull ThreeWayConflictHandler.Resolution deleteChangedProperty(@NotNull @NotNull NodeBuilder parent, @NotNull @NotNull PropertyState theirs, @NotNull @NotNull PropertyState base)
Description copied from interface:ThreeWayConflictHandler
The propertytheirs
changed in the persistence store while it has been deleted locally.- Specified by:
deleteChangedProperty
in interfaceThreeWayConflictHandler
- Parameters:
parent
- root of the conflicttheirs
- their version of the propertybase
- the base version of the property- Returns:
ThreeWayConflictHandler.Resolution
of the conflict
-
addExistingNode
@NotNull public @NotNull ThreeWayConflictHandler.Resolution addExistingNode(@NotNull @NotNull NodeBuilder parent, @NotNull @NotNull String name, @NotNull @NotNull NodeState ours, @NotNull @NotNull NodeState theirs)
Description copied from interface:ThreeWayConflictHandler
The nodeours
has been added toparent
which conflicts with nodetheirs
which has been added in the persistence store.- Specified by:
addExistingNode
in interfaceThreeWayConflictHandler
- Parameters:
parent
- root of the conflictname
- name of the nodeours
- our version of the nodetheirs
- their version of the node- Returns:
ThreeWayConflictHandler.Resolution
of the conflict
-
changeDeletedNode
@NotNull public @NotNull ThreeWayConflictHandler.Resolution changeDeletedNode(@NotNull @NotNull NodeBuilder parent, @NotNull @NotNull String name, @NotNull @NotNull NodeState ours, @NotNull @NotNull NodeState base)
Description copied from interface:ThreeWayConflictHandler
The nodeours
has been changed inparent
while it was removed in the persistence store.- Specified by:
changeDeletedNode
in interfaceThreeWayConflictHandler
- Parameters:
parent
- root of the conflictname
- name of the nodeours
- our version of the nodebase
- the base version of the node- Returns:
ThreeWayConflictHandler.Resolution
of the conflict
-
deleteChangedNode
@NotNull public @NotNull ThreeWayConflictHandler.Resolution deleteChangedNode(@NotNull @NotNull NodeBuilder parent, @NotNull @NotNull String name, @NotNull @NotNull NodeState theirs, @NotNull @NotNull NodeState base)
Description copied from interface:ThreeWayConflictHandler
The nodetheirs
changed in the persistence store while it has been deleted locally.- Specified by:
deleteChangedNode
in interfaceThreeWayConflictHandler
- Parameters:
parent
- root of the conflictname
- name of the nodetheirs
- their version of the nodebase
- the base version of the node- Returns:
ThreeWayConflictHandler.Resolution
of the conflict
-
deleteDeletedNode
@NotNull public @NotNull ThreeWayConflictHandler.Resolution deleteDeletedNode(@NotNull @NotNull NodeBuilder parent, @NotNull @NotNull String name, @NotNull @NotNull NodeState base)
Description copied from interface:ThreeWayConflictHandler
The nodename
has been removed inparent
while it was also removed in the persistence store.- Specified by:
deleteDeletedNode
in interfaceThreeWayConflictHandler
- Parameters:
parent
- root of the conflictname
- name of the nodebase
- the base version of the node- Returns:
ThreeWayConflictHandler.Resolution
of the conflict
-
-