|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.bc.project.version.DefaultVersionService
public class DefaultVersionService
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.atlassian.jira.bc.project.version.VersionService |
---|
VersionService.AbstractVersionResult, VersionService.ArchiveVersionValidationResult, VersionService.CreateVersionValidationResult, VersionService.ReleaseVersionValidationResult, VersionService.ValidationResult, VersionService.VersionAction, VersionService.VersionResult, VersionService.VersionsResult |
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,
OutlookDateManager outlookDateManager)
|
Method Summary | |
---|---|
Version |
archiveVersion(VersionService.ArchiveVersionValidationResult result)
Takes a validation result and performs the archive operation. |
Version |
createVersion(User user,
VersionService.CreateVersionValidationResult request)
Using the validation result from VersionService.validateCreateVersion(com.opensymphony.user.User, com.atlassian.jira.project.Project,
String, String, String, Long) a new version will be created. |
void |
delete(JiraServiceContext context,
VersionService.ValidationResult result)
Deletes a version from a project. |
VersionService.VersionResult |
getVersionById(User user,
Project project,
Long versionId)
Used to retrieve a Version object by version id within project
specified by Project object. |
VersionService.VersionResult |
getVersionByProjectAndName(User user,
Project project,
String versionName)
Used to retrieve a Version object by version name within project
specified by Project object. |
VersionService.VersionsResult |
getVersionsByProject(User user,
Project project)
Used to retrieve a Version collection within project
specified by Project object. |
void |
merge(JiraServiceContext context,
VersionService.ValidationResult result)
Merges a version into another, then removes the original version. |
Version |
releaseVersion(VersionService.ReleaseVersionValidationResult result)
Using the validation result from VersionService.validateReleaseVersion(com.opensymphony.user.User,
com.atlassian.jira.project.version.Version, Date) a version will be released. |
Version |
unarchiveVersion(VersionService.ArchiveVersionValidationResult result)
Takes a validation result and performs the unarchive operation. |
Version |
unreleaseVersion(VersionService.ReleaseVersionValidationResult result)
Using the validation result from VersionService.validateUnreleaseVersion(com.opensymphony.user.User,
com.atlassian.jira.project.version.Version, Date) a version will be unreleased. |
VersionService.ArchiveVersionValidationResult |
validateArchiveVersion(User user,
Version version)
This method should be called before archiving a version. |
VersionService.CreateVersionValidationResult |
validateCreateVersion(User user,
Project project,
String versionName,
String releaseDate,
String description,
Long scheduleAfterVersion)
This method needs to be called before creating a version to ensure all parameters are correct. |
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 |
VersionService.ReleaseVersionValidationResult |
validateReleaseVersion(User user,
Version version,
Date releaseDate)
This method needs to be called before releasing a version to ensure all parameters are correct. |
VersionService.ArchiveVersionValidationResult |
validateUnarchiveVersion(User user,
Version version)
This method should be called before unarchiving a version. |
VersionService.ReleaseVersionValidationResult |
validateUnreleaseVersion(User user,
Version version,
Date releaseDate)
This method needs to be called before unreleasing a version to ensure all parameters are correct. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultVersionService(VersionManager versionManager, PermissionManager permissionManager, IssueManager issueManager, CacheManager cacheManager, IssueIndexManager issueIndexManager, IssueFactory issueFactory, OutlookDateManager outlookDateManager)
Method Detail |
---|
public VersionService.VersionResult getVersionById(User user, Project project, Long versionId)
VersionService
Version
object by version id within project
specified by Project
object.
This method returns a VersionService.VersionResult
.
The version will be null if no version for the id specified can be found, or if the user making the request
does not have the ADMIN, PROJECT_ADMIN or BROWSE project permission for the project.
In both of these cases, the errorCollection in the result object will contain an appropriate error message.
getVersionById
in interface VersionService
user
- The user trying to get a versionproject
- The project object containing requested versionversionId
- The id of requested version
public VersionService.VersionResult getVersionByProjectAndName(User user, Project project, String versionName)
VersionService
Version
object by version name within project
specified by Project
object.
This method returns a VersionService.VersionResult
.
The version will be null if no version for the versionName specified can be found, or if the user making the request
does not have the ADMIN, PROJECT_ADMIN or BROWSE project permission for the project.
In both of these cases, the errorCollection in the result object will contain an appropriate error message.
getVersionByProjectAndName
in interface VersionService
user
- The user trying to get a versionproject
- The project object containing requested versionversionName
- The name of requested version
public VersionService.VersionsResult getVersionsByProject(User user, Project project)
VersionService
Version
collection within project
specified by Project
object.
This method returns a VersionService.VersionsResult
.
The versions collection will be empty if the user making the request
does not have the ADMIN, PROJECT_ADMIN or BROWSE project permission for the project.
In this case, the errorCollection in the result object will contain an appropriate error message.
getVersionsByProject
in interface VersionService
user
- The user trying to get a versionproject
- The project object containing requested version
public VersionService.ValidationResult validateDelete(JiraServiceContext context, Long versionId, VersionService.VersionAction affectsAction, VersionService.VersionAction fixAction)
VersionService
validateDelete
in interface VersionService
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
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
public void delete(JiraServiceContext context, VersionService.ValidationResult result)
VersionService
delete
in interface VersionService
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 fieldspublic VersionService.ValidationResult validateMerge(JiraServiceContext context, Long versionId, Long swapVersionId)
validateMerge
in interface VersionService
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.
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
public void merge(JiraServiceContext context, VersionService.ValidationResult result)
VersionService
merge
in interface VersionService
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 fieldspublic VersionService.CreateVersionValidationResult validateCreateVersion(User user, Project project, String versionName, String releaseDate, String description, Long scheduleAfterVersion)
VersionService
VersionService.CreateVersionValidationResult
which contains an ErrorCollection with any potential errors and all the version's details.
validateCreateVersion
in interface VersionService
user
- The user trying to create a versionproject
- The project object containing requested versionversionName
- The name of created versionreleaseDate
- The release date for a version (optional)description
- The description for a version (optional)scheduleAfterVersion
- The version after which created version should be scheduled (optional)
public Version createVersion(User user, VersionService.CreateVersionValidationResult request)
VersionService
VersionService.validateCreateVersion(com.opensymphony.user.User, com.atlassian.jira.project.Project,
String, String, String, Long)
a new version will be created. This method will throw an RuntimeException if
the version could not be created.
createVersion
in interface VersionService
user
- The user trying to get a versionrequest
- The VersionService.CreateVersionValidationResult
object
containg all required data
public VersionService.ReleaseVersionValidationResult validateReleaseVersion(User user, Version version, Date releaseDate)
VersionService
VersionService.ReleaseVersionValidationResult
which contains an ErrorCollection with any potential errors and all the version's details.
validateReleaseVersion
in interface VersionService
user
- The user trying to release a versionversion
- The version to releasereleaseDate
- The version release date (optional)
public VersionService.ReleaseVersionValidationResult validateUnreleaseVersion(User user, Version version, Date releaseDate)
VersionService
VersionService.ReleaseVersionValidationResult
which contains an ErrorCollection with any potential errors and all the version's details.
validateUnreleaseVersion
in interface VersionService
user
- The user trying to unrelease a versionversion
- The version to releasereleaseDate
- The version release date (optional)
public VersionService.ArchiveVersionValidationResult validateArchiveVersion(User user, Version version)
VersionService
validateArchiveVersion
in interface VersionService
user
- The user performing this operationversion
- The version to be archived
public VersionService.ArchiveVersionValidationResult validateUnarchiveVersion(User user, Version version)
VersionService
validateUnarchiveVersion
in interface VersionService
user
- The user performing this operationversion
- The version to be archived
public Version releaseVersion(VersionService.ReleaseVersionValidationResult result)
VersionService
VersionService.validateReleaseVersion(com.opensymphony.user.User,
com.atlassian.jira.project.version.Version, Date)
a version will be released.
This method will throw an IllegalArgumentException if the provied data are invalid and version could not be released.
releaseVersion
in interface VersionService
result
- a ReleaseVersionValidationResult containg required data
public Version unreleaseVersion(VersionService.ReleaseVersionValidationResult result)
VersionService
VersionService.validateUnreleaseVersion(com.opensymphony.user.User,
com.atlassian.jira.project.version.Version, Date)
a version will be unreleased.
This method will throw an IllegalArgumentException if the provied data are invalid and version could not be unreleased.
unreleaseVersion
in interface VersionService
result
- a ReleaseVersionValidationResult containg required data
public Version archiveVersion(VersionService.ArchiveVersionValidationResult result)
VersionService
archiveVersion
in interface VersionService
result
- The result from the validation
public Version unarchiveVersion(VersionService.ArchiveVersionValidationResult result)
VersionService
unarchiveVersion
in interface VersionService
result
- The result from the validation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |