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
ProtectedNodeImporter
implementation 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 void
end(@NotNull Tree protectedParent)
Informs this importer that the tree to be imported belowprotectedParent
has bee completed.void
endChildInfo()
Informs this importer about the end of a child info.boolean
init(@NotNull Session session, @NotNull Root root, @NotNull NamePathMapper namePathMapper, boolean isWorkspaceImport, int uuidBehavior, @NotNull ReferenceChangeTracker referenceTracker, @NotNull SecurityProvider securityProvider)
Initializes the importer.void
processReferences()
Post processing protected reference properties underneath a protected or non-protected parent node.boolean
start(@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.void
startChildInfo(@NotNull NodeInfo childInfo, @NotNull List<PropInfo> propInfos)
Informs this importer about a newchildInfo
and 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:ProtectedItemImporter
Initializes the importer.- Specified by:
init
in 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 theWorkspace
or 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:
true
if this importer was successfully initialized and is able to handle an import with the given setup;false
otherwise.
-
processReferences
public void processReferences()
Description copied from interface:ProtectedItemImporter
Post 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:
processReferences
in interfaceProtectedItemImporter
-
start
public boolean start(@NotNull @NotNull Tree protectedParent) throws RepositoryException
Description copied from interface:ProtectedNodeImporter
Notifies 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:
start
in 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:
true
If 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 RepositoryException
Description copied from interface:ProtectedNodeImporter
Informs this importer that the tree to be imported belowprotectedParent
has 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:
end
in 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 RepositoryException
Description copied from interface:ProtectedNodeImporter
Informs this importer about a newchildInfo
and it's properties. If the importer is able to successfully import the given information this method returns silently. OtherwiseConstraintViolationException
is 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:
startChildInfo
in interfaceProtectedNodeImporter
- Parameters:
childInfo
- TheNodeInfo
for 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 RepositoryException
Description copied from interface:ProtectedNodeImporter
Informs this importer about the end of a child info.If
ProtectedNodeImporter.start(Tree)
hasn't been called before, this method returns silently.- Specified by:
endChildInfo
in interfaceProtectedNodeImporter
- Throws:
ConstraintViolationException
- If this method is called before all required child information has been imported.RepositoryException
- If another error occurs.
-
-