Class CompositeRestrictionProvider

    • 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 Restriction createRestriction​(@Nullable java.lang.String oakPath, @NotNull java.lang.String oakName, @NotNull javax.jcr.Value value)
      Creates a new single valued restriction for the specified parameters.
      @NotNull Restriction createRestriction​(@Nullable java.lang.String oakPath, @NotNull java.lang.String oakName, @NotNull javax.jcr.Value... values)
      Creates a new multi valued restriction for the specified parameters.
      @NotNull RestrictionPattern getPattern​(@Nullable java.lang.String oakPath, @NotNull java.util.Set<Restriction> restrictions)
      Creates the RestrictionPattern for the specified restrictions.
      @NotNull RestrictionPattern getPattern​(@Nullable java.lang.String oakPath, @NotNull org.apache.jackrabbit.oak.api.Tree tree)
      Creates the RestrictionPattern for 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 RestrictionProvider newInstance​(@NotNull java.util.Collection<? extends RestrictionProvider> providers)  
      static RestrictionProvider newInstance​(@NotNull RestrictionProvider... providers)  
      @NotNull java.util.Set<Restriction> readRestrictions​(@Nullable java.lang.String oakPath, @NotNull org.apache.jackrabbit.oak.api.Tree aceTree)
      Read the valid restrictions stored in the specified ACE tree.
      void validateRestrictions​(@Nullable java.lang.String oakPath, @NotNull org.apache.jackrabbit.oak.api.Tree aceTree)
      Validate the restrictions present with the specified ACE tree.
      void writeRestrictions​(@Nullable java.lang.String oakPath, @NotNull org.apache.jackrabbit.oak.api.Tree aceTree, @NotNull java.util.Set<Restriction> restrictions)
      Writes the given restrictions to the specified ACE tree.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getSupportedRestrictions

        @NotNull
        public @NotNull java.util.Set<RestrictionDefinition> getSupportedRestrictions​(@Nullable
                                                                                      @Nullable java.lang.String oakPath)
        Description copied from interface: RestrictionProvider
        Returns the restriction definitions supported by this provider implementation at the specified path.
        Specified by:
        getSupportedRestrictions in interface RestrictionProvider
        Parameters:
        oakPath - The path of the access controlled tree. A null path 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 javax.jcr.Value value)
                                               throws javax.jcr.RepositoryException
        Description copied from interface: RestrictionProvider
        Creates a new single valued restriction for the specified parameters.
        Specified by:
        createRestriction in interface RestrictionProvider
        Parameters:
        oakPath - The path of the access controlled tree or null if 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:
        javax.jcr.security.AccessControlException - If no matching restriction definition exists for the specified parameters.
        javax.jcr.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 javax.jcr.Value... values)
                                               throws javax.jcr.RepositoryException
        Description copied from interface: RestrictionProvider
        Creates a new multi valued restriction for the specified parameters.
        Specified by:
        createRestriction in interface RestrictionProvider
        Parameters:
        oakPath - The path of the access controlled tree or null if 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:
        javax.jcr.security.AccessControlException - If no matching restriction definition exists for the specified parameters.
        javax.jcr.RepositoryException - If another error occurs.
      • readRestrictions

        @NotNull
        public @NotNull java.util.Set<Restriction> readRestrictions​(@Nullable
                                                                    @Nullable java.lang.String oakPath,
                                                                    @NotNull
                                                                    @NotNull org.apache.jackrabbit.oak.api.Tree aceTree)
        Description copied from interface: RestrictionProvider
        Read the valid restrictions stored in the specified ACE tree.
        Specified by:
        readRestrictions in interface RestrictionProvider
        Parameters:
        oakPath - The path of the access controlled tree or null if 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 org.apache.jackrabbit.oak.api.Tree aceTree,
                                      @NotNull
                                      @NotNull java.util.Set<Restriction> restrictions)
                               throws javax.jcr.RepositoryException
        Description copied from interface: RestrictionProvider
        Writes the given restrictions to the specified ACE tree. Note, that this method does not need to validate the specified restrictions (see also RestrictionProvider.validateRestrictions(String, org.apache.jackrabbit.oak.api.Tree)).
        Specified by:
        writeRestrictions in interface RestrictionProvider
        Parameters:
        oakPath - The path of the access controlled tree or null if 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:
        javax.jcr.RepositoryException - If an error occurs while writing the restrictions.
      • validateRestrictions

        public void validateRestrictions​(@Nullable
                                         @Nullable java.lang.String oakPath,
                                         @NotNull
                                         @NotNull org.apache.jackrabbit.oak.api.Tree aceTree)
                                  throws javax.jcr.RepositoryException
        Description copied from interface: RestrictionProvider
        Validate the restrictions present with the specified ACE tree.
        Specified by:
        validateRestrictions in interface RestrictionProvider
        Parameters:
        oakPath - The path of the access controlled tree or null if the target policies applies to the repository level.
        aceTree - The tree corresponding to an ACE.
        Throws:
        javax.jcr.security.AccessControlException - If any invalid restrictions are detected.
        javax.jcr.RepositoryException - If another error occurs.
      • getPattern

        @NotNull
        public @NotNull RestrictionPattern getPattern​(@Nullable
                                                      @Nullable java.lang.String oakPath,
                                                      @NotNull
                                                      @NotNull org.apache.jackrabbit.oak.api.Tree tree)
        Description copied from interface: RestrictionProvider
        Creates the RestrictionPattern for the restriction information stored with specified tree.
        Specified by:
        getPattern in interface RestrictionProvider
        Parameters:
        oakPath - The path of the access controlled tree or null if the target policies applies to the repository level.
        tree - The tree holding the restriction information.
        Returns:
        A new RestrictionPattern representing 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: RestrictionProvider
        Creates the RestrictionPattern for the specified restrictions. The implementation should ignore all restrictions present in the specified set that it doesn't support.
        Specified by:
        getPattern in interface RestrictionProvider
        Parameters:
        oakPath - The path of the access controlled tree or null if the target policies applies to the repository level.
        restrictions - the restrictions.
        Returns:
        A new RestrictionPattern representing those restrictions of the specified set that are supported by this implementation.