com.atlassian.crowd.importer.importers
Class BambooImporter

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

public class BambooImporter
extends Object

Specific Bamboo Hibernate/Atlassian-User implementation


Field Summary
protected  DirectoryManager directoryManager
           
protected  org.springframework.jdbc.core.JdbcOperations jdbcTemplate
           
protected  org.slf4j.Logger logger
           
protected  PasswordHelper passwordHelper
           
 
Constructor Summary
BambooImporter(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.
 List<UserTemplateWithCredentialAndAttributes> findUsers(Configuration configuration)
          Will locate and build a collection of UserTemplate objects based on the passed in Configuration
 List<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.
 org.springframework.jdbc.core.RowMapper getGroupMapper(Configuration configuration)
           
 org.springframework.jdbc.core.RowMapper getMembershipMapper()
           
 String getSelectAllGroupsSQL()
           
 String getSelectAllUserGroupMembershipsSQL()
           
 String getSelectAllUsersSQL()
           
 org.springframework.jdbc.core.RowMapper getUserMapper(Configuration configuration, PasswordHelper passwordGenerator)
           
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.
 void setJdbcTemplate(org.springframework.jdbc.core.JdbcOperations jdbcTemplate)
           
 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
 
Methods inherited from interface com.atlassian.crowd.importer.importers.Importer
importUsersGroupsAndMemberships, retrieveRemoteSourceDirectory, supportsMultipleDirectories
 

Field Detail

jdbcTemplate

protected org.springframework.jdbc.core.JdbcOperations jdbcTemplate

passwordHelper

protected PasswordHelper passwordHelper

logger

protected final org.slf4j.Logger logger

directoryManager

protected final DirectoryManager directoryManager
Constructor Detail

BambooImporter

public BambooImporter(DirectoryManager directoryManager,
                      PasswordHelper passwordHelper)
Method Detail

getSelectAllGroupsSQL

public String getSelectAllGroupsSQL()

getSelectAllUsersSQL

public String getSelectAllUsersSQL()

getSelectAllUserGroupMembershipsSQL

public String getSelectAllUserGroupMembershipsSQL()

getGroupMapper

public org.springframework.jdbc.core.RowMapper getGroupMapper(Configuration configuration)

getMembershipMapper

public org.springframework.jdbc.core.RowMapper getMembershipMapper()

getUserMapper

public org.springframework.jdbc.core.RowMapper getUserMapper(Configuration configuration,
                                                             PasswordHelper passwordGenerator)

findGroups

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

Parameters:
configuration - the configuration that contains the directory to import the groups too
Returns:
int the number of groups imported

findUserToGroupMemberships

public List<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.

Parameters:
configuration - the Importer Configuration
Returns:
a collection of GroupMemberships to be imported or Collections.EMPTY_LIST

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

findUsers

public List<UserTemplateWithCredentialAndAttributes> findUsers(Configuration configuration)
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

getConfigurationType

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

Specified by:
getConfigurationType in interface Importer
Returns:
Class that should be a subclass of Configuration

init

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

Specified by:
init in interface Importer
Parameters:
configuration - can contain any setup params such as database settings that need init'ing

setJdbcTemplate

public void setJdbcTemplate(org.springframework.jdbc.core.JdbcOperations jdbcTemplate)

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 © 2013 Atlassian. All Rights Reserved.