![JAR search and dependency download from the Maven repository](/logo.png)
com.day.cq.commons.jcr.ObservationUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aem-sdk-api Show documentation
Show all versions of aem-sdk-api Show documentation
The Adobe Experience Manager SDK
/*
* Copyright 1997-2011 Day Management AG
* Barfuesserplatz 6, 4001 Basel, Switzerland
* All Rights Reserved.
*
* This software is the confidential and proprietary information of
* Day Management AG, ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with Day.
*/
package com.day.cq.commons.jcr;
import org.apache.jackrabbit.api.observation.JackrabbitEvent;
import javax.jcr.observation.Event;
/**
* Utility for common JCR Observations
*/
public class ObservationUtil {
/**
* On a JCR implementation which supports cluster-aware event processing, checks if the event has originally
* happened locally (internal) or remotely (external).
*
*
* If the result of this method call is used to filter out external events, the recommended approach is to use one
* of the following dedicated APIs:
*
*
* - Register observation listeners with a
org.apache.jackrabbit.api.observation.JackrabbitEventFilter
* and specify setNoExternal(true)
* - Implement the
org.apache.jackrabbit.oak.plugins.observation.ExcludeExternal
marker interface (
* Oak-only )
*
*
* This ensures that external events are not delivered within the cluster only to be filtered away by the receiving
* listener.
*
*
* @param event The event to be checked.
* @return true
if the JCR implementation is cluster aware and the event is external.
*/
public static boolean isExternal(Event event) {
return (event instanceof JackrabbitEvent) && ((JackrabbitEvent) event).isExternal();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy