Package org.nuiton.topia.replication
Class TopiaReplicationContext
java.lang.Object
org.nuiton.topia.replication.TopiaReplicationContext
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:
- Tony Chemit - chemit@codelutin.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected TopiaEntityIdsMapdictionnary of data to replicate.protected TopiaReplicationOperationProviderprotected final ReplicationModelReplication model.protected final TopiaApplicationContextroot context of incoming data source (says where to obtain entities to replicate).protected final TopiaApplicationContextroot context of outcmoing data source (says where to replicate entities).protected List<ReplicationNode>List of nodes that has been replicated with success (used to rollback them if something was wrong). -
Constructor Summary
ConstructorsConstructorDescriptionTopiaReplicationContext(TopiaReplicationOperationProvider operationProvider, ReplicationModel replicationModel, TopiaApplicationContext sourceTx, TopiaApplicationContext targetTx) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclear()static voidclose(TopiaPersistenceContext tx, boolean rollback) protected voidfinalize()protected TopiaEntityIdsMapgetData()List<? extends TopiaEntity>getEntityIds(Class<? extends TopiaEntity> type) getEntityIds(ReplicationNode node) protected TopiaEntityIdsMapgetIds(TopiaPersistenceContext srcCtxt) getOperation(ReplicationOperationDef operationDef) protected TopiaApplicationContextprotected TopiaApplicationContextprotected List<ReplicationNode>getUndoableOperation(ReplicationOperationDef operationDef) voidinit()Init the replication context.
-
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, TopiaApplicationContext sourceTx, TopiaApplicationContext targetTx)
-
-
Method Details
-
getOperation
-
getUndoableOperation
public TopiaReplicationOperationUndoable getUndoableOperation(ReplicationOperationDef operationDef) throws IllegalArgumentException - Throws:
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
- Throws:
TopiaException
-
getEntityIds
- Throws:
TopiaException
-
getEntities
public List<? extends TopiaEntity> getEntities(TopiaPersistenceContext 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
-