com.atlassian.jira.bc.project.version
Class DefaultVersionService

java.lang.Object
  extended by com.atlassian.jira.bc.project.version.DefaultVersionService
All Implemented Interfaces:
VersionService

public class DefaultVersionService
extends Object
implements VersionService

Since:
v3.13

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.jira.bc.project.version.VersionService
VersionService.ValidationResult, VersionService.VersionAction
 
Field Summary
 
Fields inherited from interface com.atlassian.jira.bc.project.version.VersionService
REMOVE
 
Constructor Summary
DefaultVersionService(VersionManager versionManager, PermissionManager permissionManager, IssueManager issueManager, CacheManager cacheManager, IssueIndexManager issueIndexManager, IssueFactory issueFactory)
           
 
Method Summary
 void delete(JiraServiceContext context, VersionService.ValidationResult result)
          Deletes a version from a project.
 void merge(JiraServiceContext context, VersionService.ValidationResult result)
          Merges a version into another, then removes the original version.
 VersionService.ValidationResult validateDelete(JiraServiceContext context, Long versionId, VersionService.VersionAction affectsAction, VersionService.VersionAction fixAction)
          Validates an attempt to delete a version from a project.
 VersionService.ValidationResult validateMerge(JiraServiceContext context, Long versionId, Long swapVersionId)
          Implementation is the same as deleting, with the actions set to SWAP and the swapVersionId being passed as both Affects Version swap and Fix Version swap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultVersionService

public DefaultVersionService(VersionManager versionManager,
                             PermissionManager permissionManager,
                             IssueManager issueManager,
                             CacheManager cacheManager,
                             IssueIndexManager issueIndexManager,
                             IssueFactory issueFactory)
Method Detail

validateDelete

public VersionService.ValidationResult validateDelete(JiraServiceContext context,
                                                      Long versionId,
                                                      VersionService.VersionAction affectsAction,
                                                      VersionService.VersionAction fixAction)
Description copied from interface: VersionService
Validates an attempt to delete a version from a project. When deleting a version, we need to decide what to do with issues that reference the version in their Affects of Fix Version fields. The action taken is specified as a flag for each field.

Specified by:
validateDelete in interface VersionService
Parameters:
context - The context for this service call.
versionId - The id of the version to be deleted.
affectsAction - Used to decide whether to move all the issues to a different 'affects' version or just remove them. See VersionKeys.REMOVE_ACTION, VersionKeys.SWAP_ACTION
fixAction - Used to decide wether to move all the issues to a different 'fix' version or just remove them. See VersionKeys.REMOVE_ACTION, VersionKeys.SWAP_ACTION
Returns:
a VersionService.ValidationResult object which contains the version to delete, and the versions to swap to for Affects and Fix versions, or null if the action to be taken is VersionKeys.REMOVE_ACTION

delete

public void delete(JiraServiceContext context,
                   VersionService.ValidationResult result)
Description copied from interface: VersionService
Deletes a version from a project. When deleting a version, we need to decide what to do with issues that reference the version in their Affects of Fix Version fields. The action taken is specified as a flag for each field.

Specified by:
delete in interface VersionService
Parameters:
context - The context for this service call.
result - The result of validation, which contains the version to be deleted, and the swap versions for Affects and Fix fields

validateMerge

public VersionService.ValidationResult validateMerge(JiraServiceContext context,
                                                     Long versionId,
                                                     Long swapVersionId)
Implementation is the same as deleting, with the actions set to SWAP and the swapVersionId being passed as both Affects Version swap and Fix Version swap

Specified by:
validateMerge in interface VersionService
Parameters:
context - The context for this service call.
versionId - The original version to be merged and removed.
swapVersionId - The target version of the merge operation. Must be from the same project.
Returns:
a VersionService.ValidationResult object which contains the version to delete, and the versions to swap to for Affects and Fix versions, or null if the action to be taken is VersionKeys.REMOVE_ACTION

merge

public void merge(JiraServiceContext context,
                  VersionService.ValidationResult result)
Description copied from interface: VersionService
Merges a version into another, then removes the original version.

Specified by:
merge in interface VersionService
Parameters:
context - The context for this service call.
result - The result of validation, which contains the version to be deleted, and the swap versions for Affects and Fix fields


Copyright © 2002-2009 Atlassian. All Rights Reserved.