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 toJackrabbitObservationManager.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 byEvent.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 Constructor Description JackrabbitEventFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAbsPath()
Returns theabsPath
parameter of the filter.String[]
getAdditionalPaths()
Returns theabsPaths
parameter of the filter.int
getEventTypes()
Returns theeventTypes
parameter of the filter.String[]
getExcludedPaths()
Returns theexcludedPaths
parameter of the filter.String[]
getIdentifiers()
Returns theuuids
parameter of the filter.boolean
getIsDeep()
Returns theisDeep
parameter of the filter.String[]
getNodeTypes()
Returns thenodeTypeName
parameter of the filter.boolean
getNoExternal()
Returns thenoExternal
parameter of the filter.boolean
getNoInternal()
Returns thenoInternal
parameter of the filter.boolean
getNoLocal()
Returns thenoLocal
parameter of the filter.JackrabbitEventFilter
setAbsPath(String absPath)
Sets theabsPath
parameter of the filter.JackrabbitEventFilter
setAdditionalPaths(String... absPaths)
Sets theabsPaths
parameter of the filter.JackrabbitEventFilter
setEventTypes(int eventTypes)
Sets theeventTypes
parameter of the filter.JackrabbitEventFilter
setExcludedPaths(String... excludedPaths)
Sets theexcludedPaths
parameter of the filter.JackrabbitEventFilter
setIdentifiers(String[] identifiers)
Sets theidentifiers
parameter of the filter.JackrabbitEventFilter
setIsDeep(boolean isDeep)
Sets theisDeep
parameter of the filter.JackrabbitEventFilter
setNodeTypes(String[] nodeTypeNames)
Sets thenodeTypeNames
parameter of the filter.JackrabbitEventFilter
setNoExternal(boolean noExternal)
Sets thenoExternal
parameter of the filter.JackrabbitEventFilter
setNoInternal(boolean noInternal)
Sets thenoInternal
parameter of the filter.JackrabbitEventFilter
setNoLocal(boolean noLocal)
Sets thenoLocal
parameter of the filter.
-
-
-
Method Detail
-
setEventTypes
public JackrabbitEventFilter setEventTypes(int eventTypes)
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
public JackrabbitEventFilter setAbsPath(String absPath)
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
public String getAbsPath()
Returns theabsPath
parameter of the filter.- Returns:
- a
String
.
-
setIsDeep
public JackrabbitEventFilter setIsDeep(boolean isDeep)
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
public JackrabbitEventFilter setIdentifiers(String[] identifiers)
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
public String[] getIdentifiers()
Returns theuuids
parameter of the filter.- Returns:
- a
String
array.
-
setNodeTypes
public JackrabbitEventFilter setNodeTypes(String[] nodeTypeNames)
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
public String[] getNodeTypes()
Returns thenodeTypeName
parameter of the filter.- Returns:
- a
String
array.
-
setNoLocal
public JackrabbitEventFilter setNoLocal(boolean noLocal)
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
public JackrabbitEventFilter setAdditionalPaths(String... absPaths)
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
public String[] getAdditionalPaths()
Returns theabsPaths
parameter of the filter.- Returns:
- a
String
array.
-
setExcludedPaths
public JackrabbitEventFilter setExcludedPaths(String... excludedPaths)
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
public String[] getExcludedPaths()
Returns theexcludedPaths
parameter of the filter.- Returns:
- a
String
array.
-
setNoExternal
public JackrabbitEventFilter setNoExternal(boolean noExternal)
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
public JackrabbitEventFilter setNoInternal(boolean noInternal)
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
.
-
-