org.nuiton.topia.replication
Class TopiaReplicationContext

java.lang.Object
  extended by org.nuiton.topia.replication.TopiaReplicationContext

public class TopiaReplicationContext
extends Object

Defines the context used to replicate.

It contains :

Since:
2.4.3
Author:
tchemit

Field Summary
protected  TopiaEntityIdsMap data
          dictionnary of data to replicate.
protected  TopiaReplicationOperationProvider operationProvider
           
protected  ReplicationModel replicationModel
          Replication model.
protected  TopiaContext sourceTx
          root context of incoming data source (says where to obtain entities to replicate).
protected  TopiaContext targetTx
          root context of outcmoing data source (says where to replicate entities).
protected  List<ReplicationNode> treated
          List of nodes that has been replicated with success (used to rollback them if something was wrong).
 
Constructor Summary
TopiaReplicationContext(TopiaReplicationOperationProvider operationProvider, ReplicationModel replicationModel, TopiaContext sourceTx, TopiaContext targetTx)
           
 
Method Summary
 void addTreatedNode(ReplicationNode node)
           
 void clear()
           
static void close(TopiaContext tx, boolean rollback)
           
protected  void finalize()
           
protected  TopiaEntityIdsMap getData()
           
 List<? extends TopiaEntity> getEntities(TopiaContextImplementor tx, ReplicationNode node)
           
 List<String> getEntityIds(Class<? extends TopiaEntity> type)
           
 List<String> getEntityIds(ReplicationNode node)
           
protected  TopiaEntityIdsMap getIds(TopiaContextImplementor srcCtxt)
           
 TopiaReplicationOperation getOperation(ReplicationOperationDef operationDef)
           
 ReplicationModel getReplicationModel()
           
 ReplicationNode[] getReverseTreated()
           
protected  TopiaContext getSourceTx()
           
protected  TopiaContext getTargetTx()
           
protected  List<ReplicationNode> getTreated()
           
 TopiaReplicationOperationUndoable getUndoableOperation(ReplicationOperationDef operationDef)
           
 void init()
          Init the replication context.
 TopiaContextImplementor newSourceTx()
           
 TopiaContextImplementor newTargetTx()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

replicationModel

protected final ReplicationModel replicationModel
Replication model.


sourceTx

protected final TopiaContext sourceTx
root context of incoming data source (says where to obtain entities to replicate).


targetTx

protected final TopiaContext targetTx
root context of outcmoing data source (says where to replicate entities).


data

protected TopiaEntityIdsMap data
dictionnary of data to replicate.


treated

protected List<ReplicationNode> treated
List of nodes that has been replicated with success (used to rollback them if something was wrong).


operationProvider

protected TopiaReplicationOperationProvider operationProvider
Constructor Detail

TopiaReplicationContext

public TopiaReplicationContext(TopiaReplicationOperationProvider operationProvider,
                               ReplicationModel replicationModel,
                               TopiaContext sourceTx,
                               TopiaContext targetTx)
Method Detail

getOperation

public TopiaReplicationOperation getOperation(ReplicationOperationDef operationDef)

getUndoableOperation

public TopiaReplicationOperationUndoable getUndoableOperation(ReplicationOperationDef operationDef)
                                                       throws IllegalArgumentException
Throws:
IllegalArgumentException

getReplicationModel

public ReplicationModel getReplicationModel()

addTreatedNode

public void addTreatedNode(ReplicationNode node)

getReverseTreated

public ReplicationNode[] getReverseTreated()

init

public void init()
          throws TopiaException
Init the replication context.

Comptute the universe to replicate and store it in data.

Throws:
TopiaException - for any error when initializing the replication context

getEntityIds

public List<String> getEntityIds(Class<? extends TopiaEntity> type)
                          throws TopiaException
Throws:
TopiaException

getEntityIds

public List<String> getEntityIds(ReplicationNode node)
                          throws TopiaException
Throws:
TopiaException

getEntities

public List<? extends TopiaEntity> getEntities(TopiaContextImplementor tx,
                                               ReplicationNode node)
                                        throws TopiaException
Throws:
TopiaException

newSourceTx

public TopiaContextImplementor newSourceTx()
                                    throws TopiaException
Throws:
TopiaException

newTargetTx

public TopiaContextImplementor newTargetTx()
                                    throws TopiaException
Throws:
TopiaException

close

public static void close(TopiaContext tx,
                         boolean rollback)
                  throws TopiaException
Throws:
TopiaException

clear

public void clear()

getIds

protected TopiaEntityIdsMap getIds(TopiaContextImplementor srcCtxt)
                            throws TopiaException
Throws:
TopiaException

getTreated

protected List<ReplicationNode> getTreated()

getSourceTx

protected TopiaContext getSourceTx()

getTargetTx

protected TopiaContext getTargetTx()

getData

protected TopiaEntityIdsMap getData()

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable


Copyright © 2004-2012 CodeLutin. All Rights Reserved.