Class CompositeRestrictionProvider
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.security.authorization.restriction.CompositeRestrictionProvider
-
- All Implemented Interfaces:
RestrictionProvider
public final class CompositeRestrictionProvider extends java.lang.Object implements RestrictionProvider
Aggregates of a collection ofRestrictionProviderimplementations into a single provider.
-
-
Field Summary
-
Fields inherited from interface org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionProvider
EMPTY
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull RestrictioncreateRestriction(@Nullable java.lang.String oakPath, @NotNull java.lang.String oakName, @NotNull Value value)Creates a new single valued restriction for the specified parameters.@NotNull RestrictioncreateRestriction(@Nullable java.lang.String oakPath, @NotNull java.lang.String oakName, @NotNull Value... values)Creates a new multi valued restriction for the specified parameters.@NotNull RestrictionPatterngetPattern(@Nullable java.lang.String oakPath, @NotNull java.util.Set<Restriction> restrictions)Creates theRestrictionPatternfor the specified restrictions.@NotNull RestrictionPatterngetPattern(@Nullable java.lang.String oakPath, @NotNull Tree tree)Creates theRestrictionPatternfor the restriction information stored with specified tree.@NotNull java.util.Set<RestrictionDefinition>getSupportedRestrictions(@Nullable java.lang.String oakPath)Returns the restriction definitions supported by this provider implementation at the specified path.static RestrictionProvidernewInstance(@NotNull java.util.Collection<? extends RestrictionProvider> providers)static RestrictionProvidernewInstance(@NotNull RestrictionProvider... providers)@NotNull java.util.Set<Restriction>readRestrictions(@Nullable java.lang.String oakPath, @NotNull Tree aceTree)Read the valid restrictions stored in the specified ACE tree.voidvalidateRestrictions(@Nullable java.lang.String oakPath, @NotNull Tree aceTree)Validate the restrictions present with the specified ACE tree.voidwriteRestrictions(@Nullable java.lang.String oakPath, @NotNull Tree aceTree, @NotNull java.util.Set<Restriction> restrictions)Writes the given restrictions to the specified ACE tree.
-
-
-
Method Detail
-
newInstance
public static RestrictionProvider newInstance(@NotNull @NotNull RestrictionProvider... providers)
-
newInstance
public static RestrictionProvider newInstance(@NotNull @NotNull java.util.Collection<? extends RestrictionProvider> providers)
-
getSupportedRestrictions
@NotNull public @NotNull java.util.Set<RestrictionDefinition> getSupportedRestrictions(@Nullable @Nullable java.lang.String oakPath)
Description copied from interface:RestrictionProviderReturns the restriction definitions supported by this provider implementation at the specified path.- Specified by:
getSupportedRestrictionsin interfaceRestrictionProvider- Parameters:
oakPath- The path of the access controlled tree. Anullpath indicates that the supported restrictions for repository level policies should be returned.- Returns:
- The set of supported restrictions at the given path.
-
createRestriction
@NotNull public @NotNull Restriction createRestriction(@Nullable @Nullable java.lang.String oakPath, @NotNull @NotNull java.lang.String oakName, @NotNull @NotNull Value value) throws RepositoryException
Description copied from interface:RestrictionProviderCreates a new single valued restriction for the specified parameters.- Specified by:
createRestrictionin interfaceRestrictionProvider- Parameters:
oakPath- The path of the access controlled tree ornullif the target policies applies to the repository level.oakName- The name of the restriction.value- The value of the restriction.- Returns:
- A new restriction instance.
- Throws:
AccessControlException- If no matching restriction definition exists for the specified parameters.RepositoryException- If another error occurs.
-
createRestriction
@NotNull public @NotNull Restriction createRestriction(@Nullable @Nullable java.lang.String oakPath, @NotNull @NotNull java.lang.String oakName, @NotNull @NotNull Value... values) throws RepositoryException
Description copied from interface:RestrictionProviderCreates a new multi valued restriction for the specified parameters.- Specified by:
createRestrictionin interfaceRestrictionProvider- Parameters:
oakPath- The path of the access controlled tree ornullif the target policies applies to the repository level.oakName- The name of the restriction.values- The values of the restriction.- Returns:
- A new restriction instance.
- Throws:
AccessControlException- If no matching restriction definition exists for the specified parameters.RepositoryException- If another error occurs.
-
readRestrictions
@NotNull public @NotNull java.util.Set<Restriction> readRestrictions(@Nullable @Nullable java.lang.String oakPath, @NotNull @NotNull Tree aceTree)
Description copied from interface:RestrictionProviderRead the valid restrictions stored in the specified ACE tree.- Specified by:
readRestrictionsin interfaceRestrictionProvider- Parameters:
oakPath- The path of the access controlled tree ornullif the target policies applies to the repository level.aceTree- The tree corresponding to an ACE that may contain restrictions.- Returns:
- The valid restrictions stored with the specified tree or an empty set.
-
writeRestrictions
public void writeRestrictions(@Nullable @Nullable java.lang.String oakPath, @NotNull @NotNull Tree aceTree, @NotNull @NotNull java.util.Set<Restriction> restrictions) throws RepositoryExceptionDescription copied from interface:RestrictionProviderWrites the given restrictions to the specified ACE tree. Note, that this method does not need to validate the specified restrictions (see alsoRestrictionProvider.validateRestrictions(String, org.apache.jackrabbit.oak.api.Tree)).- Specified by:
writeRestrictionsin interfaceRestrictionProvider- Parameters:
oakPath- The path of the access controlled tree ornullif the target policies applies to the repository level.aceTree- The tree corresponding to an ACE that will have the specified restrictions added.restrictions- The set of restrictions to be written to the specified tree.- Throws:
RepositoryException- If an error occurs while writing the restrictions.
-
validateRestrictions
public void validateRestrictions(@Nullable @Nullable java.lang.String oakPath, @NotNull @NotNull Tree aceTree) throws RepositoryExceptionDescription copied from interface:RestrictionProviderValidate the restrictions present with the specified ACE tree.- Specified by:
validateRestrictionsin interfaceRestrictionProvider- Parameters:
oakPath- The path of the access controlled tree ornullif the target policies applies to the repository level.aceTree- The tree corresponding to an ACE.- Throws:
AccessControlException- If any invalid restrictions are detected.RepositoryException- If another error occurs.
-
getPattern
@NotNull public @NotNull RestrictionPattern getPattern(@Nullable @Nullable java.lang.String oakPath, @NotNull @NotNull Tree tree)
Description copied from interface:RestrictionProviderCreates theRestrictionPatternfor the restriction information stored with specified tree.- Specified by:
getPatternin interfaceRestrictionProvider- Parameters:
oakPath- The path of the access controlled tree ornullif the target policies applies to the repository level.tree- The tree holding the restriction information.- Returns:
- A new
RestrictionPatternrepresenting the restriction information present with the given tree.
-
getPattern
@NotNull public @NotNull RestrictionPattern getPattern(@Nullable @Nullable java.lang.String oakPath, @NotNull @NotNull java.util.Set<Restriction> restrictions)
Description copied from interface:RestrictionProviderCreates theRestrictionPatternfor the specified restrictions. The implementation should ignore all restrictions present in the specified set that it doesn't support.- Specified by:
getPatternin interfaceRestrictionProvider- Parameters:
oakPath- The path of the access controlled tree ornullif the target policies applies to the repository level.restrictions- the restrictions.- Returns:
- A new
RestrictionPatternrepresenting those restrictions of the specified set that are supported by this implementation.
-
-