Class GlobbingPathFilter
java.lang.Object
org.apache.jackrabbit.oak.plugins.observation.filter.GlobbingPathFilter
- All Implemented Interfaces:
EventFilter
This
Filter implementation supports filtering on paths using
simple glob patterns. Such a pattern is a string denoting a path. Each
element of the pattern is matched against the corresponding element of
a path. Elements of the pattern are matched literally except for the special
elements * and ** where the former matches an arbitrary
path element and the latter matches any number of path elements (including none).
Note: an empty path pattern matches no path.
Note: path patterns only match against the corresponding elements of the path and do not distinguish between absolute and relative paths.
Note: there is no way to escape * and **.
Examples:
q matches q only
* matches character matches zero or more characters of a name component without crossing path boundaries (ie without crossing /)
** matches every path
a/b/c matches a/b/c only
a/*/c matches a/x/c for every element x
a/*.html/c matches a/x.html/c for every character sequence x (that doesn't include /)
a/*.*/c matches a/x.y/c for every character sequence x and y (that don't include /)
**/y/z match every path ending in y/z
r/s/t/** matches r/s/t and all its descendants
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGlobbingPathFilter(@NotNull String pattern) for testing only - use variant which passes the patternMap for productive codeGlobbingPathFilter(@NotNull String pattern, Map<String, Pattern> patternMap) -
Method Summary
Modifier and TypeMethodDescriptionFactory for creating a filter instance for the given child nodebooleanincludeAdd(String name, NodeState after) Include an added nodebooleanincludeAdd(PropertyState after) Include an added propertybooleanincludeChange(PropertyState before, PropertyState after) Include a changed propertybooleanincludeDelete(String name, NodeState before) Include a deleted nodebooleanincludeDelete(PropertyState before) Include a deleted propertybooleanincludeMove(String sourcePath, String name, NodeState moved) Include a moved nodebooleanincludeReorder(String destName, String name, NodeState reordered) Include a reordered nodetoString()
-
Field Details
-
STAR
- See Also:
-
STAR_STAR
- See Also:
-
-
Constructor Details
-
GlobbingPathFilter
-
GlobbingPathFilter
for testing only - use variant which passes the patternMap for productive code
-
-
Method Details
-
includeAdd
Description copied from interface:EventFilterInclude an added property- Specified by:
includeAddin interfaceEventFilter- Parameters:
after- added property- Returns:
trueif the property should be included
-
includeChange
Description copied from interface:EventFilterInclude a changed property- Specified by:
includeChangein interfaceEventFilter- Parameters:
before- property before the changeafter- property after the change- Returns:
trueif the property should be included
-
includeDelete
Description copied from interface:EventFilterInclude a deleted property- Specified by:
includeDeletein interfaceEventFilter- Parameters:
before- deleted property- Returns:
trueif the property should be included
-
includeAdd
Description copied from interface:EventFilterInclude an added node- Specified by:
includeAddin interfaceEventFilter- Parameters:
name- name of the nodeafter- added node- Returns:
trueif the node should be included
-
includeDelete
Description copied from interface:EventFilterInclude a deleted node- Specified by:
includeDeletein interfaceEventFilter- Parameters:
name- name of the nodebefore- deleted node- Returns:
trueif the node should be included
-
includeMove
Description copied from interface:EventFilterInclude a moved node- Specified by:
includeMovein interfaceEventFilter- Parameters:
sourcePath- source path of the move operationname- name of the moved nodemoved- the moved node- Returns:
trueif the node should be included
-
includeReorder
Description copied from interface:EventFilterInclude a reordered node- Specified by:
includeReorderin interfaceEventFilter- Parameters:
destName- name of theorderBefore()destination nodename- name of the reordered nodereordered- the reordered node- Returns:
trueif the node should be included
-
create
Description copied from interface:EventFilterFactory for creating a filter instance for the given child node- Specified by:
createin interfaceEventFilter- Parameters:
name- name of the child nodebefore- before state of the child nodeafter- after state of the child node- Returns:
- filter instance for filtering the child node or
nullto exclude the sub tree rooted at this child node.
-
toString
-