com.atlassian.jira.imports.project.validation
Class StatusMapperValidatorImpl

java.lang.Object
  extended by com.atlassian.jira.imports.project.validation.StatusMapperValidatorImpl
All Implemented Interfaces:
StatusMapperValidator

public class StatusMapperValidatorImpl
extends Object
implements StatusMapperValidator

Since:
v3.13

Constructor Summary
StatusMapperValidatorImpl(ProjectManager projectManager, ConstantsManager constantsManager, WorkflowManager workflowManager)
           
 
Method Summary
 boolean isStatusValid(String oldStatusId, Status existingStatus, StatusMapper statusMapper, IssueTypeMapper issueTypeMapper, String projectKey)
          Determines if a Status is valid within the context of the provided project and the provided issue types.
 MessageSet validateMappings(I18nHelper i18nHelper, BackupProject backupProject, IssueTypeMapper issueTypeMapper, StatusMapper statusMapper)
          Makes sure that the statuses that are required: exist in the current instance are valid for the issue type registered based on the workflow associated with the project being restored
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatusMapperValidatorImpl

public StatusMapperValidatorImpl(ProjectManager projectManager,
                                 ConstantsManager constantsManager,
                                 WorkflowManager workflowManager)
Method Detail

validateMappings

public MessageSet validateMappings(I18nHelper i18nHelper,
                                   BackupProject backupProject,
                                   IssueTypeMapper issueTypeMapper,
                                   StatusMapper statusMapper)
Description copied from interface: StatusMapperValidator
Makes sure that the statuses that are required:

Specified by:
validateMappings in interface StatusMapperValidator
Parameters:
i18nHelper - helper bean that allows us to get i18n translations
backupProject - is the backup project the data is mapped from
issueTypeMapper - is the populated issueTypeMapper
statusMapper - is the populated statusMapper
Returns:
a MessageSet that will contain any generated errors (which should stop the import) or warnings (which should be displayed to the user). The error and warning collection's will be empty if all validation passes.

isStatusValid

public boolean isStatusValid(String oldStatusId,
                             Status existingStatus,
                             StatusMapper statusMapper,
                             IssueTypeMapper issueTypeMapper,
                             String projectKey)
Description copied from interface: StatusMapperValidator
Determines if a Status is valid within the context of the provided project and the provided issue types.

Specified by:
isStatusValid in interface StatusMapperValidator
Parameters:
oldStatusId - the status id from the backup file
existingStatus - the status object from the new system that may map to the old status, this can be null
statusMapper - the status mapper that will provide a list of the associated issue type for the status
issueTypeMapper - the fully mapped and populated issueTypeMapper that will allow us to map the backup issue types to existing issue types.
projectKey - the project key that will allow us to find the correct workflow scheme for the project we are importing into
Returns:
true if the status is valid for the project and issue types, false otherwise


Copyright © 2002-2008 Atlassian. All Rights Reserved.