com.atlassian.crowd.importer.importers
Class JdbcImporter

java.lang.Object
  extended by com.atlassian.crowd.importer.importers.BaseImporter
      extended by com.atlassian.crowd.importer.importers.JdbcImporter
All Implemented Interfaces:
Importer
Direct Known Subclasses:
BambooImporter, ConfluenceHibernateImporter, ConfluenceOSUserImporter, JiraImporter

public abstract class JdbcImporter
extends BaseImporter
implements Importer

General JDBC class that handles the fetching of users, groups and memberships. Subclasses of this class implement Mappers and SQL to retrieve users, groups and memberships


Field Summary
protected  org.springframework.jdbc.core.JdbcOperations jdbcTemplate
           
protected  PasswordGenerator passwordGenerator
           
 
Fields inherited from class com.atlassian.crowd.importer.importers.BaseImporter
directoryManager, logger
 
Constructor Summary
JdbcImporter(DirectoryManager directoryManager, PasswordGenerator passwordGenerator)
           
 
Method Summary
 java.util.List<GroupMembership> findGroupMemberships(Configuration configuration)
          Will locate and build a collection of GroupMembership objects based on the passed in Configuration
 java.util.Collection<RemoteGroup> findGroups(Configuration configuration)
          Will locate and build a collection of RemoteGroup objects based on the passed in Configuration
 java.util.Collection<RoleMembership> findRoleMemberships(Configuration configuration)
          Will locate and build a collection of RoleMembership objects based on the passed in Configuration
 java.util.Collection<RemoteRole> findRoles(Configuration configuration)
          Will locate and build a collection of RemoteRole objects based on the passed in Configuration
 java.util.List<RemotePrincipal> findUsers(Configuration configuration)
          Will locate and build a collection of RemotePrincipal objects based on the passed in Configuration
 java.lang.Class getConfigurationType()
          The type of configuration being used for this Import.
abstract  org.springframework.jdbc.core.RowMapper getGroupMapper()
           
abstract  org.springframework.jdbc.core.RowMapper getMembershipMapper()
           
abstract  java.lang.String getSelectAllGroupsSQL()
           
abstract  java.lang.String getSelectAllUserGroupMembershipsSQL()
           
abstract  java.lang.String getSelectAllUsersSQL()
           
abstract  org.springframework.jdbc.core.RowMapper getUserMapper(java.lang.Boolean setPassword, PasswordGenerator passwordGenerator)
           
 void init(Configuration configuration)
          Initialise anything required for the import process.
 void setJdbcTemplate(org.springframework.jdbc.core.JdbcOperations jdbcTemplate)
           
 
Methods inherited from class com.atlassian.crowd.importer.importers.BaseImporter
importPrincipalGroupMemberships, importPrincipalRoleMemberships, importRemoteGroups, importRemotePrincipals, importRemoteRoles, importUsersGroupsAndRoles
 
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
importUsersGroupsAndRoles
 

Field Detail

jdbcTemplate

protected org.springframework.jdbc.core.JdbcOperations jdbcTemplate

passwordGenerator

protected PasswordGenerator passwordGenerator
Constructor Detail

JdbcImporter

public JdbcImporter(DirectoryManager directoryManager,
                    PasswordGenerator passwordGenerator)
Method Detail

getSelectAllUserGroupMembershipsSQL

public abstract java.lang.String getSelectAllUserGroupMembershipsSQL()

getMembershipMapper

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

getSelectAllGroupsSQL

public abstract java.lang.String getSelectAllGroupsSQL()

getGroupMapper

public abstract org.springframework.jdbc.core.RowMapper getGroupMapper()

getSelectAllUsersSQL

public abstract java.lang.String getSelectAllUsersSQL()

getUserMapper

public abstract org.springframework.jdbc.core.RowMapper getUserMapper(java.lang.Boolean setPassword,
                                                                      PasswordGenerator passwordGenerator)

findGroups

public java.util.Collection<RemoteGroup> findGroups(Configuration configuration)
Description copied from interface: Importer
Will locate and build a collection of RemoteGroup objects based on the passed in Configuration

Specified by:
findGroups in interface Importer
Parameters:
configuration - the configuration that contains the directory to import the groups too
Returns:
int the number of groups imported

findGroupMemberships

public java.util.List<GroupMembership> findGroupMemberships(Configuration configuration)
Description copied from interface: Importer
Will locate and build a collection of GroupMembership objects based on the passed in Configuration

Specified by:
findGroupMemberships in interface Importer
Parameters:
configuration - the Importer Configuration
Returns:
a collection of GroupMemberships to be imported or Collections.EMPTY_LIST

findUsers

public java.util.List<RemotePrincipal> findUsers(Configuration configuration)
Description copied from interface: Importer
Will locate and build a collection of RemotePrincipal objects based on the passed in Configuration

Specified by:
findUsers in interface Importer
Parameters:
configuration - the Importer Configuration
Returns:
a collection of RemotePrincipals to be imported or Collections.EMPTY_LIST

findRoleMemberships

public java.util.Collection<RoleMembership> findRoleMemberships(Configuration configuration)
                                                         throws ImporterException
Description copied from interface: Importer
Will locate and build a collection of RoleMembership objects based on the passed in Configuration

Specified by:
findRoleMemberships in interface Importer
Parameters:
configuration - the Importer Configuration
Returns:
a collection of RoleMembership's to be imported or Collections.EMPTY_LIST
Throws:
ImporterException - if there is an error finding role memberships

findRoles

public java.util.Collection<RemoteRole> findRoles(Configuration configuration)
                                           throws ImporterException
Description copied from interface: Importer
Will locate and build a collection of RemoteRole objects based on the passed in Configuration

Specified by:
findRoles in interface Importer
Parameters:
configuration - the Importer Configuration
Returns:
a collection of RemoteRoles to be imported or Collections.EMPTY_LIST
Throws:
ImporterException - if there is an error finding the RemoteRoles

getConfigurationType

public java.lang.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)


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.