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 Details

    • 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 returns true if any of the filter sets contain the path and it's not globally ignored.

      If contains(String) returns true for one path, also covers(String) would return true 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 returns true if at least one of the sets covers the path and is not globally ignored.

      Still contains(String) might return false 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 javax.jcr.Node rootNode, @NotNull @NotNull ProgressTrackerListener listener) throws javax.jcr.RepositoryException
      Dumps the coverage of this filter against the given node to the listener.
      Parameters:
      rootNode - root node
      listener - listener
      Throws:
      javax.jcr.RepositoryException - if an error occurs
    • dumpCoverage

      void dumpCoverage(@NotNull @NotNull javax.jcr.Session session, @NotNull @NotNull ProgressTrackerListener listener, boolean skipJcrContent) throws javax.jcr.RepositoryException
      Dumps the coverage of this filter using the given session. The traversal starts at the common ancestor of all filter sets. If skipJcrContent is true the jcr:content nodes are excluded from traversal and reporting.
      Parameters:
      session - session
      listener - listener to report progress
      skipJcrContent - true to skip jcr:content nodes
      Throws:
      javax.jcr.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 returns true.
      Parameters:
      propertyPath - the path to the property
      Returns:
      true if the property is included in the filter