com.atlassian.crowd.importer.importers
Class DirectoryImporter

java.lang.Object
  extended by com.atlassian.crowd.importer.importers.DirectoryImporter
All Implemented Interfaces:
Importer

public class DirectoryImporter
extends Object

An Importer that manages moving users, groups and roles from one directory to another.


Field Summary
protected  DirectoryManager directoryManager
           
protected  org.slf4j.Logger logger
           
 
Constructor Summary
DirectoryImporter(DirectoryManager directoryManager, PasswordHelper passwordHelper)
           
 
Method Summary
 Collection<GroupTemplate> findGroups(Configuration configuration)
          Will locate and build a collection of GroupTemplate objects based on the passed in Configuration
 Collection<MembershipDTO> findGroupToGroupMemberships(Configuration configuration)
          Will locate and build a collection of MembershipDTO objects which represent membership relationships between groups and groups based on the passed in Configuration.
 Collection<UserTemplateWithCredentialAndAttributes> findUsers(Configuration configuration)
          Will locate and build a collection of UserTemplate objects based on the passed in Configuration
 Collection<MembershipDTO> findUserToGroupMemberships(Configuration configuration)
          Will locate and build a collection of MembershipDTO objects which represent membership relationships between users and groups based on the passed in Configuration.
 Class getConfigurationType()
          The type of configuration being used for this Import.
protected  Result importGroupMemberships(Iterable<MembershipDTO> memberships, Configuration configuration)
           
protected  Result importGroups(Collection<GroupTemplate> groups, Configuration configuration)
           
protected  Result importUserMemberships(Iterable<MembershipDTO> memberships, Configuration configuration)
           
protected  Result importUsers(Collection<UserTemplateWithCredentialAndAttributes> users, Configuration configuration)
           
 Result importUsersGroupsAndMemberships(Configuration configuration)
          Responsible for the import of both users and groups into Crowd using the given Configuration
 void init(Configuration configuration)
          Initialise anything required for the import process.
 Set<Directory> retrieveRemoteSourceDirectory(Configuration configuration)
          The retrieve the set of remote source directories.
 boolean supportsMultipleDirectories(Configuration configuration)
          Some sources might be capable of handling more than one directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger

directoryManager

protected final DirectoryManager directoryManager
Constructor Detail

DirectoryImporter

public DirectoryImporter(DirectoryManager directoryManager,
                         PasswordHelper passwordHelper)
Method Detail

findUserToGroupMemberships

public Collection<MembershipDTO> findUserToGroupMemberships(Configuration configuration)
                                                     throws ImporterException
Will locate and build a collection of MembershipDTO objects which represent membership relationships between users and groups based on the passed in Configuration.

Parameters:
configuration - the Importer Configuration
Returns:
a collection of GroupMemberships to be imported or Collections.EMPTY_LIST
Throws:
ImporterException - if there is an error finding group memberships

findGroupToGroupMemberships

public Collection<MembershipDTO> findGroupToGroupMemberships(Configuration configuration)
                                                      throws ImporterException
Will locate and build a collection of MembershipDTO objects which represent membership relationships between groups and groups based on the passed in Configuration.

Parameters:
configuration - the Importer Configuration
Returns:
a collection of GroupMemberships to be imported or Collections.EMPTY_LIST
Throws:
ImporterException - if there is an error finding group memberships

findGroups

public Collection<GroupTemplate> findGroups(Configuration configuration)
                                     throws ImporterException
Will locate and build a collection of GroupTemplate objects based on the passed in Configuration

Parameters:
configuration - the Importer Configuration
Returns:
a collection of GroupTemplates to be imported or Collections.EMPTY_LIST
Throws:
ImporterException - if there is an error finding the groups

findUsers

public Collection<UserTemplateWithCredentialAndAttributes> findUsers(Configuration configuration)
                                                              throws ImporterException
Will locate and build a collection of UserTemplate objects based on the passed in Configuration

Parameters:
configuration - the Importer Configuration
Returns:
a collection of UserTemplates to be imported or Collections.EMPTY_LIST
Throws:
ImporterException - if there is an error finding the users

init

public void init(Configuration configuration)
Description copied from interface: Importer
Initialise anything required for the import process.

Parameters:
configuration - can contain any setup params such as database settings that need init'ing

getConfigurationType

public Class getConfigurationType()
Description copied from interface: Importer
The type of configuration being used for this Import.

Returns:
Class that should be a subclass of Configuration

importGroups

protected Result importGroups(Collection<GroupTemplate> groups,
                              Configuration configuration)
                       throws ImporterException
Throws:
ImporterException

importUsers

protected Result importUsers(Collection<UserTemplateWithCredentialAndAttributes> users,
                             Configuration configuration)
                      throws ImporterException
Throws:
ImporterException

importUserMemberships

protected Result importUserMemberships(Iterable<MembershipDTO> memberships,
                                       Configuration configuration)
                                throws ImporterException
Throws:
ImporterException

importGroupMemberships

protected Result importGroupMemberships(Iterable<MembershipDTO> memberships,
                                        Configuration configuration)
                                 throws ImporterException
Throws:
ImporterException

importUsersGroupsAndMemberships

public Result importUsersGroupsAndMemberships(Configuration configuration)
                                       throws ImporterException
Description copied from interface: Importer
Responsible for the import of both users and groups into Crowd using the given Configuration

Specified by:
importUsersGroupsAndMemberships in interface Importer
Parameters:
configuration - the Configuration, this could be a JDBC configuration or a CSVConfiguration
Returns:
the result of the import
Throws:
ImporterException - general exception if anything happened during the import

supportsMultipleDirectories

public boolean supportsMultipleDirectories(Configuration configuration)
Description copied from interface: Importer
Some sources might be capable of handling more than one directory.

Specified by:
supportsMultipleDirectories in interface Importer
Parameters:
configuration - the Importer Configuration
Returns:
true if the source can have multiple directories.

retrieveRemoteSourceDirectory

public Set<Directory> retrieveRemoteSourceDirectory(Configuration configuration)
Description copied from interface: Importer
The retrieve the set of remote source directories.

Specified by:
retrieveRemoteSourceDirectory in interface Importer
Parameters:
configuration - the import configuration.
Returns:
the set of source directories.


Copyright © 2012 Atlassian. All Rights Reserved.