com.db4o.replication
Interface ReplicationConflictHandler
public interface ReplicationConflictHandler
will be called by a ReplicationProcess
upon
replication conflicts. Conflicts occur whenever
ReplicationProcess.replicate(Object)
is called with an object that
was modified in both ObjectContainers since the last replication run between
the two.
Method Summary |
java.lang.Object |
resolveConflict(ReplicationProcess replicationProcess,
java.lang.Object a,
java.lang.Object b)
the callback method to be implemented to resolve a conflict. |
resolveConflict
java.lang.Object resolveConflict(ReplicationProcess replicationProcess,
java.lang.Object a,
java.lang.Object b)
- the callback method to be implemented to resolve a conflict.
- Parameters:
replicationProcess
- the ReplicationProcess
for which this
ReplicationConflictHandler is registereda
- the object modified in the peerA ObjectContainerb
- the object modified in the peerB ObjectContainer
- Returns:
- the object (a or b) that should prevail in the conflict or null,
if no action is to be taken. If this would violate the direction
set with
ReplicationProcess.setDirection(ObjectContainer, ObjectContainer)
no action will be taken. - See Also:
ReplicationProcess.peerA()
,
ReplicationProcess.peerB()