com.day.cq.replication.ReplicationContentFilter Maven / Gradle / Ivy
/*************************************************************************
*
* ADOBE CONFIDENTIAL
* __________________
*
* Copyright 2013 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/
package com.day.cq.replication;
import java.util.List;
import javax.jcr.Node;
import javax.jcr.Property;
/**
* Implementations of ReplicationContentFilter
indicate to {@link ContentBuilder}s whether a given child
* {@link Node} of a node being activated (e.g. a page or asset) shall be included in the replication content or not.
* Implementations must be instantiated by their respective {@link ReplicationContentFilterFactory}, the factory
* registering itself as an OSGi service.
* For convenience a {@link ReplicationContentFilterChain} is provided to content builders
* via the parameter {@link ContentBuilder#PARAMETER_CONTENT_FILER_CHAIN}.
*/
public interface ReplicationContentFilter {
/**
* Indicates whether the given {@link Node} is to be included in the content of the replication built by {@link
* ContentBuilder}s.
*
* @param node The {@link Node} to check.
* @return true
if this node may be included in the replication content.
*/
boolean accepts(Node node);
/**
* Indicates whether the given {@link Property} is to be included in the content of the replication built by {@link
* ContentBuilder}s.
*
* @param property The {@link Property} to check.
* @return true
if this property may be included in the replication content.
*/
boolean accepts(Property property);
/**
* Indicates whether the {@link ContentBuilder}s may descend / traverse the children of the given node
* for inclusion in the replication content. If this returns false
, the given node itself and its
* properties are still included in the replication content (if {@link #accepts(javax.jcr.Node) returns true and
* properties are accepted via {@link #accepts(javax.jcr.Property)}}.
*
* @param node The {@link Node} to check.
* @return true
if the content builder may traverse the children of the given node, false
* otherwise.
*/
boolean allowsDescent(Node node);
/**
* Get the {@link List} of paths that have been filtered by this filter.
*
* @return a {@link} List of String
s representing the filtered
* paths or null
if this is not supported.
*/
List getFilteredPaths();
}