Interface WorkspaceFilter
-
- All Superinterfaces:
Dumpable
- All Known Implementing Classes:
DefaultWorkspaceFilter
,ScopedWorkspaceFilter
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(String path)
Checks if the given node path is contained in this workspace filter.boolean
covers(String path)
Checks if the given node path is covered in this workspace filter.void
dumpCoverage(Node rootNode, ProgressTrackerListener listener)
Dumps the coverage of this filter against the given node to the listener.void
dumpCoverage(Session session, ProgressTrackerListener listener, boolean skipJcrContent)
Dumps the coverage of this filter using the given session.PathFilterSet
getCoveringFilterSet(String path)
Returns the filter set that covers the respective node pathList<PathFilterSet>
getFilterSets()
Returns a list of path filter sets for node items.ImportMode
getImportMode(String path)
Returns the import mode for the given node path.List<PathFilterSet>
getPropertyFilterSets()
Returns a list of path filter sets for property items.InputStream
getSource()
Returns the source xml that constructs this filter It is the obligation of the caller to close the returned input stream.String
getSourceAsString()
Returns the source xml that constructs this filterboolean
isAncestor(String path)
Checks if the given node path is an ancestor of any of the filter sets.boolean
isGloballyIgnored(String path)
Checks if the given node path is globally ignored.WorkspaceFilter
translate(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.REPLACE
if 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 returnstrue
if any of the filter sets contain the path and it's not globally ignored.- Parameters:
path
- to check- Returns:
true
if 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 returnstrue
if at least one of the sets covers the path and is not globally ignored.- Parameters:
path
- the pathto check- Returns:
true
if 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:
true
if 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:
true
if 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. IfskipJcrContent
istrue
the jcr:content nodes are excluded from traversal and reporting.- Parameters:
session
- sessionlistener
- listener to report progressskipJcrContent
-true
to skip jcr:content nodes- Throws:
RepositoryException
- if an error occurs
-
-