Interface WorkspaceFilter
-
- All Superinterfaces:
Dumpable
- All Known Implementing Classes:
DefaultWorkspaceFilter,ScopedWorkspaceFilter
public interface WorkspaceFilter extends Dumpable
WorkspaceFilterdefined a filter for items (node or property).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontains(String path)Checks if the given node path is contained in this workspace filter.booleancovers(String path)Checks if the given node path is covered in this workspace filter.voiddumpCoverage(Node rootNode, ProgressTrackerListener listener)Dumps the coverage of this filter against the given node to the listener.voiddumpCoverage(Session session, ProgressTrackerListener listener, boolean skipJcrContent)Dumps the coverage of this filter using the given session.PathFilterSetgetCoveringFilterSet(String path)Returns the filter set that covers the respective node pathList<PathFilterSet>getFilterSets()Returns a list of path filter sets for node items.ImportModegetImportMode(String path)Returns the import mode for the given node path.List<PathFilterSet>getPropertyFilterSets()Returns a list of path filter sets for property items.InputStreamgetSource()Returns the source xml that constructs this filter It is the obligation of the caller to close the returned input stream.StringgetSourceAsString()Returns the source xml that constructs this filterbooleanisAncestor(String path)Checks if the given node path is an ancestor of any of the filter sets.booleanisGloballyIgnored(String path)Checks if the given node path is globally ignored.WorkspaceFiltertranslate(PathMapping mapping)Translates this workspace filter using the given path mapping.
-
-
-
Method Detail
-
getFilterSets
@Nonnull List<PathFilterSet> getFilterSets()
Returns a list of path filter sets for node items.- Returns:
- the list of path filter sets.
-
getPropertyFilterSets
@Nonnull List<PathFilterSet> getPropertyFilterSets()
Returns a list of path filter sets for property items.- Returns:
- the list of path filter sets.
-
getCoveringFilterSet
@Nullable PathFilterSet getCoveringFilterSet(@Nonnull String path)
Returns the filter set that covers the respective node path- Parameters:
path- the path- Returns:
- the filter set or
null
-
getImportMode
@Nonnull ImportMode getImportMode(@Nonnull 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(@Nonnull String path)
Checks if the given node path is contained in this workspace filter. It returnstrueif any of the filter sets contain the path and it's not globally ignored.- Parameters:
path- to check- Returns:
trueif the given path is included in this filter.
-
covers
boolean covers(@Nonnull 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.- Parameters:
path- the pathto check- Returns:
trueif the given path is covered by this filter.
-
isAncestor
boolean isAncestor(@Nonnull 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
-
isGloballyIgnored
boolean isGloballyIgnored(@Nonnull 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
@Nonnull 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
@Nonnull String getSourceAsString()
Returns the source xml that constructs this filter- Returns:
- the source xml
-
translate
@Nonnull WorkspaceFilter translate(@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(@Nonnull Node rootNode, @Nonnull ProgressTrackerListener listener) throws RepositoryException
Dumps the coverage of this filter against the given node to the listener.- Parameters:
rootNode- root nodelistener- listener- Throws:
RepositoryException- if an error occurs
-
dumpCoverage
void dumpCoverage(@Nonnull Session session, @Nonnull ProgressTrackerListener listener, boolean skipJcrContent) throws RepositoryException
Dumps the coverage of this filter using the given session. The traversal starts at the common ancestor of all filter sets. IfskipJcrContentistruethe jcr:content nodes are excluded from traversal and reporting.- Parameters:
session- sessionlistener- listener to report progressskipJcrContent-trueto skip jcr:content nodes- Throws:
RepositoryException- if an error occurs
-
-