com.atlassian.jira.project.version
Interface VersionManager

All Known Implementing Classes:
DefaultVersionManager, MockVersionManager

@PublicApi
public interface VersionManager

Manager responsible for JIRA versions.


Field Summary
static String ALL_RELEASED_VERSIONS
          Used to retrieve all released versions
static String ALL_UNRELEASED_VERSIONS
          Used to retrieve all unreleased versions
static String NO_VERSIONS
          Used to represent empty version fields
 
Method Summary
 void archiveVersion(Version version, boolean archive)
          Archive/Un-archive a single version depending on the archive flag.
 void archiveVersions(String[] idsToArchive, String[] idsToUnarchive)
          Method used to archive and un-archive a number of versions.
 Version createVersion(String name, Date startDate, Date releaseDate, String description, Long projectId, Long scheduleAfterVersion)
          Creates a new Version object.
 Version createVersion(String name, Date releaseDate, String description, Long projectId, Long scheduleAfterVersion)
          Creates a new Version object.
 void decreaseVersionSequence(Version version)
          Move a version to have a higher sequence number - ie make it later
 void deleteVersion(Version version)
          Removes a specific version from the system.
 void editVersionDetails(Version version, String name, String description)
          Updates details of an existing version.
 void editVersionDetails(Version version, String name, String description, org.ofbiz.core.entity.GenericValue project)
          Deprecated. use editVersionDetails(Version, String, String) instead. since 5.0
 void editVersionReleaseDate(Version version, Date duedate)
          Update the release date of a version.
 void editVersionStartDate(Version version, Date startDate)
          Updates the start date of a version
 void editVersionStartReleaseDate(Version version, Date startDate, Date releaseDate)
          Updates the start and release date of a version
 Collection<Version> getAffectedVersionsByIssue(org.ofbiz.core.entity.GenericValue issue)
          Deprecated. use getAffectedVersionsFor(com.atlassian.jira.issue.Issue) instead. since 5.0
 Collection<Version> getAffectedVersionsFor(Issue issue)
          Get all affected versions of the specified issue.
 Collection<org.ofbiz.core.entity.GenericValue> getAffectsIssues(Version version)
          Deprecated. use getIssuesWithAffectsVersion(Version) instead. since 5.0
 Collection<org.ofbiz.core.entity.GenericValue> getAllAffectedIssues(Collection<Version> versions)
          Deprecated. use getIssuesWithAffectsVersion(Version) instead. since 5.0
 Collection<Version> getAllVersions()
           
 Collection<Version> getAllVersionsForProjects(Collection<Project> projects, boolean includeArchived)
          Returns all versions that belong to the passed projects.
 Collection<Version> getAllVersionsReleased(boolean includeArchived)
           
 Collection<Version> getAllVersionsUnreleased(boolean includeArchived)
           
 Collection<org.ofbiz.core.entity.GenericValue> getFixIssues(Version version)
          Deprecated. use getIssuesWithFixVersion(Version) instead. since 5.0
 Collection<Version> getFixVersionsByIssue(org.ofbiz.core.entity.GenericValue issue)
          Deprecated. use getFixVersionsFor(com.atlassian.jira.issue.Issue) instead. since 5.0
 Collection<Version> getFixVersionsFor(Issue issue)
          Get all fix for versions of the specified issue.
 Collection<Issue> getIssuesWithAffectsVersion(Version version)
          Return all the issues in which the affected version matches the specified version.
 Collection<Issue> getIssuesWithFixVersion(Version version)
          Return all the issues in which the fix for version matches the specified version.
 Collection<Version> getOtherUnarchivedVersions(Version version)
          Return all unarchived versions except this one
 Collection<Version> getOtherVersions(Version version)
          Return all other versions in the project except this one
 Version getVersion(Long id)
          Returns a single version.
 Version getVersion(Long projectId, String versionName)
          Search for a version by projectID and name.
 List<Version> getVersions(org.ofbiz.core.entity.GenericValue project)
          Deprecated. Use getVersions(Long) or getVersions(Project) instead. Since 2006.
 Collection<Version> getVersions(List<Long> ids)
          Return a collection of Versions matching the ids passed in.
 List<Version> getVersions(Long projectId)
          Return a list of Versions for the given project.
 List<Version> getVersions(Long projectId, boolean includeArchived)
          Return a list of Versions for the given project.
 List<Version> getVersions(Project project)
          Return a list of Versions for the given project.
 Collection<Version> getVersionsArchived(org.ofbiz.core.entity.GenericValue projectGV)
          Deprecated. Use getVersionsArchived(Project) instead. Since v5.0.
 Collection<Version> getVersionsArchived(Project project)
          Return all archived versions for a particular project.
 Collection<Version> getVersionsByName(String versionName)
          Return a collection of Versions that have the specified name.
 Collection<Version> getVersionsReleased(Long projectId, boolean includeArchived)
          Gets a list of released versions for a project.
 Collection<Version> getVersionsReleasedDesc(Long projectId, boolean includeArchived)
          Gets a list of released versions for a project in reverse order.
 Collection<Version> getVersionsUnarchived(Long projectId)
          Return all un-archived versions for a particular project
 Collection<Version> getVersionsUnreleased(Long projectId, boolean includeArchived)
          Gets a list of un-released versions for a particular project.
 void increaseVersionSequence(Version version)
          Move a version to have a lower sequence number - ie make it earlier
 boolean isDuplicateName(Version version, String name)
          Check that the version name we are changing to is not a duplicate.
 boolean isDuplicateName(Version version, String name, org.ofbiz.core.entity.GenericValue project)
          Deprecated. use isDuplicateName(Version, String) instead. since 5.0
 boolean isVersionOverDue(Version version)
          Checks to see if a version is overdue.
 void moveIssuesToNewVersion(List issues, Version currentVersion, Version swapToVersion)
          Swaps the list of issues supplied from one Fix version to another.
 void moveToEndVersionSequence(Version version)
          Move a version to the end of the version sequence
 void moveToStartVersionSequence(Version version)
          Move a version to the start of the version list
 void moveVersionAfter(Version version, Long scheduleAfterVersion)
          Move a version after another version
 void releaseVersion(Version version, boolean release)
          Used to release or unrelease a version, depending on the release flag.
 void releaseVersions(Collection<Version> versions, boolean release)
          Used to release versions depending on the release flag.
 Version update(Version version)
          Persists updates to the specified version object.
 

Field Detail

NO_VERSIONS

static final String NO_VERSIONS
Used to represent empty version fields

See Also:
Constant Field Values

ALL_UNRELEASED_VERSIONS

static final String ALL_UNRELEASED_VERSIONS
Used to retrieve all unreleased versions

See Also:
Constant Field Values

ALL_RELEASED_VERSIONS

static final String ALL_RELEASED_VERSIONS
Used to retrieve all released versions

See Also:
Constant Field Values
Method Detail

createVersion

Version createVersion(String name,
                      Date releaseDate,
                      String description,
                      Long projectId,
                      Long scheduleAfterVersion)
                      throws CreateException
Creates a new Version object.

Parameters:
name - the Name
releaseDate - date of release or null if not released.
description - the Description
projectId - the id of the Project of the version.
scheduleAfterVersion - id of the version after which this should be sequenced or null.
Returns:
the new Version.
Throws:
CreateException - If there was a problem creating the version.

createVersion

Version createVersion(String name,
                      Date startDate,
                      Date releaseDate,
                      String description,
                      Long projectId,
                      Long scheduleAfterVersion)
                      throws CreateException
Creates a new Version object.

Parameters:
name - the Name
startDate - start date of the version or null
releaseDate - date of release or null if not released.
description - the Description
projectId - the id of the Project of the version.
scheduleAfterVersion - id of the version after which this should be sequenced or null.
Returns:
the new Version.
Throws:
CreateException - If there was a problem creating the version.
Since:
v6.0

moveToStartVersionSequence

void moveToStartVersionSequence(Version version)
Move a version to the start of the version list

Parameters:
version - the Version to move

increaseVersionSequence

void increaseVersionSequence(Version version)
Move a version to have a lower sequence number - ie make it earlier

Parameters:
version - the Version

decreaseVersionSequence

void decreaseVersionSequence(Version version)
Move a version to have a higher sequence number - ie make it later

Parameters:
version - the Version

moveToEndVersionSequence

void moveToEndVersionSequence(Version version)
Move a version to the end of the version sequence

Parameters:
version - the Version

moveVersionAfter

void moveVersionAfter(Version version,
                      Long scheduleAfterVersion)
Move a version after another version

Parameters:
version - version to reschedule
scheduleAfterVersion - id of the version to schedule after the given version object

deleteVersion

void deleteVersion(Version version)
Removes a specific version from the system.

Parameters:
version - The version to be removed.

editVersionDetails

@Deprecated
void editVersionDetails(Version version,
                                   String name,
                                   String description,
                                   org.ofbiz.core.entity.GenericValue project)
Deprecated. use editVersionDetails(Version, String, String) instead. since 5.0

Updates details for an existing version.

Parameters:
version - The version to update
name - new name
description - new description
project - Used to check for duplicate version names in a project.
Throws:
IllegalArgumentException - If the name is not set, or already exists.

editVersionDetails

void editVersionDetails(Version version,
                        String name,
                        String description)
Updates details of an existing version.

Parameters:
version - The version to update
name - The new version name, cannot be empty.
description - The description of this version.
Throws:
IllegalArgumentException - If the name is not set, or already exists.

isDuplicateName

boolean isDuplicateName(Version version,
                        String name)
Check that the version name we are changing to is not a duplicate.

Parameters:
version - The version to update
name - The new name for the version
Returns:
true if there is already a version with that name for the project

isDuplicateName

@Deprecated
boolean isDuplicateName(Version version,
                                   String name,
                                   org.ofbiz.core.entity.GenericValue project)
Deprecated. use isDuplicateName(Version, String) instead. since 5.0

Check that the version name we are changing to is not a duplicate.

Parameters:
version - The version to update
name - The new name for the version
project - Used to check for duplicate version names in a project.
Returns:
true if there is already a version with that name for the project

releaseVersion

void releaseVersion(Version version,
                    boolean release)
Used to release or unrelease a version, depending on the release flag.

Parameters:
version - Version to be released (or unreleased)
release - True to release a version. False to 'unrelease' a version

releaseVersions

void releaseVersions(Collection<Version> versions,
                     boolean release)
Used to release versions depending on the release flag.

Parameters:
versions - Collection of Versions
release - True to release a version. False to 'unrelease' a version

moveIssuesToNewVersion

void moveIssuesToNewVersion(List issues,
                            Version currentVersion,
                            Version swapToVersion)
                            throws IndexException
Swaps the list of issues supplied from one Fix version to another.

Parameters:
issues - the Issues
currentVersion - Current fix version they will be swapped from
swapToVersion - New fix version they will be swapped to.
Throws:
IndexException - if an error occurs will indexing these new issue values.

archiveVersions

void archiveVersions(String[] idsToArchive,
                     String[] idsToUnarchive)
Method used to archive and un-archive a number of versions.

Parameters:
idsToArchive - Archive all these Versions
idsToUnarchive - Unarchive these Versions

archiveVersion

void archiveVersion(Version version,
                    boolean archive)
Archive/Un-archive a single version depending on the archive flag.

Parameters:
version - the Version to archive or unarchive
archive - new archive value

getVersionsUnarchived

Collection<Version> getVersionsUnarchived(Long projectId)
Return all un-archived versions for a particular project

Parameters:
projectId - id of the project.
Returns:
A collection of Versions
Since:
v3.10

getVersionsArchived

Collection<Version> getVersionsArchived(org.ofbiz.core.entity.GenericValue projectGV)
Deprecated. Use getVersionsArchived(Project) instead. Since v5.0.

Return all archived versions for a particular project.

Parameters:
projectGV - the Project
Returns:
A collections of Versions

getVersionsArchived

Collection<Version> getVersionsArchived(Project project)
Return all archived versions for a particular project.

Parameters:
project - the Project
Returns:
Archived versions for this project.

update

Version update(Version version)
Persists updates to the specified version object.

Parameters:
version - the version
Returns:
the updated version
Since:
6.0

editVersionReleaseDate

void editVersionReleaseDate(Version version,
                            Date duedate)
Update the release date of a version.

Parameters:
version - the Version to edit
duedate - new release date

editVersionStartDate

void editVersionStartDate(Version version,
                          Date startDate)
Updates the start date of a version

Parameters:
version - the version to edit
startDate - new start date
Since:
v6.0

editVersionStartReleaseDate

void editVersionStartReleaseDate(Version version,
                                 Date startDate,
                                 Date releaseDate)
Updates the start and release date of a version

Parameters:
version - the version to edit
startDate - new start date
releaseDate - new release date
Since:
v6.0

isVersionOverDue

boolean isVersionOverDue(Version version)
Checks to see if a version is overdue. Note: This method checks if the due date set for a version is previous to last midnight. (not now()).

Parameters:
version - the Version
Returns:
True if the version is overdue. (i.e. releaseDate is before last midnight)

getVersions

List<Version> getVersions(org.ofbiz.core.entity.GenericValue project)
Deprecated. Use getVersions(Long) or getVersions(Project) instead. Since 2006.

Gets all the versions for a project.

Parameters:
project - the Project
Returns:
a List of Version objects.

getVersions

List<Version> getVersions(Long projectId)
Return a list of Versions for the given project.

Parameters:
projectId - the Project
Returns:
a list of Versions for the given project.
See Also:
getVersions(Project)

getVersions

List<Version> getVersions(Long projectId,
                          boolean includeArchived)
Return a list of Versions for the given project.

Parameters:
projectId - the Project
includeArchived - whether or not to include archived versions
Returns:
a list of Versions for the given project.
See Also:
getVersions(Project)

getVersions

List<Version> getVersions(Project project)
Return a list of Versions for the given project.

Parameters:
project - the Project
Returns:
a list of Versions for the given project.
See Also:
getVersions(Long)

getVersionsByName

Collection<Version> getVersionsByName(String versionName)
Return a collection of Versions that have the specified name.

Parameters:
versionName - the name of the version (case-insensitive)
Returns:
a Collection of Version objects. Never null.

getVersions

Collection<Version> getVersions(List<Long> ids)
Return a collection of Versions matching the ids passed in.

Parameters:
ids - Version IDs
Returns:
a collection of Versions matching the ids passed in.

getVersion

Version getVersion(Long id)
Returns a single version.

Parameters:
id - the Version ID
Returns:
A Version object.

getVersion

Version getVersion(Long projectId,
                   String versionName)
Search for a version by projectID and name.

Parameters:
projectId - the Project
versionName - the Version name
Returns:
A Version object.

getVersionsUnreleased

Collection<Version> getVersionsUnreleased(Long projectId,
                                          boolean includeArchived)
Gets a list of un-released versions for a particular project.

Parameters:
projectId - The id of the project for which to return versions
includeArchived - True if archived versions should be included
Returns:
A Collection of Versions, never null
Since:
v3.10

getVersionsReleased

Collection<Version> getVersionsReleased(Long projectId,
                                        boolean includeArchived)
Gets a list of released versions for a project. This list will include archived versions if the 'includeArchived' flag is set to true.

Parameters:
projectId - project id
includeArchived - flag to indicate whether to include archived versions in the result.
Returns:
A collection of Version objects

getVersionsReleasedDesc

Collection<Version> getVersionsReleasedDesc(Long projectId,
                                            boolean includeArchived)
Gets a list of released versions for a project in reverse order. This list will include archived versions if the 'includeArchived' flag is set to true.

Parameters:
projectId - project id
includeArchived - flag to indicate whether to include archived versions in the result.
Returns:
A collection of Version objects

getOtherVersions

Collection<Version> getOtherVersions(Version version)
Return all other versions in the project except this one

Parameters:
version - the Version
Returns:
all other versions in the project except this one

getOtherUnarchivedVersions

Collection<Version> getOtherUnarchivedVersions(Version version)
Return all unarchived versions except this one

Parameters:
version - the Version
Returns:
all unarchived versions except this one

getAllAffectedIssues

@Deprecated
Collection<org.ofbiz.core.entity.GenericValue> getAllAffectedIssues(Collection<Version> versions)
Deprecated. use getIssuesWithAffectsVersion(Version) instead. since 5.0

Return all Issues that are associated with the specified versions

Parameters:
versions - a collection of Version objects
Returns:
A collection of issue GenericValues

getFixIssues

@Deprecated
Collection<org.ofbiz.core.entity.GenericValue> getFixIssues(Version version)
Deprecated. use getIssuesWithFixVersion(Version) instead. since 5.0

Return Fix Issues

Parameters:
version - the Version
Returns:
A collection of issue GenericValues

getIssuesWithFixVersion

Collection<Issue> getIssuesWithFixVersion(Version version)
Return all the issues in which the fix for version matches the specified version.

Parameters:
version - the fixed for version.
Returns:
all the issues in which the fix for version matches the specified version.
Since:
v5.0

getAffectsIssues

@Deprecated
Collection<org.ofbiz.core.entity.GenericValue> getAffectsIssues(Version version)
Deprecated. use getIssuesWithAffectsVersion(Version) instead. since 5.0

Return 'Affects' Issues

Parameters:
version - the Version
Returns:
A collection of issue GenericValues

getIssuesWithAffectsVersion

Collection<Issue> getIssuesWithAffectsVersion(Version version)
Return all the issues in which the affected version matches the specified version.

Parameters:
version - the affected version.
Returns:
all the issues in which the affected version matches the specified version.
Since:
v5.0

getAffectedVersionsByIssue

@Deprecated
Collection<Version> getAffectedVersionsByIssue(org.ofbiz.core.entity.GenericValue issue)
Deprecated. use getAffectedVersionsFor(com.atlassian.jira.issue.Issue) instead. since 5.0

Parameters:
issue - the Issue
Returns:
A collection of 'affects' Versions for an issue.

getAffectedVersionsFor

Collection<Version> getAffectedVersionsFor(Issue issue)
Get all affected versions of the specified issue.

Parameters:
issue - the issue
Returns:
all affected versions of the specified issue.

getFixVersionsByIssue

@Deprecated
Collection<Version> getFixVersionsByIssue(org.ofbiz.core.entity.GenericValue issue)
Deprecated. use getFixVersionsFor(com.atlassian.jira.issue.Issue) instead. since 5.0

Parameters:
issue - the Issue
Returns:
A collection of 'fix for' Versions for an issue.

getFixVersionsFor

Collection<Version> getFixVersionsFor(Issue issue)
Get all fix for versions of the specified issue.

Parameters:
issue - the Issue
Returns:
all fix for versions of the specified issue.

getAllVersions

Collection<Version> getAllVersions()
Returns:
all versions in JIRA. Never null.

getAllVersionsForProjects

Collection<Version> getAllVersionsForProjects(Collection<Project> projects,
                                              boolean includeArchived)
Returns all versions that belong to the passed projects.

Parameters:
projects - projects to search in
includeArchived - whether or not to include archived versions
Returns:
all versions that belong to passed projects. Never null.

getAllVersionsReleased

Collection<Version> getAllVersionsReleased(boolean includeArchived)
Parameters:
includeArchived - whether or not to include archived versions
Returns:
all released versions in JIRA. Never null.

getAllVersionsUnreleased

Collection<Version> getAllVersionsUnreleased(boolean includeArchived)
Parameters:
includeArchived - whether or not to include archived versions
Returns:
all released versions in JIRA. Never null.


Copyright © 2002-2013 Atlassian. All Rights Reserved.