org.nuiton.topia.replication.operation
Class Duplicate

java.lang.Object
  extended by org.nuiton.topia.replication.operation.Duplicate
All Implemented Interfaces:
TopiaReplicationOperation, TopiaReplicationOperationUndoable

public class Duplicate
extends Object
implements TopiaReplicationOperationUndoable

L'operation de duplication d'un noeud de replication.

Note : cette operation est interne, et n'est pas creable par l'utilisateur via la methode register(ReplicationModel, ReplicationNode, ReplicationOperationPhase, Object...).

Since:
2.2.0
Author:
tchemit

Constructor Summary
Duplicate()
           
 
Method Summary
 void register(ReplicationModel model, ReplicationNode ownerNode, ReplicationOperationPhase phase, Object... parameters)
          Creer et enregister une operation utilisateur apres la creation du modele via la methode

TopiaReplicationService.prepare(TopiaEntityEnum[], boolean, String...).

 void rollback(ReplicationOperationDef operationDef, TopiaReplicationContext replicationContext, TopiaContextImplementor dstCtxt)
          Execute l'operation inverse avec le parametrage donnee (pour annuler l'opération).
 void run(TopiaReplicationContext replicationContext, ReplicationOperationDef operationDef, TopiaContextImplementor srcCtxt, TopiaContextImplementor dstCtxt, List<? extends TopiaEntity> entities)
          Execute l'operation avec le parametrage donnee.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Duplicate

public Duplicate()
Method Detail

register

public void register(ReplicationModel model,
                     ReplicationNode ownerNode,
                     ReplicationOperationPhase phase,
                     Object... parameters)
              throws UnsupportedOperationException
Description copied from interface: TopiaReplicationOperation
Creer et enregister une operation utilisateur apres la creation du modele via la methode

TopiaReplicationService.prepare(TopiaEntityEnum[], boolean, String...).

Specified by:
register in interface TopiaReplicationOperation
Parameters:
model - le modele de replication
ownerNode - le noeud proprietaire de l'operation
phase - la phase ou positionner l'operation
parameters - les parametres de l'operation
Throws:
UnsupportedOperationException - if can not register this operation (says when operation is only internal)
See Also:
ReplicationModel, ReplicationOperationPhase

run

public void run(TopiaReplicationContext replicationContext,
                ReplicationOperationDef operationDef,
                TopiaContextImplementor srcCtxt,
                TopiaContextImplementor dstCtxt,
                List<? extends TopiaEntity> entities)
         throws TopiaException
Description copied from interface: TopiaReplicationOperation
Execute l'operation avec le parametrage donnee.

Note : le commit sur le context cible doit etre geree dans la methode.

Specified by:
run in interface TopiaReplicationOperation
Parameters:
replicationContext - le contexte de replication
operationDef - la definition de l'operation a realiser
srcCtxt - le context source
dstCtxt - le context destination
entities - la liste des entités à traiter
Throws:
TopiaException

rollback

public void rollback(ReplicationOperationDef operationDef,
                     TopiaReplicationContext replicationContext,
                     TopiaContextImplementor dstCtxt)
              throws Exception
Description copied from interface: TopiaReplicationOperationUndoable
Execute l'operation inverse avec le parametrage donnee (pour annuler l'opération).

Note : le commit sur le context cible doit etre geree dans la methode.

Specified by:
rollback in interface TopiaReplicationOperationUndoable
Parameters:
operationDef - la definition de l'operation a realiser
replicationContext - le context de replication
dstCtxt - le context destination
Throws:
Exception - pour toute erreur


Copyright © 2004-2011 CodeLutin. All Rights Reserved.