Class JackrabbitEventFilter
java.lang.Object
org.apache.jackrabbit.api.observation.JackrabbitEventFilter
- Direct Known Subclasses:
OakEventFilter
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 bitwiseORof the event types to be listened to. SeeEventfor details. -
absPath,absPaths,excludedPaths,isDeep: Only events whose associated parent node is at one of the paths inabsPathorabsPaths(or within its subgraph, ifisDeepistrue) will be received except if the associated parent node is at one of the paths inexcludedPathsor 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 isnullthen no identifier-related restriction is placed on events received. Note that specifying an empty array instead ofnullwould 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 isnullthen no node type-related restriction is placed on events received. Note that specifying an empty array instead ofnullwould result in no nodes types being listened to. -
noLocal: iftrue, then events generated by the session through which the listener was registered are ignored. Otherwise, they are not ignored. -
noExternal: iftrue, then events from external cluster nodes are ignored. Otherwise, they are not ignored. -
noInternal: iftrue, then events from this cluster node are ignored. Otherwise, they are not ignored.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns theabsPathparameter of the filter.String[]Returns theabsPathsparameter of the filter.intReturns theeventTypesparameter of the filter.String[]Returns theexcludedPathsparameter of the filter.String[]Returns theuuidsparameter of the filter.booleanReturns theisDeepparameter of the filter.String[]Returns thenodeTypeNameparameter of the filter.booleanReturns thenoExternalparameter of the filter.booleanReturns thenoInternalparameter of the filter.booleanReturns thenoLocalparameter of the filter.setAbsPath(String absPath) Sets theabsPathparameter of the filter.setAdditionalPaths(String... absPaths) Sets theabsPathsparameter of the filter.setEventTypes(int eventTypes) Sets theeventTypesparameter of the filter.setExcludedPaths(String... excludedPaths) Sets theexcludedPathsparameter of the filter.setIdentifiers(String[] identifiers) Sets theidentifiersparameter of the filter.setIsDeep(boolean isDeep) Sets theisDeepparameter of the filter.setNodeTypes(String[] nodeTypeNames) Sets thenodeTypeNamesparameter of the filter.setNoExternal(boolean noExternal) Sets thenoExternalparameter of the filter.setNoInternal(boolean noInternal) Sets thenoInternalparameter of the filter.setNoLocal(boolean noLocal) Sets thenoLocalparameter of the filter.
-
Constructor Details
-
JackrabbitEventFilter
public JackrabbitEventFilter()
-
-
Method Details
-
setEventTypes
Sets theeventTypesparameter of the filter. If left unset, this parameter defaults to0.- Parameters:
eventTypes- anint.- Returns:
- This EventFilter object with the
eventTypesparameter set.
-
getEventTypes
public int getEventTypes()Returns theeventTypesparameter of the filter.- Returns:
- an
int.
-
setAbsPath
Sets theabsPathparameter of the filter. If left unset, this parameter defaults tonull.- Parameters:
absPath- an absolute pathString.- Returns:
- This EventFilter object with the
absPathparameter set.
-
getAbsPath
Returns theabsPathparameter of the filter.- Returns:
- a
String.
-
setIsDeep
Sets theisDeepparameter of the filter. If left unset, this parameter defaults tofalse.- Parameters:
isDeep- aboolean.- Returns:
- This EventFilter object with the
isDeepparameter set.
-
getIsDeep
public boolean getIsDeep()Returns theisDeepparameter of the filter.- Returns:
- a
boolean.
-
setIdentifiers
Sets theidentifiersparameter of the filter. If left unset, this parameter defaults tonull.- Parameters:
identifiers- aStringarray.- Returns:
- This EventFilter object with the
identifiersparameter set.
-
getIdentifiers
Returns theuuidsparameter of the filter.- Returns:
- a
Stringarray.
-
setNodeTypes
Sets thenodeTypeNamesparameter of the filter. If left unset, this parameter defaults tonull.- Parameters:
nodeTypeNames- aStringarray.- Returns:
- This EventFilter object with the
nodeTypesparameter set.
-
getNodeTypes
Returns thenodeTypeNameparameter of the filter.- Returns:
- a
Stringarray.
-
setNoLocal
Sets thenoLocalparameter of the filter. If left unset, this parameter defaults tofalse.- Parameters:
noLocal- aboolean.- Returns:
- This EventFilter object with the
noLocalparameter set.
-
getNoLocal
public boolean getNoLocal()Returns thenoLocalparameter of the filter.- Returns:
- a
boolean.
-
setAdditionalPaths
Sets theabsPathsparameter of the filter. If left unset, this parameter defaults to an empty array.- Parameters:
absPaths- an absolute pathStringarray.- Returns:
- This EventFilter object with the
absPathsparameter set.
-
getAdditionalPaths
Returns theabsPathsparameter of the filter.- Returns:
- a
Stringarray.
-
setExcludedPaths
Sets theexcludedPathsparameter of the filter. If left unset, this parameter defaults to an empty array.- Parameters:
excludedPaths- an absolute pathStringarray.- Returns:
- This EventFilter object with the
excludedPathsparameter set.
-
getExcludedPaths
Returns theexcludedPathsparameter of the filter.- Returns:
- a
Stringarray.
-
setNoExternal
Sets thenoExternalparameter of the filter. If left unset, this parameter defaults tofalse.- Parameters:
noExternal- aboolean.- Returns:
- This EventFilter object with the
noExternalparameter set.
-
getNoExternal
public boolean getNoExternal()Returns thenoExternalparameter of the filter.- Returns:
- a
boolean.
-
setNoInternal
Sets thenoInternalparameter of the filter. If left unset, this parameter defaults tofalse.- Parameters:
noInternal- aboolean.- Returns:
- This EventFilter object with the
noExternalparameter set.
-
getNoInternal
public boolean getNoInternal()Returns thenoInternalparameter of the filter.- Returns:
- a
boolean.
-