@ConsumerType public abstract class OakEventFilter extends JackrabbitEventFilter
Usage:
OakEventFilter oakFilter = FilterFactory.wrap(jackrabbitFilter);
// then call extensions on OakEventFilters
observationManager.addEventListener(listener, oakFilter);
Constructor and Description |
---|
OakEventFilter() |
Modifier and Type | Method and Description |
---|---|
abstract OakEventFilter |
withApplyNodeTypeOnSelf()
This causes the node type filter to be applied on 'this' node instead of
the 'parent' node, thus allows to create a filter which listens on
adding/removing/etc on nodes of a particular node type (while the default
was that the node type was applicable on the parent).
|
abstract OakEventFilter |
withIncludeAncestorsRemove()
This causes the registration of independent, additional
!deep NODE_REMOVED filter-conditions
of all parents of the include paths (both normal and glob).
|
abstract OakEventFilter |
withIncludeGlobPaths(String... globPaths)
Adds the provided glob paths to the set of include paths.
|
abstract OakEventFilter |
withIncludeSubtreeOnRemove()
This flag causes remove events to be sent for all nodes and properties
of an entire subtree (hence use with care!).
|
abstract OakEventFilter |
withNodeTypeAggregate(String[] nodeTypes,
String[] relativeGlobPaths)
Greedy aggregating filter which upon first (hence greedy) hit of provided
nodeTypes checks if the child subtree leading to the actual change
matches any of the provided relativeGlobPaths.
|
getAbsPath, getAdditionalPaths, getEventTypes, getExcludedPaths, getIdentifiers, getIsDeep, getNodeTypes, getNoExternal, getNoInternal, getNoLocal, setAbsPath, setAdditionalPaths, setEventTypes, setExcludedPaths, setIdentifiers, setIsDeep, setNodeTypes, setNoExternal, setNoInternal, setNoLocal
public abstract OakEventFilter withApplyNodeTypeOnSelf()
Note that this is an 'either/or' thing: either the node type is applied on the parent (default) or on 'self/this' (via this switch) but not both.
Also note that this is independent from the nodeTypeAggregate, and will only be applied to the (main) node types set on this filter, not on the nodeTypeAggregate's node types.
public abstract OakEventFilter withIncludeAncestorsRemove()
deep/!deep
flag too)
/
*.jsp results in additional
deep NODE_REMOVED filter on /a, /a/b and /a/b/** /
*.jsp)
it adds a deep NODE_REMOVED filter explicitly for that path
using the same method as withIncludeSubtreeOnRemove does, but only
limited to said path. So in this case you get a NODE_REMOVED
for all *.jsp that are deleted in a subtree individuallyNote that unlike 'normal' include and exclude paths, this variant doesn't apply Oak's NamePathMapper on the ancestors of the registers paths.
Also note that this might disable 'observation prefiltering based on paths' (OAK-4796) on this listener.
public abstract OakEventFilter withIncludeSubtreeOnRemove()
It is only applied when a parent node is actually removed. For a parent node move this is not applied.
public abstract OakEventFilter withIncludeGlobPaths(String... globPaths)
The definition of a glob path is here
Note that unlike 'normal' include and exclude paths, this variant doesn't apply Oak's NamePathMapper.
This filter property is added in 'or' mode.
globPaths
- glob paths that should be added as include path pattern. Note
that the NamePathMapper is not applied on these globPaths.public abstract OakEventFilter withNodeTypeAggregate(String[] nodeTypes, String[] relativeGlobPaths)
Note that unlike 'normal' include and exclude paths, this variant doesn't apply Oak's NamePathMapper.
This filter property is added in 'and' mode.
nodeTypes
- note that these nodeTypes are not mapped to oak nor validatedrelativeGlobPaths
- glob paths that are added to the set of include paths.
To match the node with the desired node type itself, add
an empty String ("") as one of the relativeGlobPaths too.
Note that Oak's NamePathMapper is not applied to these relativeGlobPaths.Copyright © 2010 - 2020 Adobe. All Rights Reserved