db4o 6.1

com.db4o.replication
Interface ReplicationProcess


public interface ReplicationProcess

db4o replication interface.

See Also:
ExtObjectContainer.replicationBegin(ObjectContainer, ReplicationConflictHandler)

Method Summary
 void checkConflict(java.lang.Object obj)
          checks if an object has been modified in both ObjectContainers involved in the replication process since the last time the two ObjectContainers were replicated.
 void commit()
          commits the replication task to both involved ObjectContainers.
 ObjectContainer peerA()
          returns the "peerA" ObjectContainer involved in this ReplicationProcess.
 ObjectContainer peerB()
          returns the "peerB" ObjectContainer involved in this ReplicationProcess.
 void replicate(java.lang.Object obj)
          replicates an object.
 void rollback()
          ends a replication task without committing any changes.
 void setDirection(ObjectContainer relicateFrom, ObjectContainer replicateTo)
          modifies the replication policy, what to do on a call to replicate(Object).
 void whereModified(Query query)
          adds a constraint to the passed Query to query only for objects that were modified since the last replication process between the two ObjectContainers involved in this replication process.
 

Method Detail

checkConflict

void checkConflict(java.lang.Object obj)
checks if an object has been modified in both ObjectContainers involved in the replication process since the last time the two ObjectContainers were replicated.

Parameters:
obj - - the object to check for a conflict.

commit

void commit()
commits the replication task to both involved ObjectContainers.

Call this method after replication is completed to write all changes back to the database files. This method synchronizes both ObjectContainers by setting the transaction serial number (@link ExtObjectContainer#version()) on both ObjectContainers to be equal to the higher version number among the two. A record with information about this replication task, including the synchronized version number is stored to both ObjectContainers to allow future incremental replication.


peerA

ObjectContainer peerA()
returns the "peerA" ObjectContainer involved in this ReplicationProcess.


peerB

ObjectContainer peerB()
returns the "peerB" ObjectContainer involved in this ReplicationProcess.


replicate

void replicate(java.lang.Object obj)
replicates an object.

By default the version number of the object is checked in both ObjectContainers involved in the replication process. If the version number has not changed since the last time the two ObjectContainers were replicated

Parameters:
obj -

rollback

void rollback()
ends a replication task without committing any changes.


setDirection

void setDirection(ObjectContainer relicateFrom,
                  ObjectContainer replicateTo)
modifies the replication policy, what to do on a call to replicate(Object).

If no direction is set, the replication process will be bidirectional by default.

Parameters:
relicateFrom - the ObjectContainer to replicate from
replicateTo - the ObjectContainer to replicate to

whereModified

void whereModified(Query query)
adds a constraint to the passed Query to query only for objects that were modified since the last replication process between the two ObjectContainers involved in this replication process.

Parameters:
query - the Query to be constrained

db4o 6.1