public class AccessControlImporter extends java.lang.Object implements ProtectedNodeImporter, AccessControlConstants
ProtectedNodeImporter
implementation that handles access control lists,
entries and restrictions.PARAM_IMPORT_BEHAVIOR
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
Constructor and Description |
---|
AccessControlImporter() |
Modifier and Type | Method and Description |
---|---|
void |
end(@NotNull Tree protectedParent)
Informs this importer that the tree to be imported below
protectedParent 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 java.util.List<PropInfo> propInfos)
Informs this importer about a new
childInfo and it's properties. |
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)
ProtectedItemImporter
init
in interface ProtectedItemImporter
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 the Workspace
or from the
Session
. 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.true
if this importer was successfully initialized and
is able to handle an import with the given setup; false
otherwise.public void processReferences()
ProtectedItemImporter
processReferences
in interface ProtectedItemImporter
public boolean start(@NotNull @NotNull Tree protectedParent) throws RepositoryException
ProtectedNodeImporter
start
in interface ProtectedNodeImporter
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.true
If this importer is able to deal with the
tree that may be present below the given protected Node.RepositoryException
- If an error occurs.public void end(@NotNull @NotNull Tree protectedParent) throws RepositoryException
ProtectedNodeImporter
protectedParent
has bee completed. This allows the importer
to be reset in order to be able to deal with another call to
ProtectedNodeImporter.start(Tree)
.
If ProtectedNodeImporter.start(Tree)
hasn't been called before, this method returns
silently.
end
in interface ProtectedNodeImporter
protectedParent
- The protected parent tree.ConstraintViolationException
- If the tree
that was imported is incomplete.RepositoryException
- If another error occurs.public void startChildInfo(@NotNull @NotNull NodeInfo childInfo, @NotNull @NotNull java.util.List<PropInfo> propInfos) throws RepositoryException
ProtectedNodeImporter
childInfo
and it's properties.
If the importer is able to successfully import the given information
this method returns silently. Otherwise
ConstraintViolationException
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.
startChildInfo
in interface ProtectedNodeImporter
childInfo
- The NodeInfo
for the new protected child.propInfos
- The properties of that child.ConstraintViolationException
- If the given
infos contain invalid or incomplete data and therefore cannot be properly
handled by this importer.RepositoryException
- If another error occurs.public void endChildInfo() throws RepositoryException
ProtectedNodeImporter
If ProtectedNodeImporter.start(Tree)
hasn't been called before, this method returns
silently.
endChildInfo
in interface ProtectedNodeImporter
ConstraintViolationException
- If this method
is called before all required child information has been imported.RepositoryException
- If another error occurs.Copyright © 2012–2022 The Apache Software Foundation. All rights reserved.