Package com.day.cq.replication
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isAggregateRoot(Node node)
Checks if the given node is an aggregate root.java.util.List<java.lang.String>
prepareForReplication(Session session, ReplicationActionType type, java.lang.String path)
Returns a list of aggregate roots of the subtree starting at the specified path that are relevant for the given replication action.void
processForReplication(Session session, ReplicationAction action)
Processes the aggregate addressed by the replication action.
-
-
-
Method Detail
-
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
java.util.List<java.lang.String> prepareForReplication(Session session, ReplicationActionType type, java.lang.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 traversaltype
- replication action typepath
- 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 contentaction
- the replication action- Throws:
ReplicationException
- to abort the replication in the preparation stage
-
-