Class ObservationUtil


  • public class ObservationUtil
    extends java.lang.Object
    Utility for common JCR Observations
    • Constructor Summary

      Constructors 
      Constructor Description
      ObservationUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isExternal​(Event event)
      On a JCR implementation which supports cluster-aware event processing, checks if the event has originally happened locally (internal) or remotely (external).
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ObservationUtil

        public ObservationUtil()
    • Method Detail

      • isExternal

        public static boolean isExternal​(Event event)
        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:

        1. Register observation listeners with a org.apache.jackrabbit.api.observation.JackrabbitEventFilter and specify setNoExternal(true)
        2. 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.

        Parameters:
        event - The event to be checked.
        Returns:
        true if the JCR implementation is cluster aware and the event is external.