All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.day.cq.replication.AggregateHandler Maven / Gradle / Ivy

There is a newer version: 2024.11.18751.20241128T090041Z-241100
Show newest version
/*************************************************************************
 * ADOBE CONFIDENTIAL
 * ___________________
 *
 * Copyright 2011 Adobe
 * All Rights Reserved.
 *
 * NOTICE: All information contained herein is, and remains
 * the property of Adobe and its suppliers, if any. The intellectual
 * and technical concepts contained herein are proprietary to Adobe
 * and its suppliers and are protected by all applicable intellectual
 * property laws, including trade secret and copyright laws.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe.
 **************************************************************************/

package com.day.cq.replication;

import java.util.List;

import javax.jcr.Node;
import javax.jcr.Session;

/**
 * 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
 */
public interface AggregateHandler {

    /**
     * Checks if the given node is an aggregate root.
     * @param node node to test
     * @return true if the node is an aggregate root
     */
    boolean isAggregateRoot(Node node);

    /**
     * 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.
     *
     * @param session session to use for traversal
     * @param type replication action type
     * @param path start path
     * @return a list of aggregate roots.
     * @throws ReplicationException to abort the replication in the preparation stage
     */
    List prepareForReplication(Session session, ReplicationActionType type, String path) throws ReplicationException;
    
    /**
     * Processes the aggregate addressed by the replication action. The aggregate handler may or may not save the changes.
     * @param session the session to use to process the content
     * @param action the replication action
     * @throws ReplicationException to abort the replication in the preparation stage
     */
    void processForReplication(Session session, ReplicationAction action) throws ReplicationException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy