com.atlassian.greenhopper.service.version
Interface VersionService

All Known Implementing Classes:
VersionServiceImpl

public interface VersionService

Wrapper for JIRA's services / managers dealing with versions. Mainly here to shield the rest of the service world from horrible implementation details.

Author:
ahennecke

Method Summary
 ServiceOutcome<java.lang.Void> addIssueToVersion(com.atlassian.crowd.embedded.api.User user, com.atlassian.jira.issue.Issue issue, com.atlassian.jira.project.version.Version version)
          Adds the issue to the version.
 ServiceOutcome<com.atlassian.jira.util.lang.Pair<com.atlassian.jira.project.Project,com.atlassian.jira.project.version.Version>> createVersion(com.atlassian.crowd.embedded.api.User user, com.atlassian.jira.project.Project project, java.lang.String name, java.lang.String description, java.util.Date releaseDate, java.util.Date startDate)
          Creates a single project version.
 ServiceOutcome<com.atlassian.jira.util.lang.Pair<com.atlassian.jira.project.Project,com.atlassian.jira.project.version.Version>> createVersion(com.atlassian.crowd.embedded.api.User user, com.atlassian.jira.project.Project project, java.lang.String name, java.lang.String description, org.joda.time.DateMidnight releaseDate)
          Creates a single project version.
 ServiceOutcome<java.util.Map<com.atlassian.jira.project.Project,com.atlassian.jira.project.version.Version>> createVersions(com.atlassian.crowd.embedded.api.User user, java.util.Collection<com.atlassian.jira.project.Project> projects, java.lang.String name, java.lang.String description, org.joda.time.DateMidnight releaseDate)
          Build a version out of the given parameters and create it.
 ServiceOutcome<com.atlassian.jira.project.version.Version> get(com.atlassian.crowd.embedded.api.User user, java.lang.Long versionId)
          Get the specified version and return an error if it is not found.
 VersionMetaData getMetaData(com.atlassian.jira.project.version.Version version)
          Get the meta data associated to this version.
 ServiceOutcome<java.lang.Void> releaseVersions(com.atlassian.crowd.embedded.api.User user, java.util.Collection<com.atlassian.jira.project.version.Version> versions, org.joda.time.DateMidnight releaseDate)
          Release the given versions.
 ServiceOutcome<java.lang.Void> setFixVersions(com.atlassian.crowd.embedded.api.User user, com.atlassian.jira.issue.Issue issue, java.util.Collection<com.atlassian.jira.project.version.Version> versions)
          Sets a collection of versions onto an issue.
 ServiceOutcome<java.lang.Void> updateVersion(com.atlassian.crowd.embedded.api.User user, java.lang.Long versionId, java.lang.String versionName, java.lang.String versionDescription, java.util.Date releaseDate, java.util.Date startDate)
          Update the version with the specified parameters.
 

Method Detail

createVersions

ServiceOutcome<java.util.Map<com.atlassian.jira.project.Project,com.atlassian.jira.project.version.Version>> createVersions(com.atlassian.crowd.embedded.api.User user,
                                                                                                                            java.util.Collection<com.atlassian.jira.project.Project> projects,
                                                                                                                            java.lang.String name,
                                                                                                                            java.lang.String description,
                                                                                                                            org.joda.time.DateMidnight releaseDate)
Build a version out of the given parameters and create it. Will do lots of validation, permission checking etc. internally. If the validation fails for one of the projects, no versions will be created.

Parameters:
releaseDate - : optional
Returns:
a map of the newly created versions, or an error if something went wrong.

createVersion

ServiceOutcome<com.atlassian.jira.util.lang.Pair<com.atlassian.jira.project.Project,com.atlassian.jira.project.version.Version>> createVersion(com.atlassian.crowd.embedded.api.User user,
                                                                                                                                               com.atlassian.jira.project.Project project,
                                                                                                                                               java.lang.String name,
                                                                                                                                               java.lang.String description,
                                                                                                                                               org.joda.time.DateMidnight releaseDate)
Creates a single project version. Uses createVersions(com.atlassian.crowd.embedded.api.User, java.util.Collection, String, String, org.joda.time.DateMidnight)

Parameters:
releaseDate - : optional
Returns:
a map of the newly created version, or an error if something went wrong.

createVersion

ServiceOutcome<com.atlassian.jira.util.lang.Pair<com.atlassian.jira.project.Project,com.atlassian.jira.project.version.Version>> createVersion(com.atlassian.crowd.embedded.api.User user,
                                                                                                                                               com.atlassian.jira.project.Project project,
                                                                                                                                               java.lang.String name,
                                                                                                                                               java.lang.String description,
                                                                                                                                               java.util.Date releaseDate,
                                                                                                                                               java.util.Date startDate)
Creates a single project version. Uses createVersions(com.atlassian.crowd.embedded.api.User, java.util.Collection, String, String, org.joda.time.DateMidnight)

Parameters:
releaseDate - : optional
Returns:
a map of the newly created version, or an error if something went wrong.

addIssueToVersion

ServiceOutcome<java.lang.Void> addIssueToVersion(com.atlassian.crowd.embedded.api.User user,
                                                 com.atlassian.jira.issue.Issue issue,
                                                 com.atlassian.jira.project.version.Version version)
Adds the issue to the version. Technically, add the version to the already existing fixVersions of the issue field. Does not overwrite existing fixVersions. Does not do anything if the issue is already in that version. Checks for permissions and all.

Returns:
errors that might have occurred

setFixVersions

ServiceOutcome<java.lang.Void> setFixVersions(com.atlassian.crowd.embedded.api.User user,
                                              com.atlassian.jira.issue.Issue issue,
                                              java.util.Collection<com.atlassian.jira.project.version.Version> versions)
Sets a collection of versions onto an issue.

Returns:
errors that might have occurred

releaseVersions

ServiceOutcome<java.lang.Void> releaseVersions(com.atlassian.crowd.embedded.api.User user,
                                               java.util.Collection<com.atlassian.jira.project.version.Version> versions,
                                               org.joda.time.DateMidnight releaseDate)
Release the given versions. Validation and permission checking will be done. If one fails validation, none is released.

Parameters:
releaseDate - : optional
Returns:
errors that might have occurred

get

ServiceOutcome<com.atlassian.jira.project.version.Version> get(com.atlassian.crowd.embedded.api.User user,
                                                               java.lang.Long versionId)
Get the specified version and return an error if it is not found.

Parameters:
versionId -
Returns:

updateVersion

ServiceOutcome<java.lang.Void> updateVersion(com.atlassian.crowd.embedded.api.User user,
                                             java.lang.Long versionId,
                                             java.lang.String versionName,
                                             java.lang.String versionDescription,
                                             java.util.Date releaseDate,
                                             java.util.Date startDate)
Update the version with the specified parameters.

Parameters:
user -
versionId -
versionName -
versionDescription -
releaseDate -
startDate -
Returns:

getMetaData

@Nonnull
VersionMetaData getMetaData(@Nonnull
                                    com.atlassian.jira.project.version.Version version)
Get the meta data associated to this version.

Parameters:
version - the version; must not be null
Returns:
the meta data


Copyright © 2007-2014 Atlassian. All Rights Reserved.