Interface AggregateHandler

All Known Implementing Classes:
DefaultAggregateHandler

public interface AggregateHandler
The AggregateHandler is used to determine if a node is an aggregate root or not. Aggregates are used to build replication content and to determine the set of replicated "documents". It is also used the prepare and process the set of aggregates during a replication.
Since:
5.5
  • Method Details

    • isAggregateRoot

      boolean isAggregateRoot(Node node)
      Checks if the given node is an aggregate root.
      Parameters:
      node - node to test
      Returns:
      true if the node is an aggregate root
    • prepareForReplication

      List<String> prepareForReplication(Session session, ReplicationActionType type, String path) throws ReplicationException
      Returns a list of aggregate roots of the subtree starting at the specified path that are relevant for the given replication action. The specified start path should be included in the list in any case.
      Parameters:
      session - session to use for traversal
      type - replication action type
      path - start path
      Returns:
      a list of aggregate roots.
      Throws:
      ReplicationException - to abort the replication in the preparation stage
    • processForReplication

      void processForReplication(Session session, ReplicationAction action) throws ReplicationException
      Processes the aggregate addressed by the replication action. The aggregate handler may or may not save the changes.
      Parameters:
      session - the session to use to process the content
      action - the replication action
      Throws:
      ReplicationException - to abort the replication in the preparation stage