Class CompositePattern
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.security.authorization.restriction.CompositePattern
-
- All Implemented Interfaces:
RestrictionPattern
public final class CompositePattern extends java.lang.Object implements RestrictionPattern
Aggregates of a list ofRestrictionPattern
s into a single pattern. The implementations ofmatches
returnstrue
if all aggregated patterns successfully validate the given parameters and returnsfalse
as soon as the first aggregated pattern returnsfalse
.
-
-
Field Summary
-
Fields inherited from interface org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionPattern
EMPTY
-
-
Constructor Summary
Constructors Constructor Description CompositePattern(@NotNull java.util.List<RestrictionPattern> patterns)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RestrictionPattern
create(@NotNull java.util.List<RestrictionPattern> patterns)
boolean
matches()
Returnstrue
if the underlying restriction matches for repository level permissions.boolean
matches(@NotNull java.lang.String path)
Returnstrue
if the underlying restriction matches the specified path.boolean
matches(@NotNull java.lang.String path, boolean isProperty)
Returnstrue
if the underlying restriction matches the specified path and item type.boolean
matches(@NotNull Tree tree, @Nullable PropertyState property)
Returnstrue
if the underlying restriction matches the specified tree or property state.
-
-
-
Constructor Detail
-
CompositePattern
public CompositePattern(@NotNull @NotNull java.util.List<RestrictionPattern> patterns)
-
-
Method Detail
-
create
public static RestrictionPattern create(@NotNull @NotNull java.util.List<RestrictionPattern> patterns)
-
matches
public boolean matches(@NotNull @NotNull Tree tree, @Nullable @Nullable PropertyState property)
Description copied from interface:RestrictionPattern
Returnstrue
if the underlying restriction matches the specified tree or property state.- Specified by:
matches
in interfaceRestrictionPattern
- Parameters:
tree
- The target tree or the parent of the target property.property
- The target property state ornull
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 java.lang.String path)
Description copied from interface:RestrictionPattern
Returnstrue
if the underlying restriction matches the specified path. Note, that if the nature of the item atpath
is knowRestrictionPattern.matches(String, boolean)
should be called instead.- Specified by:
matches
in interfaceRestrictionPattern
- 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 java.lang.String path, boolean isProperty)
Description copied from interface:RestrictionPattern
Returnstrue
if the underlying restriction matches the specified path and item type. If the nature of the item atpath
is unknownRestrictionPattern.matches(String)
should be called instead. Note, for backwards compatibility this method comes with a default implementation making it equivalent toRestrictionPattern.matches(String)
. Implementations of theRestrictionPattern
interface should overwrite the default if the underlying restriction applies different behavior for nodes and properties.- Specified by:
matches
in interfaceRestrictionPattern
- Parameters:
path
- The path of the target item.isProperty
- Iftrue
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
Returnstrue
if the underlying restriction matches for repository level permissions.- Specified by:
matches
in interfaceRestrictionPattern
- Returns:
true
if the underlying restriction matches for repository level permissions that are not associated with a path or a dedicated item;false
otherwise.
-
-