org.apache.jackrabbit.core.security.user
Class UserImporter

java.lang.Object
  extended by org.apache.jackrabbit.core.xml.DefaultProtectedPropertyImporter
      extended by org.apache.jackrabbit.core.security.user.UserImporter
All Implemented Interfaces:
ProtectedPropertyImporter

public class UserImporter
extends DefaultProtectedPropertyImporter

UserImporter implements a DefaultProtectedPropertyImporter that is able to deal with user/group content as defined by the default user related node types present with jackrabbit-core.

The importer is intended to be used by applications that import user content extracted from another repository instance and immediately persist the imported content using Session.save(). Omitting the save call will lead to transient, semi-validated user content and eventually to inconsistencies.

Note the following restrictions:

Known Issue:
Importing rep:impersonators property refering to principals that are created during this import AND have principalName different from the ID will no succeed, as the validation in ImpersonationImpl isn't able to find the authorizable with the given principal (reason: query will only find persisted content).


Nested Class Summary
static class UserImporter.ImportBehavior
          Inner class defining the treatment of membership or impersonator values pointing to non-existing authorizables.
 
Field Summary
static String PARAM_IMPORT_BEHAVIOR
           
 
Fields inherited from class org.apache.jackrabbit.core.xml.DefaultProtectedPropertyImporter
isWorkspaceImport, referenceTracker, resolver, session, uuidBehavior
 
Constructor Summary
UserImporter()
           
 
Method Summary
 String getImportBehavior()
           
 boolean handlePropInfo(NodeImpl parent, PropInfo protectedPropInfo, QPropertyDefinition def)
          Always returns false.
 boolean init(JackrabbitSession session, NamePathResolver resolver, boolean isWorkspaceImport, int uuidBehavior, ReferenceChangeTracker referenceTracker)
           
 void processReferences()
          Always returns false.
 void setImportBehavior(String importBehaviorStr)
           
 
Methods inherited from class org.apache.jackrabbit.core.xml.DefaultProtectedPropertyImporter
handlePropInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_IMPORT_BEHAVIOR

public static final String PARAM_IMPORT_BEHAVIOR
See Also:
Constant Field Values
Constructor Detail

UserImporter

public UserImporter()
Method Detail

init

public boolean init(JackrabbitSession session,
                    NamePathResolver resolver,
                    boolean isWorkspaceImport,
                    int uuidBehavior,
                    ReferenceChangeTracker referenceTracker)
Specified by:
init in interface ProtectedPropertyImporter
Overrides:
init in class DefaultProtectedPropertyImporter
referenceTracker - @return

handlePropInfo

public boolean handlePropInfo(NodeImpl parent,
                              PropInfo protectedPropInfo,
                              QPropertyDefinition def)
                       throws RepositoryException
Description copied from class: DefaultProtectedPropertyImporter
Always returns false.

Specified by:
handlePropInfo in interface ProtectedPropertyImporter
Overrides:
handlePropInfo in class DefaultProtectedPropertyImporter
Parameters:
parent - The affected parent node.
protectedPropInfo - The PropInfo to be imported.
def - The property definition determined by the importer that calls this method.
Returns:
true If the property could be successfully imported; false otherwise.
Throws:
RepositoryException - If an error occurs.
See Also:
ProtectedPropertyImporter.handlePropInfo(org.apache.jackrabbit.core.NodeImpl, PropInfo, QPropertyDefinition)

processReferences

public void processReferences()
                       throws RepositoryException
Description copied from class: DefaultProtectedPropertyImporter
Always returns false.

Specified by:
processReferences in interface ProtectedPropertyImporter
Overrides:
processReferences in class DefaultProtectedPropertyImporter
Throws:
RepositoryException - If an error occurs.
See Also:
ProtectedPropertyImporter.processReferences()

getImportBehavior

public String getImportBehavior()
Returns:
human readable representation of the importBehavior value.

setImportBehavior

public void setImportBehavior(String importBehaviorStr)
Parameters:
importBehaviorStr -


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.