Interface WorkspaceFilter
-
- All Superinterfaces:
Dumpable
- All Known Implementing Classes:
DefaultWorkspaceFilter,ScopedWorkspaceFilter
@ProviderType public interface WorkspaceFilter extends Dumpable
WorkspaceFilterdefined a filter for items (node or property).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleancontains(@NotNull String path)Checks if the given node path is contained (and by that also covered) in this workspace filter.booleancovers(@NotNull String path)Checks if the given node path is covered in this workspace filter.voiddumpCoverage(@NotNull Node rootNode, @NotNull ProgressTrackerListener listener)Dumps the coverage of this filter against the given node to the listener.voiddumpCoverage(@NotNull Session session, @NotNull ProgressTrackerListener listener, boolean skipJcrContent)Dumps the coverage of this filter using the given session.@Nullable PathFilterSetgetCoveringFilterSet(@NotNull String path)Returns the filter set that covers the respective node pathdefault @Nullable Set<String>getDirectChildNamesTowardsFilterRoots(@NotNull String path)Matches the given path with all filter roots.@NotNull List<PathFilterSet>getFilterSets()Returns a list of path filter sets for node items.@NotNull ImportModegetImportMode(@NotNull String path)Returns the import mode for the given node path.@NotNull List<PathFilterSet>getPropertyFilterSets()Returns a list of path filter sets for property items.@NotNull InputStreamgetSource()Returns the source xml that constructs this filter It is the obligation of the caller to close the returned input stream.@NotNull StringgetSourceAsString()Returns the source xml that constructs this filterbooleanincludesProperty(String propertyPath)Tests if the given workspace filter includes the given property.booleanisAncestor(@NotNull String path)Checks if the given node path is an ancestor of any of the filter sets.booleanisGloballyIgnored(@NotNull String path)Checks if the given node path is globally ignored.@NotNull WorkspaceFiltertranslate(@Nullable PathMapping mapping)Translates this workspace filter using the given path mapping.
-
-
-
Method Detail
-
getFilterSets
@NotNull @NotNull List<PathFilterSet> getFilterSets()
Returns a list of path filter sets for node items.- Returns:
- the list of path filter sets.
-
getPropertyFilterSets
@NotNull @NotNull List<PathFilterSet> getPropertyFilterSets()
Returns a list of path filter sets for property items.- Returns:
- the list of path filter sets.
-
getCoveringFilterSet
@Nullable @Nullable PathFilterSet getCoveringFilterSet(@NotNull @NotNull String path)
Returns the filter set that covers the respective node path- Parameters:
path- the path- Returns:
- the filter set or
null
-
getImportMode
@NotNull @NotNull ImportMode getImportMode(@NotNull @NotNull String path)
Returns the import mode for the given node path.- Parameters:
path- path to check- Returns:
- the import mode or
ImportMode.REPLACEif the given path is not covered by this filter.
-
contains
boolean contains(@NotNull @NotNull String path)Checks if the given node path is contained (and by that also covered) in this workspace filter. It returnstrueif any of the filter sets contain the path and it's not globally ignored.If
contains(String)returnstruefor one path, alsocovers(String)would returntruefor the same path, but not vice-versa.- Parameters:
path- to check- Returns:
trueif the given path is included in this filter.
-
covers
boolean covers(@NotNull @NotNull String path)Checks if the given node path is covered in this workspace filter. It only returnstrueif at least one of the sets covers the path and is not globally ignored.Still
contains(String)might returnfalsefor the same path in case there is some exclusion patterns matching the given path.- Parameters:
path- the path to check- Returns:
trueif the given path is covered by this filter.
-
isAncestor
boolean isAncestor(@NotNull @NotNull String path)Checks if the given node path is an ancestor of any of the filter sets.- Parameters:
path- the item to check- Returns:
trueif the given item is an ancestor
-
getDirectChildNamesTowardsFilterRoots
@Nullable default @Nullable Set<String> getDirectChildNamesTowardsFilterRoots(@NotNull @NotNull String path)
Matches the given path with all filter roots. For each, if it is an ancestor or if it is unrelated to the path (neither ancestor, self or descendant), add the name of the first path segment of the remaining filter root "below" path to the result set.Will return
nullif that segment can not be determined for some filters.- Parameters:
path- Path to check- Returns:
- first path segments of non-matched paths, or
nullwhen result set can not be computed.
-
isGloballyIgnored
boolean isGloballyIgnored(@NotNull @NotNull String path)Checks if the given node path is globally ignored.- Parameters:
path- the path to check.- Returns:
trueif the item is globally ignored.
-
getSource
@NotNull @NotNull InputStream getSource()
Returns the source xml that constructs this filter It is the obligation of the caller to close the returned input stream.- Returns:
- the source xml
-
getSourceAsString
@NotNull @NotNull String getSourceAsString()
Returns the source xml that constructs this filter- Returns:
- the source xml
-
translate
@NotNull @NotNull WorkspaceFilter translate(@Nullable @Nullable PathMapping mapping)
Translates this workspace filter using the given path mapping.- Parameters:
mapping- the path mapping- Returns:
- a new workspace filter
- Since:
- 2.4.10
-
dumpCoverage
void dumpCoverage(@NotNull @NotNull Node rootNode, @NotNull @NotNull ProgressTrackerListener listener) throws RepositoryExceptionDumps the coverage of this filter against the given node to the listener.- Parameters:
rootNode- root nodelistener- listener which receives coverage information- Throws:
RepositoryException- if an error occurs
-
dumpCoverage
void dumpCoverage(@NotNull @NotNull Session session, @NotNull @NotNull ProgressTrackerListener listener, boolean skipJcrContent) throws RepositoryExceptionDumps the coverage of this filter using the given session. IfskipJcrContentistruethe jcr:content nodes are excluded from traversal and reporting.- Parameters:
session- sessionlistener- listener which receives coverage informationskipJcrContent-trueto skip jcr:content nodes- Throws:
RepositoryException- if an error occurs
-
includesProperty
boolean includesProperty(String propertyPath)
Tests if the given workspace filter includes the given property. If the filter does not cover the property, it returnstrue.- Parameters:
propertyPath- the path to the property- Returns:
trueif the property is included in the filter
-
-