Interface WorkspaceFilter
-
- All Superinterfaces:
Dumpable
- All Known Implementing Classes:
DefaultWorkspaceFilter
,ScopedWorkspaceFilter
@ProviderType public interface WorkspaceFilter extends Dumpable
WorkspaceFilter
defined a filter for items (node or property).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
contains(@NotNull String path)
Checks if the given node path is contained (and by that also covered) in this workspace filter.boolean
covers(@NotNull String path)
Checks if the given node path is covered in this workspace filter.void
dumpCoverage(@NotNull Node rootNode, @NotNull ProgressTrackerListener listener)
Dumps the coverage of this filter against the given node to the listener.void
dumpCoverage(@NotNull Session session, @NotNull ProgressTrackerListener listener, boolean skipJcrContent)
Dumps the coverage of this filter using the given session.@Nullable PathFilterSet
getCoveringFilterSet(@NotNull String path)
Returns the filter set that covers the respective node path@NotNull List<PathFilterSet>
getFilterSets()
Returns a list of path filter sets for node items.@NotNull ImportMode
getImportMode(@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 InputStream
getSource()
Returns the source xml that constructs this filter It is the obligation of the caller to close the returned input stream.@NotNull String
getSourceAsString()
Returns the source xml that constructs this filterboolean
includesProperty(String propertyPath)
Tests if the given workspace filter includes the given property.boolean
isAncestor(@NotNull String path)
Checks if the given node path is an ancestor of any of the filter sets.boolean
isGloballyIgnored(@NotNull String path)
Checks if the given node path is globally ignored.@NotNull WorkspaceFilter
translate(@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.REPLACE
if 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 returnstrue
if any of the filter sets contain the path and it's not globally ignored.If
contains(String)
returnstrue
for one path, alsocovers(String)
would returntrue
for the same path, but not vice-versa.- Parameters:
path
- to check- Returns:
true
if 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 returnstrue
if at least one of the sets covers the path and is not globally ignored.Still
contains(String)
might returnfalse
for the same path in case there is some exclusion patterns matching the given path.- Parameters:
path
- the path to check- Returns:
true
if 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:
true
if the given item is an ancestor
-
isGloballyIgnored
boolean isGloballyIgnored(@NotNull @NotNull String path)
Checks if the given node path is globally ignored.- Parameters:
path
- the path to check.- Returns:
true
if 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 RepositoryException
Dumps 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 RepositoryException
Dumps the coverage of this filter using the given session. IfskipJcrContent
istrue
the jcr:content nodes are excluded from traversal and reporting.- Parameters:
session
- sessionlistener
- listener which receives coverage informationskipJcrContent
-true
to 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:
true
if the property is included in the filter
-
-