Class AccessControlImporter
- java.lang.Object
-
- org.apache.jackrabbit.oak.security.authorization.accesscontrol.AccessControlImporter
-
- All Implemented Interfaces:
AccessControlConstants,ProtectedItemImporter,ProtectedNodeImporter
public class AccessControlImporter extends Object implements ProtectedNodeImporter, AccessControlConstants
ProtectedNodeImporterimplementation that handles access control lists, entries and restrictions.
-
-
Field Summary
-
Fields inherited from interface org.apache.jackrabbit.oak.spi.security.authorization.accesscontrol.AccessControlConstants
AC_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_CURRENT, REP_GLOB, REP_GLOBS, REP_ITEM_NAMES, REP_NODE_PATH, REP_NT_NAMES, REP_POLICY, REP_PREFIXES, REP_PRINCIPAL_NAME, REP_PRIVILEGES, REP_REPO_POLICY, REP_RESTRICTIONS, REP_SUBTREES
-
Fields inherited from interface org.apache.jackrabbit.oak.spi.xml.ProtectedItemImporter
PARAM_IMPORT_BEHAVIOR
-
-
Constructor Summary
Constructors Constructor Description AccessControlImporter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidend(@NotNull Tree protectedParent)Informs this importer that the tree to be imported belowprotectedParenthas bee completed.voidendChildInfo()Informs this importer about the end of a child info.booleaninit(@NotNull Session session, @NotNull Root root, @NotNull NamePathMapper namePathMapper, boolean isWorkspaceImport, int uuidBehavior, @NotNull ReferenceChangeTracker referenceTracker, @NotNull SecurityProvider securityProvider)Initializes the importer.voidprocessReferences()Post processing protected reference properties underneath a protected or non-protected parent node.booleanstart(@NotNull Tree protectedParent)Notifies this importer about the existence of a protected node that has either been created (NEW) or has been found to be existing.voidstartChildInfo(@NotNull NodeInfo childInfo, @NotNull List<PropInfo> propInfos)Informs this importer about a newchildInfoand it's properties.
-
-
-
Method Detail
-
init
public boolean init(@NotNull @NotNull Session session, @NotNull @NotNull Root root, @NotNull @NotNull NamePathMapper namePathMapper, boolean isWorkspaceImport, int uuidBehavior, @NotNull @NotNull ReferenceChangeTracker referenceTracker, @NotNull @NotNull SecurityProvider securityProvider)Description copied from interface:ProtectedItemImporterInitializes the importer.- Specified by:
initin interfaceProtectedItemImporter- Parameters:
session- The session that is running the import.root- The root associated with the import.namePathMapper- The name/path mapper used to translate names between their jcr and oak form.isWorkspaceImport- A flag indicating whether the import has been started from theWorkspaceor from theSession. Implementations are free to implement both types of imports or only a single one. For example it doesn't make sense to allow for importing versions along with a Session import as version operations are required to never leave transient changes behind.uuidBehavior- The uuid behavior specified with the import call.referenceTracker- The uuid/reference helper.securityProvider- The security provider.- Returns:
trueif this importer was successfully initialized and is able to handle an import with the given setup;falseotherwise.
-
processReferences
public void processReferences()
Description copied from interface:ProtectedItemImporterPost processing protected reference properties underneath a protected or non-protected parent node. If the parent is protected it has been handled by this importer already.- Specified by:
processReferencesin interfaceProtectedItemImporter
-
start
public boolean start(@NotNull @NotNull Tree protectedParent) throws RepositoryExceptionDescription copied from interface:ProtectedNodeImporterNotifies this importer about the existence of a protected node that has either been created (NEW) or has been found to be existing. This importer implementation is in charge of evaluating the nature of that protected node in order to determine, if it is able to handle subsequent protected or non-protected child nodes in the tree below that parent.- Specified by:
startin interfaceProtectedNodeImporter- Parameters:
protectedParent- A protected node that has either been created during the current XML import or that has been found to be existing without allowing same-name siblings.- Returns:
trueIf this importer is able to deal with the tree that may be present below the given protected Node.- Throws:
RepositoryException- If an error occurs.
-
end
public void end(@NotNull @NotNull Tree protectedParent) throws RepositoryExceptionDescription copied from interface:ProtectedNodeImporterInforms this importer that the tree to be imported belowprotectedParenthas bee completed. This allows the importer to be reset in order to be able to deal with another call toProtectedNodeImporter.start(Tree).If
ProtectedNodeImporter.start(Tree)hasn't been called before, this method returns silently.- Specified by:
endin interfaceProtectedNodeImporter- Parameters:
protectedParent- The protected parent tree.- Throws:
ConstraintViolationException- If the tree that was imported is incomplete.RepositoryException- If another error occurs.
-
startChildInfo
public void startChildInfo(@NotNull @NotNull NodeInfo childInfo, @NotNull @NotNull List<PropInfo> propInfos) throws RepositoryExceptionDescription copied from interface:ProtectedNodeImporterInforms this importer about a newchildInfoand it's properties. If the importer is able to successfully import the given information this method returns silently. OtherwiseConstraintViolationExceptionis thrown, in which case the whole import fails.In case this importer deals with multiple levels of nodes, it is in charge of maintaining the hierarchical structure (see also {#link endChildInfo()}.
If
ProtectedNodeImporter.start(Tree)hasn't been called before, this method returns silently.- Specified by:
startChildInfoin interfaceProtectedNodeImporter- Parameters:
childInfo- TheNodeInfofor the new protected child.propInfos- The properties of that child.- Throws:
ConstraintViolationException- If the given infos contain invalid or incomplete data and therefore cannot be properly handled by this importer.RepositoryException- If another error occurs.
-
endChildInfo
public void endChildInfo() throws RepositoryExceptionDescription copied from interface:ProtectedNodeImporterInforms this importer about the end of a child info.If
ProtectedNodeImporter.start(Tree)hasn't been called before, this method returns silently.- Specified by:
endChildInfoin interfaceProtectedNodeImporter- Throws:
ConstraintViolationException- If this method is called before all required child information has been imported.RepositoryException- If another error occurs.
-
-