Class DirectoryImporter
java.lang.Object
com.atlassian.crowd.importer.importers.DirectoryImporter
- All Implemented Interfaces:
Importer
An Importer that manages moving users, groups and roles from one directory to another.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DirectoryManager
protected final org.slf4j.Logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindGroups
(Configuration configuration) Will locate and build a collection of GroupTemplate objects based on the passed in ConfigurationfindGroupToGroupMemberships
(Configuration configuration) Will locate and build a collection ofMembershipDTO
objects which represent membership relationships between groups and groups based on the passed in Configuration.findUsers
(Configuration configuration) Will locate and build a collection of UserTemplate objects based on the passed in ConfigurationfindUserToGroupMemberships
(Configuration configuration) Will locate and build a collection ofMembershipDTO
objects which represent membership relationships between users and groups based on the passed in Configuration.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) importUsersGroupsAndMemberships
(Configuration configuration) Responsible for the import of both users and groups into Crowd using the givenConfiguration
void
init
(Configuration configuration) Initialise anything required for the import process.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.
-
Field Details
-
logger
protected final org.slf4j.Logger logger -
directoryManager
-
-
Constructor Details
-
DirectoryImporter
-
-
Method Details
-
findUserToGroupMemberships
public Collection<MembershipDTO> findUserToGroupMemberships(Configuration configuration) throws ImporterException Will locate and build a collection ofMembershipDTO
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 ofMembershipDTO
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
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
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
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
Description copied from interface:Importer
Responsible for the import of both users and groups into Crowd using the givenConfiguration
- Specified by:
importUsersGroupsAndMemberships
in interfaceImporter
- 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
Description copied from interface:Importer
Some sources might be capable of handling more than one directory.- Specified by:
supportsMultipleDirectories
in interfaceImporter
- Parameters:
configuration
- the Importer Configuration- Returns:
- true if the source can have multiple directories.
-
retrieveRemoteSourceDirectory
Description copied from interface:Importer
The retrieve the set of remote source directories.- Specified by:
retrieveRemoteSourceDirectory
in interfaceImporter
- Parameters:
configuration
- the import configuration.- Returns:
- the set of source directories.
-