Class CompositeConflictHandler
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.commit.CompositeConflictHandler
-
- All Implemented Interfaces:
ThreeWayConflictHandler
public class CompositeConflictHandler extends java.lang.Object implements ThreeWayConflictHandler
ACompositeConflictHandlerdelegates conflict handling to multiple backing handlers. The backing handlers are invoked in the inverse order they have been installed until a handler returning a valid resolution (i.e. notIGNORED)is found. If for a certain conflict none of the backing handlers returns a valid resolution this implementation throws anIllegalStateException.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.jackrabbit.oak.spi.commit.ThreeWayConflictHandler
ThreeWayConflictHandler.Resolution
-
-
Constructor Summary
Constructors Constructor Description CompositeConflictHandler()Create a newCompositeConflictHandlerwith no backing handlers.CompositeConflictHandler(@NotNull java.lang.Iterable<ThreeWayConflictHandler> handlers)Create a newCompositeConflictHandlerwith an initial set of backing handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ThreeWayConflictHandler.ResolutionaddExistingNode(NodeBuilder parent, java.lang.String name, NodeState ours, NodeState theirs)The nodeourshas been added toparentwhich conflicts with nodetheirswhich has been added in the persistence store.ThreeWayConflictHandler.ResolutionaddExistingProperty(NodeBuilder parent, PropertyState ours, PropertyState theirs)The propertyourshas been added toparentwhich conflicts with propertytheirswhich has been added in the persistence store.CompositeConflictHandleraddHandler(ThreeWayConflictHandler handler)Add a new backing conflict handler.ThreeWayConflictHandler.ResolutionchangeChangedProperty(NodeBuilder parent, PropertyState ours, PropertyState theirs, PropertyState base)The propertyourshas been changed inparentwhile it was also changed to a different value (theirs) in the persistence store.ThreeWayConflictHandler.ResolutionchangeDeletedNode(NodeBuilder parent, java.lang.String name, NodeState ours, NodeState base)The nodeourshas been changed inparentwhile it was removed in the persistence store.ThreeWayConflictHandler.ResolutionchangeDeletedProperty(NodeBuilder parent, PropertyState ours, PropertyState base)The propertyourshas been changed inparentwhile it was removed in the persistence store.ThreeWayConflictHandler.ResolutiondeleteChangedNode(NodeBuilder parent, java.lang.String name, NodeState theirs, NodeState base)The nodetheirschanged in the persistence store while it has been deleted locally.ThreeWayConflictHandler.ResolutiondeleteChangedProperty(NodeBuilder parent, PropertyState theirs, PropertyState base)The propertytheirschanged in the persistence store while it has been deleted locally.ThreeWayConflictHandler.ResolutiondeleteDeletedNode(NodeBuilder parent, java.lang.String name, NodeState base)The nodenamehas been removed inparentwhile it was also removed in the persistence store.ThreeWayConflictHandler.ResolutiondeleteDeletedProperty(NodeBuilder parent, PropertyState base)The propertyourshas been removed inparentwhile it was also removed in the persistence store.
-
-
-
Constructor Detail
-
CompositeConflictHandler
public CompositeConflictHandler(@NotNull @NotNull java.lang.Iterable<ThreeWayConflictHandler> handlers)Create a newCompositeConflictHandlerwith an initial set of backing handler. UseaddHandler(ThreeWayConflictHandler)to add additional handlers.- Parameters:
handlers- the backing handlers
-
CompositeConflictHandler
public CompositeConflictHandler()
Create a newCompositeConflictHandlerwith no backing handlers. backing handler. UseaddHandler(ThreeWayConflictHandler)to add handlers.
-
-
Method Detail
-
addHandler
public CompositeConflictHandler addHandler(ThreeWayConflictHandler handler)
Add a new backing conflict handler. The new handler takes precedence over all currently installed handlers.- Parameters:
handler-- Returns:
- this
-
addExistingProperty
public ThreeWayConflictHandler.Resolution addExistingProperty(NodeBuilder parent, PropertyState ours, PropertyState theirs)
Description copied from interface:ThreeWayConflictHandlerThe propertyourshas been added toparentwhich conflicts with propertytheirswhich has been added in the persistence store.- Specified by:
addExistingPropertyin interfaceThreeWayConflictHandler- Parameters:
parent- root of the conflictours- our version of the propertytheirs- their version of the property- Returns:
ThreeWayConflictHandler.Resolutionof the conflict
-
changeDeletedProperty
public ThreeWayConflictHandler.Resolution changeDeletedProperty(NodeBuilder parent, PropertyState ours, PropertyState base)
Description copied from interface:ThreeWayConflictHandlerThe propertyourshas been changed inparentwhile it was removed in the persistence store.- Specified by:
changeDeletedPropertyin interfaceThreeWayConflictHandler- Parameters:
parent- root of the conflictours- our version of the propertybase- the base version of the property- Returns:
ThreeWayConflictHandler.Resolutionof the conflict
-
changeChangedProperty
public ThreeWayConflictHandler.Resolution changeChangedProperty(NodeBuilder parent, PropertyState ours, PropertyState theirs, PropertyState base)
Description copied from interface:ThreeWayConflictHandlerThe propertyourshas been changed inparentwhile it was also changed to a different value (theirs) in the persistence store.- Specified by:
changeChangedPropertyin 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.Resolutionof the conflict
-
deleteDeletedProperty
public ThreeWayConflictHandler.Resolution deleteDeletedProperty(NodeBuilder parent, PropertyState base)
Description copied from interface:ThreeWayConflictHandlerThe propertyourshas been removed inparentwhile it was also removed in the persistence store.- Specified by:
deleteDeletedPropertyin interfaceThreeWayConflictHandler- Parameters:
parent- root of the conflictbase- the base version of the property- Returns:
ThreeWayConflictHandler.Resolutionof the conflict
-
deleteChangedProperty
public ThreeWayConflictHandler.Resolution deleteChangedProperty(NodeBuilder parent, PropertyState theirs, PropertyState base)
Description copied from interface:ThreeWayConflictHandlerThe propertytheirschanged in the persistence store while it has been deleted locally.- Specified by:
deleteChangedPropertyin interfaceThreeWayConflictHandler- Parameters:
parent- root of the conflicttheirs- their version of the propertybase- the base version of the property- Returns:
ThreeWayConflictHandler.Resolutionof the conflict
-
addExistingNode
public ThreeWayConflictHandler.Resolution addExistingNode(NodeBuilder parent, java.lang.String name, NodeState ours, NodeState theirs)
Description copied from interface:ThreeWayConflictHandlerThe nodeourshas been added toparentwhich conflicts with nodetheirswhich has been added in the persistence store.- Specified by:
addExistingNodein interfaceThreeWayConflictHandler- Parameters:
parent- root of the conflictname- name of the nodeours- our version of the nodetheirs- their version of the node- Returns:
ThreeWayConflictHandler.Resolutionof the conflict
-
changeDeletedNode
public ThreeWayConflictHandler.Resolution changeDeletedNode(NodeBuilder parent, java.lang.String name, NodeState ours, NodeState base)
Description copied from interface:ThreeWayConflictHandlerThe nodeourshas been changed inparentwhile it was removed in the persistence store.- Specified by:
changeDeletedNodein interfaceThreeWayConflictHandler- Parameters:
parent- root of the conflictname- name of the nodeours- our version of the nodebase- the base version of the node- Returns:
ThreeWayConflictHandler.Resolutionof the conflict
-
deleteChangedNode
public ThreeWayConflictHandler.Resolution deleteChangedNode(NodeBuilder parent, java.lang.String name, NodeState theirs, NodeState base)
Description copied from interface:ThreeWayConflictHandlerThe nodetheirschanged in the persistence store while it has been deleted locally.- Specified by:
deleteChangedNodein interfaceThreeWayConflictHandler- Parameters:
parent- root of the conflictname- name of the nodetheirs- their version of the nodebase- the base version of the node- Returns:
ThreeWayConflictHandler.Resolutionof the conflict
-
deleteDeletedNode
public ThreeWayConflictHandler.Resolution deleteDeletedNode(NodeBuilder parent, java.lang.String name, NodeState base)
Description copied from interface:ThreeWayConflictHandlerThe nodenamehas been removed inparentwhile it was also removed in the persistence store.- Specified by:
deleteDeletedNodein interfaceThreeWayConflictHandler- Parameters:
parent- root of the conflictname- name of the nodebase- the base version of the node- Returns:
ThreeWayConflictHandler.Resolutionof the conflict
-
-