Package com.atlassian.jira.bc.dataimport
Class DefaultDataImportService
java.lang.Object
com.atlassian.jira.bc.dataimport.DefaultDataImportService
- All Implemented Interfaces:
DataImportService
- Since:
- 4.4
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.jira.bc.dataimport.DataImportService
DataImportService.ImportError, DataImportService.ImportResult, DataImportService.ImportValidationResult
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultDataImportService
(DataImportProductionDependencies dependencies, GlobalPermissionManager permissionManager, FileStores fileStores, JiraLicenseUpdaterService jiraLicenseService, I18nHelper.BeanFactory beanFactory, OfBizDelegator ofBizDelegator, ExternalLinkUtil externalLinkUtil, ApplicationProperties applicationProperties, BuildUtilsInfo buildUtilsInfo, TaskManager taskManager, ServiceManager serviceManager, com.atlassian.mail.queue.MailQueue mailQueue, ComponentFactory factory, DbConnectionManager dbConnectionManager, com.atlassian.event.spi.EventExecutorFactory eventExecutorFactory, JiraProperties jiraSystemProperties, ReindexRequestManager reindexRequestManager, ClusterManager clusterManager, UpgradeConstraints upgradeConstraints, DataImportPropertiesValidationService propertiesValidationService, OfbizImportHandlerFactory ofbizImportHandlerFactory, UpgradeVersionHistoryManager upgradeVersionHistoryManager) -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkClusterNotActive
(ErrorCollection errors, I18nHelper i18n) doImport
(ApplicationUser loggedInUser, DataImportService.ImportValidationResult result, TaskProgressSink taskProgressSink) Performs the actual import given a valid validation result.validateImport
(ApplicationUser loggedInUser, DataImportParams params) Given the currently loggedInUser and import params this method does some basic validation of the input.
-
Constructor Details
-
DefaultDataImportService
public DefaultDataImportService(DataImportProductionDependencies dependencies, GlobalPermissionManager permissionManager, FileStores fileStores, JiraLicenseUpdaterService jiraLicenseService, I18nHelper.BeanFactory beanFactory, OfBizDelegator ofBizDelegator, ExternalLinkUtil externalLinkUtil, ApplicationProperties applicationProperties, BuildUtilsInfo buildUtilsInfo, TaskManager taskManager, ServiceManager serviceManager, com.atlassian.mail.queue.MailQueue mailQueue, ComponentFactory factory, DbConnectionManager dbConnectionManager, com.atlassian.event.spi.EventExecutorFactory eventExecutorFactory, JiraProperties jiraSystemProperties, ReindexRequestManager reindexRequestManager, ClusterManager clusterManager, UpgradeConstraints upgradeConstraints, DataImportPropertiesValidationService propertiesValidationService, OfbizImportHandlerFactory ofbizImportHandlerFactory, UpgradeVersionHistoryManager upgradeVersionHistoryManager)
-
-
Method Details
-
validateImport
public DataImportService.ImportValidationResult validateImport(ApplicationUser loggedInUser, DataImportParams params) Description copied from interface:DataImportService
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 sysadmin 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 pasted license is valid (if one was provided).
- Specified by:
validateImport
in interfaceDataImportService
- Parameters:
loggedInUser
- The currently logged in user (may be null during setup)params
- TheDataImportParams
contain information provided by the user during import or setup- Returns:
- A validation result with the input as well as any errors.
-
checkClusterNotActive
-
doImport
public DataImportService.ImportResult doImport(ApplicationUser loggedInUser, DataImportService.ImportValidationResult result, TaskProgressSink taskProgressSink) Description copied from interface:DataImportService
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.- Specified by:
doImport
in interfaceDataImportService
- Parameters:
loggedInUser
- The currently logged in user (may be null during setup)result
- A valid validation result containing theDataImportParams
providedtaskProgressSink
- 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 aTaskProgressSink.NULL_SINK
- Returns:
- The import result potentially containing an errorcollection and more specific overall error result
-