Class ObservationUtil

java.lang.Object
com.day.cq.commons.jcr.ObservationUtil

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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    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 Details

    • ObservationUtil

      public ObservationUtil()
  • Method Details

    • 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.