Package org.nuiton.topia.replication
Class TopiaReplicationContext
java.lang.Object
org.nuiton.topia.replication.TopiaReplicationContext
public class TopiaReplicationContext
extends java.lang.Object
Defines the context used to replicate.
It contains :
- the
replicationModel - data sources involved ([@link #sourceTx},
targetTx) - universe of data to replicate
data - nodes that has been treated successfully
treated
- Since:
- 2.4.3
- Author:
- tchemit <chemit@codelutin.com>
-
Field Summary
Fields Modifier and Type Field Description protected TopiaEntityIdsMapdatadictionnary of data to replicate.protected TopiaReplicationOperationProvideroperationProviderprotected ReplicationModelreplicationModelReplication model.protected TopiaContextsourceTxroot context of incoming data source (says where to obtain entities to replicate).protected TopiaContexttargetTxroot context of outcmoing data source (says where to replicate entities).protected java.util.List<ReplicationNode>treatedList of nodes that has been replicated with success (used to rollback them if something was wrong). -
Constructor Summary
Constructors Constructor Description TopiaReplicationContext(TopiaReplicationOperationProvider operationProvider, ReplicationModel replicationModel, TopiaContext sourceTx, TopiaContext targetTx) -
Method Summary
-
Field Details
-
replicationModel
Replication model. -
sourceTx
root context of incoming data source (says where to obtain entities to replicate). -
targetTx
root context of outcmoing data source (says where to replicate entities). -
data
dictionnary of data to replicate. -
treated
List of nodes that has been replicated with success (used to rollback them if something was wrong). -
operationProvider
-
-
Constructor Details
-
TopiaReplicationContext
public TopiaReplicationContext(TopiaReplicationOperationProvider operationProvider, ReplicationModel replicationModel, TopiaContext sourceTx, TopiaContext targetTx)
-
-
Method Details
-
getOperation
-
getUndoableOperation
public TopiaReplicationOperationUndoable getUndoableOperation(ReplicationOperationDef operationDef) throws java.lang.IllegalArgumentException- Throws:
java.lang.IllegalArgumentException
-
getReplicationModel
-
addTreatedNode
-
getReverseTreated
-
init
Init the replication context. Comptute the universe to replicate and store it indata.- Throws:
TopiaException- for any error when initializing the replication context
-
getEntityIds
public java.util.List<java.lang.String> getEntityIds(java.lang.Class<? extends TopiaEntity> type) throws TopiaException- Throws:
TopiaException
-
getEntityIds
- Throws:
TopiaException
-
getEntities
public java.util.List<? extends TopiaEntity> getEntities(TopiaContextImplementor tx, ReplicationNode node) throws TopiaException- Throws:
TopiaException
-
newSourceTx
- Throws:
TopiaException
-
newTargetTx
- Throws:
TopiaException
-
close
- Throws:
TopiaException
-
clear
public void clear() -
getIds
- Throws:
TopiaException
-
getTreated
-
getSourceTx
-
getTargetTx
-
getData
-
finalize
protected void finalize() throws java.lang.Throwable- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-