Class JackrabbitEventFilter

java.lang.Object
org.apache.jackrabbit.api.observation.JackrabbitEventFilter
Direct Known Subclasses:
OakEventFilter

@ConsumerType public class JackrabbitEventFilter extends Object
A storage object for event filter configuration.

The parameters of the filter can then be set by chaining the set methods, since each method returns the same EventFilter with the indicated parameter set.

Once the filter is configured, it and an EventListener object are passed to JackrabbitObservationManager.addEventListener(javax.jcr.observation.EventListener, JackrabbitEventFilter).

The filter restricts which events are sent to the EventListener according to the following parameters. Note that the term associated parent node of an event means the parent node of the item at (or formerly at) the path returned by Event.getPath().

  • eventTypes: A bitwise OR of the event types to be listened to. See Event for details.
  • absPath, absPaths, excludedPaths, isDeep: Only events whose associated parent node is at one of the paths in absPath or absPaths (or within its subgraph, if isDeep is true) will be received except if the associated parent node is at one of the paths in excludedPaths or its subgraph. It is permissible to register a listener for a path where no node currently exists.
  • uuid: Only events whose associated parent node has one of the identifiers in this list will be received. If his parameter is null then no identifier-related restriction is placed on events received. Note that specifying an empty array instead of null would result in no nodes being listened to. The term "UUID" is used for compatibility with JCR 1.0.
  • nodeTypeName: Only events whose associated parent node has one of the node types (or a subtype of one of the node types) in this list will be received. If his parameter is null then no node type-related restriction is placed on events received. Note that specifying an empty array instead of null would result in no nodes types being listened to.
  • noLocal: if true, then events generated by the session through which the listener was registered are ignored. Otherwise, they are not ignored.
  • noExternal: if true, then events from external cluster nodes are ignored. Otherwise, they are not ignored.
  • noInternal: if true, then events from this cluster node are ignored. Otherwise, they are not ignored.
The restrictions are "ANDed" together. In other words, for a particular node to be "listened to" it must meet all the restrictions.
  • Constructor Details

    • JackrabbitEventFilter

      public JackrabbitEventFilter()
  • Method Details

    • setEventTypes

      public JackrabbitEventFilter setEventTypes(int eventTypes)
      Sets the eventTypes parameter of the filter. If left unset, this parameter defaults to 0.
      Parameters:
      eventTypes - an int.
      Returns:
      This EventFilter object with the eventTypes parameter set.
    • getEventTypes

      public int getEventTypes()
      Returns the eventTypes parameter of the filter.
      Returns:
      an int.
    • setAbsPath

      public JackrabbitEventFilter setAbsPath(String absPath)
      Sets the absPath parameter of the filter. If left unset, this parameter defaults to null.
      Parameters:
      absPath - an absolute path String.
      Returns:
      This EventFilter object with the absPath parameter set.
    • getAbsPath

      public String getAbsPath()
      Returns the absPath parameter of the filter.
      Returns:
      a String.
    • setIsDeep

      public JackrabbitEventFilter setIsDeep(boolean isDeep)
      Sets the isDeep parameter of the filter. If left unset, this parameter defaults to false.
      Parameters:
      isDeep - a boolean.
      Returns:
      This EventFilter object with the isDeep parameter set.
    • getIsDeep

      public boolean getIsDeep()
      Returns the isDeep parameter of the filter.
      Returns:
      a boolean.
    • setIdentifiers

      public JackrabbitEventFilter setIdentifiers(String[] identifiers)
      Sets the identifiers parameter of the filter. If left unset, this parameter defaults to null.
      Parameters:
      identifiers - a String array.
      Returns:
      This EventFilter object with the identifiers parameter set.
    • getIdentifiers

      public String[] getIdentifiers()
      Returns the uuids parameter of the filter.
      Returns:
      a String array.
    • setNodeTypes

      public JackrabbitEventFilter setNodeTypes(String[] nodeTypeNames)
      Sets the nodeTypeNames parameter of the filter. If left unset, this parameter defaults to null.
      Parameters:
      nodeTypeNames - a String array.
      Returns:
      This EventFilter object with the nodeTypes parameter set.
    • getNodeTypes

      public String[] getNodeTypes()
      Returns the nodeTypeName parameter of the filter.
      Returns:
      a String array.
    • setNoLocal

      public JackrabbitEventFilter setNoLocal(boolean noLocal)
      Sets the noLocal parameter of the filter. If left unset, this parameter defaults to false.
      Parameters:
      noLocal - a boolean.
      Returns:
      This EventFilter object with the noLocal parameter set.
    • getNoLocal

      public boolean getNoLocal()
      Returns the noLocal parameter of the filter.
      Returns:
      a boolean.
    • setAdditionalPaths

      public JackrabbitEventFilter setAdditionalPaths(String... absPaths)
      Sets the absPaths parameter of the filter. If left unset, this parameter defaults to an empty array.
      Parameters:
      absPaths - an absolute path String array.
      Returns:
      This EventFilter object with the absPaths parameter set.
    • getAdditionalPaths

      public String[] getAdditionalPaths()
      Returns the absPaths parameter of the filter.
      Returns:
      a String array.
    • setExcludedPaths

      public JackrabbitEventFilter setExcludedPaths(String... excludedPaths)
      Sets the excludedPaths parameter of the filter. If left unset, this parameter defaults to an empty array.
      Parameters:
      excludedPaths - an absolute path String array.
      Returns:
      This EventFilter object with the excludedPaths parameter set.
    • getExcludedPaths

      public String[] getExcludedPaths()
      Returns the excludedPaths parameter of the filter.
      Returns:
      a String array.
    • setNoExternal

      public JackrabbitEventFilter setNoExternal(boolean noExternal)
      Sets the noExternal parameter of the filter. If left unset, this parameter defaults to false.
      Parameters:
      noExternal - a boolean.
      Returns:
      This EventFilter object with the noExternal parameter set.
    • getNoExternal

      public boolean getNoExternal()
      Returns the noExternal parameter of the filter.
      Returns:
      a boolean.
    • setNoInternal

      public JackrabbitEventFilter setNoInternal(boolean noInternal)
      Sets the noInternal parameter of the filter. If left unset, this parameter defaults to false.
      Parameters:
      noInternal - a boolean.
      Returns:
      This EventFilter object with the noExternal parameter set.
    • getNoInternal

      public boolean getNoInternal()
      Returns the noInternal parameter of the filter.
      Returns:
      a boolean.