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 bitwiseOR
of the event types to be listened to. SeeEvent
for details. -
absPath
,absPaths
,excludedPaths
,isDeep
: Only events whose associated parent node is at one of the paths inabsPath
orabsPaths
(or within its subgraph, ifisDeep
istrue
) will be received except if the associated parent node is at one of the paths inexcludedPaths
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 isnull
then no identifier-related restriction is placed on events received. Note that specifying an empty array instead ofnull
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 isnull
then no node type-related restriction is placed on events received. Note that specifying an empty array instead ofnull
would 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 theabsPath
parameter of the filter.String[]
Returns theabsPaths
parameter of the filter.int
Returns theeventTypes
parameter of the filter.String[]
Returns theexcludedPaths
parameter of the filter.String[]
Returns theuuids
parameter of the filter.boolean
Returns theisDeep
parameter of the filter.String[]
Returns thenodeTypeName
parameter of the filter.boolean
Returns thenoExternal
parameter of the filter.boolean
Returns thenoInternal
parameter of the filter.boolean
Returns thenoLocal
parameter of the filter.setAbsPath
(String absPath) Sets theabsPath
parameter of the filter.setAdditionalPaths
(String... absPaths) Sets theabsPaths
parameter of the filter.setEventTypes
(int eventTypes) Sets theeventTypes
parameter of the filter.setExcludedPaths
(String... excludedPaths) Sets theexcludedPaths
parameter of the filter.setIdentifiers
(String[] identifiers) Sets theidentifiers
parameter of the filter.setIsDeep
(boolean isDeep) Sets theisDeep
parameter of the filter.setNodeTypes
(String[] nodeTypeNames) Sets thenodeTypeNames
parameter of the filter.setNoExternal
(boolean noExternal) Sets thenoExternal
parameter of the filter.setNoInternal
(boolean noInternal) Sets thenoInternal
parameter of the filter.setNoLocal
(boolean noLocal) Sets thenoLocal
parameter of the filter.
-
Constructor Details
-
JackrabbitEventFilter
public JackrabbitEventFilter()
-
-
Method Details
-
setEventTypes
Sets theeventTypes
parameter of the filter. If left unset, this parameter defaults to0
.- Parameters:
eventTypes
- anint
.- Returns:
- This EventFilter object with the
eventTypes
parameter set.
-
getEventTypes
public int getEventTypes()Returns theeventTypes
parameter of the filter.- Returns:
- an
int
.
-
setAbsPath
Sets theabsPath
parameter of the filter. If left unset, this parameter defaults tonull
.- Parameters:
absPath
- an absolute pathString
.- Returns:
- This EventFilter object with the
absPath
parameter set.
-
getAbsPath
Returns theabsPath
parameter of the filter.- Returns:
- a
String
.
-
setIsDeep
Sets theisDeep
parameter of the filter. If left unset, this parameter defaults tofalse
.- Parameters:
isDeep
- aboolean
.- Returns:
- This EventFilter object with the
isDeep
parameter set.
-
getIsDeep
public boolean getIsDeep()Returns theisDeep
parameter of the filter.- Returns:
- a
boolean
.
-
setIdentifiers
Sets theidentifiers
parameter of the filter. If left unset, this parameter defaults tonull
.- Parameters:
identifiers
- aString
array.- Returns:
- This EventFilter object with the
identifiers
parameter set.
-
getIdentifiers
Returns theuuids
parameter of the filter.- Returns:
- a
String
array.
-
setNodeTypes
Sets thenodeTypeNames
parameter of the filter. If left unset, this parameter defaults tonull
.- Parameters:
nodeTypeNames
- aString
array.- Returns:
- This EventFilter object with the
nodeTypes
parameter set.
-
getNodeTypes
Returns thenodeTypeName
parameter of the filter.- Returns:
- a
String
array.
-
setNoLocal
Sets thenoLocal
parameter of the filter. If left unset, this parameter defaults tofalse
.- Parameters:
noLocal
- aboolean
.- Returns:
- This EventFilter object with the
noLocal
parameter set.
-
getNoLocal
public boolean getNoLocal()Returns thenoLocal
parameter of the filter.- Returns:
- a
boolean
.
-
setAdditionalPaths
Sets theabsPaths
parameter of the filter. If left unset, this parameter defaults to an empty array.- Parameters:
absPaths
- an absolute pathString
array.- Returns:
- This EventFilter object with the
absPaths
parameter set.
-
getAdditionalPaths
Returns theabsPaths
parameter of the filter.- Returns:
- a
String
array.
-
setExcludedPaths
Sets theexcludedPaths
parameter of the filter. If left unset, this parameter defaults to an empty array.- Parameters:
excludedPaths
- an absolute pathString
array.- Returns:
- This EventFilter object with the
excludedPaths
parameter set.
-
getExcludedPaths
Returns theexcludedPaths
parameter of the filter.- Returns:
- a
String
array.
-
setNoExternal
Sets thenoExternal
parameter of the filter. If left unset, this parameter defaults tofalse
.- Parameters:
noExternal
- aboolean
.- Returns:
- This EventFilter object with the
noExternal
parameter set.
-
getNoExternal
public boolean getNoExternal()Returns thenoExternal
parameter of the filter.- Returns:
- a
boolean
.
-
setNoInternal
Sets thenoInternal
parameter of the filter. If left unset, this parameter defaults tofalse
.- Parameters:
noInternal
- aboolean
.- Returns:
- This EventFilter object with the
noExternal
parameter set.
-
getNoInternal
public boolean getNoInternal()Returns thenoInternal
parameter of the filter.- Returns:
- a
boolean
.
-