Interface TopiaReplicationSupport

All Known Subinterfaces:
TopiaPersistenceContext
All Known Implementing Classes:
AbstractTopiaPersistenceContext, HibernateTopiaReplicationSupport

public interface TopiaReplicationSupport
This API provides methods about entities replication to a destination
Since:
3.0
Author:
Arnaud Thimel (Code Lutin)
  • Method Details

    • replicate

      void replicate(TopiaReplicationDestination topiaReplicationDestination, Object... entityAndCondition) throws IllegalArgumentException
      Makes a replication of some entities from this context to the given context without any entity modification. Note: If the entityAndCondition parameter is empty, all the database will be replicated Note 2: The simple replication may not be sufficent. You may want to replicate only a part of some entities : use the method replicateEntities(TopiaReplicationDestination, java.util.List).
      Parameters:
      topiaReplicationDestination - the destination context
      entityAndCondition - [key;value;...] parameter which key is the entity class to replicate, and value the "where" condition to use when querying entities
      Throws:
      IllegalArgumentException - if one of the context is closed or if trying to replicate within the same database
    • replicateEntity

      <T extends TopiaEntity> void replicateEntity(TopiaReplicationDestination topiaReplicationDestination, T entity) throws IllegalArgumentException
      Replicate a given entity from this context to the given context.
      Type Parameters:
      T - type of entity
      Parameters:
      topiaReplicationDestination - the destination context
      entity - the entity instance to replicate
      Throws:
      IllegalArgumentException - if one of the context is closed or if trying to replicate within the same database
    • replicateEntities

      <T extends TopiaEntity> void replicateEntities(TopiaReplicationDestination topiaReplicationDestination, List<T> entities) throws IllegalArgumentException
      Makes a replication of some entities from this context to the given context without any entity modification.
      Type Parameters:
      T - type of entity
      Parameters:
      topiaReplicationDestination - the destination context
      entities - the list of entities instance to replicate
      Throws:
      IllegalArgumentException - if one of the context is closed or if trying to replicate within the same database