Package org.nuiton.topia.replication
Interface TopiaReplicationOperation
- All Known Subinterfaces:
TopiaReplicationOperationUndoable
- All Known Implementing Classes:
AttachAssociation,AttachLink,DettachAssociation,Duplicate,LoadLink
public interface TopiaReplicationOperation
Le contrat d'une operation a effectuer lors de la replication.
Le module propose des operations de base dans le paquetage
org.nuiton.topia.replication.operation.
Pour definir une nouvelle implantation d'operation, il faut l'enregister
en tant que service (au sens de la classe ServiceLoader,
c'est à dire ajouter dans un fichier (du class-path)
META-INF/services/org.nuiton.topia.replication.TopiaReplicationOperation
une ligne avec le nom qualifie de votre implantation.
Lors du chargement du service, on detecte toutes les operations disponibles.- Since:
- 2.2.0
- Author:
- tchemit <chemit@codelutin.com>
-
Method Summary
Modifier and TypeMethodDescriptionvoidregister(ReplicationModel model, ReplicationNode ownerNode, ReplicationOperationPhase phase, Object... parameters) Deprecated.since 2.5.2, there is no difference between a user operation and an internal one.voidrun(TopiaReplicationContext replicationContext, ReplicationOperationDef operationDef, TopiaContextImplementor srcCtxt, TopiaContextImplementor dstCtxt, List<? extends TopiaEntity> entities) Execute l'operation avec le parametrage donnee.
-
Method Details
-
register
@Deprecated void register(ReplicationModel model, ReplicationNode ownerNode, ReplicationOperationPhase phase, Object... parameters) throws UnsupportedOperationException Deprecated.since 2.5.2, there is no difference between a user operation and an internal one. This method will be removed in version 2.6 and never replacedCreer et enregister une operation utilisateur apres la creation du modele via la methodeTopiaReplicationService.prepare(TopiaEntityEnum[], boolean, String...).- Parameters:
model- le modele de replicationownerNode- le noeud proprietaire de l'operationphase- la phase ou positionner l'operationparameters- les parametres de l'operation- Throws:
UnsupportedOperationException- if can not register this operation (says when operation is only internal)- See Also:
-
run
void run(TopiaReplicationContext replicationContext, ReplicationOperationDef operationDef, TopiaContextImplementor srcCtxt, TopiaContextImplementor dstCtxt, List<? extends TopiaEntity> entities) throws Exception Execute l'operation avec le parametrage donnee. Note : le commit sur le context cible doit etre geree dans la methode.- Parameters:
replicationContext- le contexte de replicationoperationDef- la definition de l'operation a realisersrcCtxt- le context sourcedstCtxt- le context destinationentities- la liste des entités à traiter- Throws:
Exception- pour toute erreur
-