java.lang.Object
org.apache.jackrabbit.oak.spi.security.authorization.restriction.CompositePattern
All Implemented Interfaces:
RestrictionPattern

public final class CompositePattern extends Object implements RestrictionPattern
Aggregates of a list of RestrictionPatterns into a single pattern. The implementations of matches returns true if all aggregated patterns successfully validate the given parameters and returns false as soon as the first aggregated pattern returns false.
  • Field Summary

    Fields inherited from interface org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionPattern

    EMPTY
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    create(@NotNull List<RestrictionPattern> patterns)
     
    boolean
    Returns true if the underlying restriction matches for repository level permissions.
    boolean
    matches(@NotNull String path)
    Returns true if the underlying restriction matches the specified path.
    boolean
    matches(@NotNull String path, boolean isProperty)
    Returns true if the underlying restriction matches the specified path and item type.
    boolean
    matches(@NotNull org.apache.jackrabbit.oak.api.Tree tree, @Nullable org.apache.jackrabbit.oak.api.PropertyState property)
    Returns true if the underlying restriction matches the specified tree or property state.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • create

      public static RestrictionPattern create(@NotNull @NotNull List<RestrictionPattern> patterns)
    • matches

      public boolean matches(@NotNull @NotNull org.apache.jackrabbit.oak.api.Tree tree, @Nullable @Nullable org.apache.jackrabbit.oak.api.PropertyState property)
      Description copied from interface: RestrictionPattern
      Returns true if the underlying restriction matches the specified tree or property state.
      Specified by:
      matches in interface RestrictionPattern
      Parameters:
      tree - The target tree or the parent of the target property.
      property - The target property state or null if the target item is a tree.
      Returns:
      true if the underlying restriction matches the specified tree or property state; false otherwise.
    • matches

      public boolean matches(@NotNull @NotNull String path)
      Description copied from interface: RestrictionPattern
      Returns true if the underlying restriction matches the specified path. Note, that if the nature of the item at path is know RestrictionPattern.matches(String, boolean) should be called instead.
      Specified by:
      matches in interface RestrictionPattern
      Parameters:
      path - The path of the target item.
      Returns:
      true if the underlying restriction matches the specified path; false otherwise.
    • matches

      public boolean matches(@NotNull @NotNull String path, boolean isProperty)
      Description copied from interface: RestrictionPattern
      Returns true if the underlying restriction matches the specified path and item type. If the nature of the item at path is unknown RestrictionPattern.matches(String) should be called instead. Note, for backwards compatibility this method comes with a default implementation making it equivalent to RestrictionPattern.matches(String). Implementations of the RestrictionPattern interface should overwrite the default if the underlying restriction applies different behavior for nodes and properties.
      Specified by:
      matches in interface RestrictionPattern
      Parameters:
      path - The path of the target item.
      isProperty - If true the target item is known to be a property, otherwise it is known to be a node.
      Returns:
      true if the underlying restriction matches the specified path and item type; false otherwise.
    • matches

      public boolean matches()
      Description copied from interface: RestrictionPattern
      Returns true if the underlying restriction matches for repository level permissions.
      Specified by:
      matches in interface RestrictionPattern
      Returns:
      true if the underlying restriction matches for repository level permissions that are not associated with a path or a dedicated item; false otherwise.