public abstract class AbstractRestrictionProvider extends Object implements RestrictionProvider, AccessControlConstants
EMPTYAC_NODETYPE_NAMES, ACE_PROPERTY_NAMES, MIX_REP_ACCESS_CONTROLLABLE, MIX_REP_REPO_ACCESS_CONTROLLABLE, NT_REP_ACE, NT_REP_ACL, NT_REP_DENY_ACE, NT_REP_GRANT_ACE, NT_REP_POLICY, NT_REP_RESTRICTIONS, PARAM_RESTRICTION_PROVIDER, POLICY_NODE_NAMES, REP_GLOB, REP_ITEM_NAMES, REP_NODE_PATH, REP_NT_NAMES, REP_POLICY, REP_PREFIXES, REP_PRINCIPAL_NAME, REP_PRIVILEGES, REP_REPO_POLICY, REP_RESTRICTIONS| Constructor and Description |
|---|
AbstractRestrictionProvider(@NotNull Map<String,? extends RestrictionDefinition> definitions) |
| Modifier and Type | Method and Description |
|---|---|
@NotNull Restriction |
createRestriction(String oakPath,
@NotNull String oakName,
Value... values)
Creates a new multi valued restriction for the specified parameters.
|
@NotNull Restriction |
createRestriction(String oakPath,
@NotNull String oakName,
@NotNull Value value)
Creates a new single valued restriction for the specified parameters.
|
protected @NotNull org.apache.jackrabbit.oak.api.Tree |
getRestrictionsTree(@NotNull org.apache.jackrabbit.oak.api.Tree aceTree)
Returns the tree that contains the restriction of the specified
ACE tree.
|
@NotNull Set<RestrictionDefinition> |
getSupportedRestrictions(String oakPath)
Returns the restriction definitions supported by this provider implementation
at the specified path.
|
protected boolean |
isUnsupportedPath(@Nullable String oakPath)
Returns
true if the specified path is null. |
@NotNull Set<Restriction> |
readRestrictions(String oakPath,
@NotNull org.apache.jackrabbit.oak.api.Tree aceTree)
Read the valid restrictions stored in the specified ACE tree.
|
void |
validateRestrictions(String oakPath,
@NotNull org.apache.jackrabbit.oak.api.Tree aceTree)
Validate the restrictions present with the specified ACE tree.
|
void |
writeRestrictions(String oakPath,
org.apache.jackrabbit.oak.api.Tree aceTree,
Set<Restriction> restrictions)
Writes the given restrictions to the specified ACE tree.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPattern, getPatternpublic AbstractRestrictionProvider(@NotNull
@NotNull Map<String,? extends RestrictionDefinition> definitions)
@NotNull public @NotNull Set<RestrictionDefinition> getSupportedRestrictions(String oakPath)
RestrictionProvidergetSupportedRestrictions in interface RestrictionProvideroakPath - The path of the access controlled tree. A null
path indicates that the supported restrictions for repository level
policies should be returned.@NotNull public @NotNull Restriction createRestriction(String oakPath, @NotNull @NotNull String oakName, @NotNull @NotNull Value value) throws RepositoryException
RestrictionProvidercreateRestriction in interface RestrictionProvideroakPath - 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.AccessControlException - If no matching restriction definition
exists for the specified parameters.RepositoryException - If another error occurs.@NotNull public @NotNull Restriction createRestriction(String oakPath, @NotNull @NotNull String oakName, @NotNull Value... values) throws RepositoryException
RestrictionProvidercreateRestriction in interface RestrictionProvideroakPath - 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.AccessControlException - If no matching restriction definition
exists for the specified parameters.RepositoryException - If another error occurs.@NotNull public @NotNull Set<Restriction> readRestrictions(String oakPath, @NotNull @NotNull org.apache.jackrabbit.oak.api.Tree aceTree)
RestrictionProviderreadRestrictions in interface RestrictionProvideroakPath - 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.public void writeRestrictions(String oakPath, org.apache.jackrabbit.oak.api.Tree aceTree, Set<Restriction> restrictions) throws RepositoryException
RestrictionProviderRestrictionProvider.validateRestrictions(String, org.apache.jackrabbit.oak.api.Tree)).writeRestrictions in interface RestrictionProvideroakPath - 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.RepositoryException - If an error occurs while writing the
restrictions.public void validateRestrictions(String oakPath, @NotNull @NotNull org.apache.jackrabbit.oak.api.Tree aceTree) throws AccessControlException
RestrictionProvidervalidateRestrictions in interface RestrictionProvideroakPath - 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.AccessControlException - If any invalid restrictions are detected.protected boolean isUnsupportedPath(@Nullable
@Nullable String oakPath)
true if the specified path is null. Subclasses may
change the default behavior.oakPath - The path for which a restriction is being created.true if this implementation can create restrictions for
the specified oakPath; false otherwise.@NotNull protected @NotNull org.apache.jackrabbit.oak.api.Tree getRestrictionsTree(@NotNull @NotNull org.apache.jackrabbit.oak.api.Tree aceTree)
aceTree - The ACE tree for which the restrictions are being read.Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.