Interface ThreeWayConflictHandler

All Known Implementing Classes:
CompositeConflictHandler

public interface ThreeWayConflictHandler
A ThreeWayConflictHandler is responsible for handling conflicts which happen on Root.rebase() and on the implicit rebase operation which takes part on Root.commit(). This interface contains one method per type of conflict which might occur. Each of these methods must return a ThreeWayConflictHandler.Resolution for the current conflict. The resolution indicates to use the changes in the current Root instance (ThreeWayConflictHandler.Resolution.OURS) or to use the changes from the underlying persistence store (ThreeWayConflictHandler.Resolution.THEIRS). Alternatively the resolution can also indicate that the changes have been successfully merged by this ThreeWayConflictHandler instance (ThreeWayConflictHandler.Resolution.MERGED).
  • Method Details

    • addExistingProperty

      @NotNull @NotNull ThreeWayConflictHandler.Resolution addExistingProperty(@NotNull @NotNull NodeBuilder parent, @NotNull @NotNull org.apache.jackrabbit.oak.api.PropertyState ours, @NotNull @NotNull org.apache.jackrabbit.oak.api.PropertyState theirs)
      The property ours has been added to parent which conflicts with property theirs which has been added in the persistence store.
      Parameters:
      parent - root of the conflict
      ours - our version of the property
      theirs - their version of the property
      Returns:
      ThreeWayConflictHandler.Resolution of the conflict
    • changeDeletedProperty

      @NotNull @NotNull ThreeWayConflictHandler.Resolution changeDeletedProperty(@NotNull @NotNull NodeBuilder parent, @NotNull @NotNull org.apache.jackrabbit.oak.api.PropertyState ours, @NotNull @NotNull org.apache.jackrabbit.oak.api.PropertyState base)
      The property ours has been changed in parent while it was removed in the persistence store.
      Parameters:
      parent - root of the conflict
      ours - our version of the property
      base - the base version of the property
      Returns:
      ThreeWayConflictHandler.Resolution of the conflict
    • changeChangedProperty

      @NotNull @NotNull ThreeWayConflictHandler.Resolution changeChangedProperty(@NotNull @NotNull NodeBuilder parent, @NotNull @NotNull org.apache.jackrabbit.oak.api.PropertyState ours, @NotNull @NotNull org.apache.jackrabbit.oak.api.PropertyState theirs, @NotNull @NotNull org.apache.jackrabbit.oak.api.PropertyState base)
      The property ours has been changed in parent while it was also changed to a different value (theirs) in the persistence store.
      Parameters:
      parent - root of the conflict
      ours - our version of the property
      theirs - their version of the property
      base - the base version of the property
      Returns:
      ThreeWayConflictHandler.Resolution of the conflict
    • deleteDeletedProperty

      @NotNull @NotNull ThreeWayConflictHandler.Resolution deleteDeletedProperty(@NotNull @NotNull NodeBuilder parent, @NotNull @NotNull org.apache.jackrabbit.oak.api.PropertyState base)
      The property ours has been removed in parent while it was also removed in the persistence store.
      Parameters:
      parent - root of the conflict
      base - the base version of the property
      Returns:
      ThreeWayConflictHandler.Resolution of the conflict
    • deleteChangedProperty

      @NotNull @NotNull ThreeWayConflictHandler.Resolution deleteChangedProperty(@NotNull @NotNull NodeBuilder parent, @NotNull @NotNull org.apache.jackrabbit.oak.api.PropertyState theirs, @NotNull @NotNull org.apache.jackrabbit.oak.api.PropertyState base)
      The property theirs changed in the persistence store while it has been deleted locally.
      Parameters:
      parent - root of the conflict
      theirs - their version of the property
      base - the base version of the property
      Returns:
      ThreeWayConflictHandler.Resolution of the conflict
    • addExistingNode

      @NotNull @NotNull ThreeWayConflictHandler.Resolution addExistingNode(@NotNull @NotNull NodeBuilder parent, @NotNull @NotNull String name, @NotNull @NotNull NodeState ours, @NotNull @NotNull NodeState theirs)
      The node ours has been added to parent which conflicts with node theirs which has been added in the persistence store.
      Parameters:
      parent - root of the conflict
      name - name of the node
      ours - our version of the node
      theirs - their version of the node
      Returns:
      ThreeWayConflictHandler.Resolution of the conflict
    • changeDeletedNode

      @NotNull @NotNull ThreeWayConflictHandler.Resolution changeDeletedNode(@NotNull @NotNull NodeBuilder parent, @NotNull @NotNull String name, @NotNull @NotNull NodeState ours, @NotNull @NotNull NodeState base)
      The node ours has been changed in parent while it was removed in the persistence store.
      Parameters:
      parent - root of the conflict
      name - name of the node
      ours - our version of the node
      base - the base version of the node
      Returns:
      ThreeWayConflictHandler.Resolution of the conflict
    • deleteChangedNode

      @NotNull @NotNull ThreeWayConflictHandler.Resolution deleteChangedNode(@NotNull @NotNull NodeBuilder parent, @NotNull @NotNull String name, @NotNull @NotNull NodeState theirs, @NotNull @NotNull NodeState base)
      The node theirs changed in the persistence store while it has been deleted locally.
      Parameters:
      parent - root of the conflict
      name - name of the node
      theirs - their version of the node
      base - the base version of the node
      Returns:
      ThreeWayConflictHandler.Resolution of the conflict
    • deleteDeletedNode

      @NotNull @NotNull ThreeWayConflictHandler.Resolution deleteDeletedNode(@NotNull @NotNull NodeBuilder parent, @NotNull @NotNull String name, @NotNull @NotNull NodeState base)
      The node name has been removed in parent while it was also removed in the persistence store.
      Parameters:
      parent - root of the conflict
      name - name of the node
      base - the base version of the node
      Returns:
      ThreeWayConflictHandler.Resolution of the conflict