com.atlassian.jira.util
Class BugzillaImportBean

java.lang.Object
  extended by com.atlassian.jira.util.BugzillaImportBean

public class BugzillaImportBean
extends java.lang.Object


Nested Class Summary
static class BugzillaImportBean.DefaultBugzillaMappingBean
           
 
Constructor Summary
BugzillaImportBean(IssueIndexManager indexManager, org.ofbiz.core.entity.GenericDelegator genericDelegator, ProjectManager projectManager, PermissionSchemeManager permissionSchemeManager, CacheManager cacheManager, VersionManager versionManager, VoteManager voteManager, ProjectComponentManager projectComponentManager, CustomFieldManager customFieldManager, IssueManager issueManager, AttachmentManager attachmentManager)
           
 
Method Summary
 java.lang.String commaSeparate(java.util.Collection coll)
          Returns comma-separated text values of a list of objects.
 void create(com.atlassian.jira.util.BugzillaImportBean.BugzillaMappingBean bugzillaMappingBean, BugzillaConnectionBean connectionBean, boolean enableNotifications, boolean reuseExistingUsers, boolean onlyNewIssues, boolean reindex, java.lang.String[] projectNames, com.opensymphony.user.User importer)
          Main method of this bean.
static java.util.List getAllBugzillaProjects(BugzillaConnectionBean connectionBean)
           
 java.lang.String getFullNameFromEmail(java.lang.String email)
           
 java.lang.String getImportLog()
           
 java.lang.String getProjectKey(java.lang.String name)
           
 java.lang.String getProjectList(java.lang.String[] projectNames)
          Generate SQL-friendly quoted comma-separated list of projects.
static boolean isOldBugzilla(java.sql.Connection conn)
          By examining the schema, determines if we're importing from <=2.16 or 2.17+
protected  java.util.Map retrieveImportedIssues()
          Return a map of bugzillaKey (Integer) -> Jira Issues Id (Integer).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BugzillaImportBean

public BugzillaImportBean(IssueIndexManager indexManager,
                          org.ofbiz.core.entity.GenericDelegator genericDelegator,
                          ProjectManager projectManager,
                          PermissionSchemeManager permissionSchemeManager,
                          CacheManager cacheManager,
                          VersionManager versionManager,
                          VoteManager voteManager,
                          ProjectComponentManager projectComponentManager,
                          CustomFieldManager customFieldManager,
                          IssueManager issueManager,
                          AttachmentManager attachmentManager)
Method Detail

create

public void create(com.atlassian.jira.util.BugzillaImportBean.BugzillaMappingBean bugzillaMappingBean,
                   BugzillaConnectionBean connectionBean,
                   boolean enableNotifications,
                   boolean reuseExistingUsers,
                   boolean onlyNewIssues,
                   boolean reindex,
                   java.lang.String[] projectNames,
                   com.opensymphony.user.User importer)
            throws java.lang.Exception,
                   IndexException,
                   org.ofbiz.core.entity.GenericEntityException
Main method of this bean. Creates JIRA projects mirroring those found in a Bugzilla database.

Parameters:
bugzillaMappingBean - Mappings from Bugzilla to JIRA, including project key, statuses, etc
enableNotifications - Whether to send email notifications for newly created issues
reuseExistingUsers - Do we try to reuse existing users, or create a unique user for every Bugzilla user?
onlyNewIssues - Should we only import issues that haven't previously been imported (to avoid duplicates)?
reindex - Whether to reindex after the import
projectNames - Array of Bugzilla project names to import
importer -
Throws:
java.lang.Exception
IndexException
org.ofbiz.core.entity.GenericEntityException

getProjectList

public java.lang.String getProjectList(java.lang.String[] projectNames)
Generate SQL-friendly quoted comma-separated list of projects.


retrieveImportedIssues

protected java.util.Map retrieveImportedIssues()
                                        throws org.ofbiz.core.entity.GenericEntityException
Return a map of bugzillaKey (Integer) -> Jira Issues Id (Integer).

It does this by looking through the change items for the bugzilla import key.

Throws:
org.ofbiz.core.entity.GenericEntityException

commaSeparate

public java.lang.String commaSeparate(java.util.Collection coll)
Returns comma-separated text values of a list of objects.


getProjectKey

public java.lang.String getProjectKey(java.lang.String name)
                               throws org.ofbiz.core.entity.GenericEntityException
Throws:
org.ofbiz.core.entity.GenericEntityException

getFullNameFromEmail

public java.lang.String getFullNameFromEmail(java.lang.String email)

isOldBugzilla

public static boolean isOldBugzilla(java.sql.Connection conn)
                             throws java.sql.SQLException
By examining the schema, determines if we're importing from <=2.16 or 2.17+

Throws:
java.sql.SQLException

getImportLog

public java.lang.String getImportLog()

getAllBugzillaProjects

public static java.util.List getAllBugzillaProjects(BugzillaConnectionBean connectionBean)
                                             throws java.sql.SQLException
Throws:
java.sql.SQLException


Copyright © 2002-2006 Atlassian. All Rights Reserved.