public class CompositeConflictHandler extends Object implements ConflictHandler
CompositeConflictHandler
delegates 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. not null)
is found. If for a certain
conflict none of the backing handlers returns a valid resolution
this implementation throws an IllegalStateException
.PartialConflictHandler.Resolution
Constructor and Description |
---|
CompositeConflictHandler()
Create a new
CompositeConflictHandler with no backing handlers. |
CompositeConflictHandler(Iterable<PartialConflictHandler> handlers)
Create a new
CompositeConflictHandler with an initial set of
backing handler. |
Modifier and Type | Method and Description |
---|---|
PartialConflictHandler.Resolution |
addExistingNode(NodeBuilder parent,
String name,
NodeState ours,
NodeState theirs)
The node
ours has been added to parent which conflicts
with node theirs which has been added in the persistence store. |
PartialConflictHandler.Resolution |
addExistingProperty(NodeBuilder parent,
PropertyState ours,
PropertyState theirs)
The property
ours has been added to parent which conflicts
with property theirs which has been added in the persistence store. |
CompositeConflictHandler |
addHandler(PartialConflictHandler handler)
Add a new backing conflict handler.
|
PartialConflictHandler.Resolution |
changeChangedProperty(NodeBuilder parent,
PropertyState ours,
PropertyState theirs)
The property
ours has been changed in parent while it was
also changed to a different value (theirs ) in the persistence store. |
PartialConflictHandler.Resolution |
changeDeletedNode(NodeBuilder parent,
String name,
NodeState ours)
The node
ours has been changed in parent while it was
removed in the persistence store. |
PartialConflictHandler.Resolution |
changeDeletedProperty(NodeBuilder parent,
PropertyState ours)
The property
ours has been changed in parent while it was
removed in the persistence store. |
PartialConflictHandler.Resolution |
deleteChangedNode(NodeBuilder parent,
String name,
NodeState theirs)
The node
theirs changed in the persistence store while it has been
deleted locally. |
PartialConflictHandler.Resolution |
deleteChangedProperty(NodeBuilder parent,
PropertyState theirs)
The property
theirs changed in the persistence store while it has been
deleted locally. |
PartialConflictHandler.Resolution |
deleteDeletedNode(NodeBuilder parent,
String name)
The node
name has been removed in parent while it was
also removed in the persistence store. |
PartialConflictHandler.Resolution |
deleteDeletedProperty(NodeBuilder parent,
PropertyState ours)
The property
ours has been removed in parent while it was
also removed in the persistence store. |
public CompositeConflictHandler(Iterable<PartialConflictHandler> handlers)
CompositeConflictHandler
with an initial set of
backing handler. Use addHandler(PartialConflictHandler)
to add additional
handlers.handlers
- the backing handlerspublic CompositeConflictHandler()
CompositeConflictHandler
with no backing handlers.
backing handler. Use addHandler(PartialConflictHandler)
to add handlers.public CompositeConflictHandler addHandler(PartialConflictHandler handler)
handler
- public PartialConflictHandler.Resolution addExistingProperty(NodeBuilder parent, PropertyState ours, PropertyState theirs)
ConflictHandler
ours
has been added to parent
which conflicts
with property theirs
which has been added in the persistence store.addExistingProperty
in interface ConflictHandler
addExistingProperty
in interface PartialConflictHandler
parent
- root of the conflictours
- our version of the propertytheirs
- their version of the propertyResolution
of the conflictpublic PartialConflictHandler.Resolution changeDeletedProperty(NodeBuilder parent, PropertyState ours)
ConflictHandler
ours
has been changed in parent
while it was
removed in the persistence store.changeDeletedProperty
in interface ConflictHandler
changeDeletedProperty
in interface PartialConflictHandler
parent
- root of the conflictours
- our version of the propertyResolution
of the conflictpublic PartialConflictHandler.Resolution changeChangedProperty(NodeBuilder parent, PropertyState ours, PropertyState theirs)
ConflictHandler
ours
has been changed in parent
while it was
also changed to a different value (theirs
) in the persistence store.changeChangedProperty
in interface ConflictHandler
changeChangedProperty
in interface PartialConflictHandler
parent
- root of the conflictours
- our version of the propertytheirs
- their version of the propertyResolution
of the conflictpublic PartialConflictHandler.Resolution deleteDeletedProperty(NodeBuilder parent, PropertyState ours)
ConflictHandler
ours
has been removed in parent
while it was
also removed in the persistence store.deleteDeletedProperty
in interface ConflictHandler
deleteDeletedProperty
in interface PartialConflictHandler
parent
- root of the conflictours
- our version of the propertyResolution
of the conflictpublic PartialConflictHandler.Resolution deleteChangedProperty(NodeBuilder parent, PropertyState theirs)
ConflictHandler
theirs
changed in the persistence store while it has been
deleted locally.deleteChangedProperty
in interface ConflictHandler
deleteChangedProperty
in interface PartialConflictHandler
parent
- root of the conflicttheirs
- their version of the propertyResolution
of the conflictpublic PartialConflictHandler.Resolution addExistingNode(NodeBuilder parent, String name, NodeState ours, NodeState theirs)
ConflictHandler
ours
has been added to parent
which conflicts
with node theirs
which has been added in the persistence store.addExistingNode
in interface ConflictHandler
addExistingNode
in interface PartialConflictHandler
parent
- root of the conflictname
- name of the nodeours
- our version of the nodetheirs
- their version of the nodeResolution
of the conflictpublic PartialConflictHandler.Resolution changeDeletedNode(NodeBuilder parent, String name, NodeState ours)
ConflictHandler
ours
has been changed in parent
while it was
removed in the persistence store.changeDeletedNode
in interface ConflictHandler
changeDeletedNode
in interface PartialConflictHandler
parent
- root of the conflictname
- name of the nodeours
- our version of the nodeResolution
of the conflictpublic PartialConflictHandler.Resolution deleteChangedNode(NodeBuilder parent, String name, NodeState theirs)
ConflictHandler
theirs
changed in the persistence store while it has been
deleted locally.deleteChangedNode
in interface ConflictHandler
deleteChangedNode
in interface PartialConflictHandler
parent
- root of the conflictname
- name of the nodetheirs
- their version of the nodeResolution
of the conflictpublic PartialConflictHandler.Resolution deleteDeletedNode(NodeBuilder parent, String name)
ConflictHandler
name
has been removed in parent
while it was
also removed in the persistence store.deleteDeletedNode
in interface ConflictHandler
deleteDeletedNode
in interface PartialConflictHandler
parent
- root of the conflictname
- name of the nodeResolution
of the conflict"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"