public class

DefaultDataImportService

extends Object
implements DataImportService
java.lang.Object
   ↳ com.atlassian.jira.bc.dataimport.DefaultDataImportService

Summary

Public Constructors
DefaultDataImportService(DataImportProductionDependencies dependencies, PermissionManager permissionManager, JiraHome jiraHome, JiraLicenseUpdaterService jiraLicenseService, I18nHelper.BeanFactory beanFactory, OfBizDelegator ofBizDelegator, LicenseStringFactory licenseStringFactory, IndexPathManager indexPathManager, AttachmentPathManager attachmentPathManager, ExternalLinkUtil externalLinkUtil, ApplicationProperties applicationProperties, BuildUtilsInfo buildUtilsInfo, TaskManager taskManager, MailQueue mailQueue, ComponentFactory factory, BuildVersionRegistry buildVersionRegistry, EventExecutorFactory eventExecutorFactory, JiraProperties jiraSystemProperties)
Public Methods
DataImportService.ImportResult doImport(User loggedInUser, DataImportService.ImportValidationResult result, TaskProgressSink taskProgressSink)
Performs the actual import given a valid validation result.
DataImportService.ImportValidationResult validateImport(User loggedInUser, DataImportParams params)
Given the currently loggedInUser and import params this method does some basic validation of the input.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.bc.dataimport.DataImportService

Public Constructors

public DefaultDataImportService (DataImportProductionDependencies dependencies, PermissionManager permissionManager, JiraHome jiraHome, JiraLicenseUpdaterService jiraLicenseService, I18nHelper.BeanFactory beanFactory, OfBizDelegator ofBizDelegator, LicenseStringFactory licenseStringFactory, IndexPathManager indexPathManager, AttachmentPathManager attachmentPathManager, ExternalLinkUtil externalLinkUtil, ApplicationProperties applicationProperties, BuildUtilsInfo buildUtilsInfo, TaskManager taskManager, MailQueue mailQueue, ComponentFactory factory, BuildVersionRegistry buildVersionRegistry, EventExecutorFactory eventExecutorFactory, JiraProperties jiraSystemProperties)

Public Methods

public DataImportService.ImportResult doImport (User loggedInUser, DataImportService.ImportValidationResult result, TaskProgressSink taskProgressSink)

Performs the actual import given a valid validation result. This method is slow! It performs the majority of the tasks outlined in the interface definition. Note that the method will be sped up by setting the system property jira.dangermode to "true" BUT WARNING, if you do this and the import fails, JIRA may be left in an unusable state which is why this method is only provided for speeding up import operations in the context of automated testing.

Parameters
loggedInUser The currently logged in user (may be null during setup)
result A valid validation result containing the DataImportParams provided
taskProgressSink A task progress counter that can be used to indicate how much longer the import has to go. if no progress needs to be recorded simply provide a NULL_SINK
Returns
  • The import result potentially containing an errorcollection and more specific overall error result

public DataImportService.ImportValidationResult validateImport (User loggedInUser, DataImportParams params)

Given the currently loggedInUser and import params this method does some basic validation of the input. This method returns quickly. It does *not* parse the entire XML file. It can be used to check that the user has entered all the required input correctly for the front-end.

In particular this method checks if the user has systemadmin permission. If this method is called from Setup (as indicated by the DataImportParams) the permission check is skipped. Further it will validate that the import xml file exists and verify that the license is valid (if one was provided).

Parameters
loggedInUser The currently logged in user (may be null during setup)
params The DataImportParams contain information provided by the user during import or setup
Returns
  • A validation result with the input as well as any errors.