com.atlassian.jira.project.version
Interface VersionManager

All Known Implementing Classes:
DefaultVersionManager

public interface VersionManager

Manager responsible for JIRA versions.


Field Summary
static String ALL_RELEASED_VERSIONS
          Used to retreive all released versions
static String ALL_UNRELEASED_VERSIONS
          Used to retreive 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 releaseDate, String description, org.ofbiz.core.entity.GenericValue project, Long scheduleAfterVersion)
          Deprecated. now use #createVersion with projectId instead of generic value
 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(String actionType, Version version, String affectsAction, Long affectsSwapVersionId, String fixAction, Long fixSwapVersionId)
          Deprecated. since v3.13. Use deleteVersion(Version) instead.
 void deleteVersion(Version version)
          Removes a specific version from the system.
 void editVersionDetails(Version version, String name, String description, org.ofbiz.core.entity.GenericValue project)
          Updates details for an existing version.
 void editVersionReleaseDate(Version version, Date duedate)
          Update the release date of a version.
 Collection<Version> getAffectedVersionsByIssue(org.ofbiz.core.entity.GenericValue issue)
           
 Collection<org.ofbiz.core.entity.GenericValue> getAffectsIssues(Version version)
          Return 'Affects' Issues
 Collection<org.ofbiz.core.entity.GenericValue> getAllAffectedIssues(Collection<Version> versions)
          Return all Issues that are assoicated with the specified versions
 Collection<Version> getAllVersions()
           
 Collection<Version> getAllVersionsReleased(boolean includeArchived)
           
 Collection<Version> getAllVersionsUnreleased(boolean includeArchived)
           
 Collection<org.ofbiz.core.entity.GenericValue> getFixIssues(Version version)
          Return Fix Issues
 Collection<Version> getFixVersionsByIssue(org.ofbiz.core.entity.GenericValue issue)
           
 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(org.ofbiz.core.entity.GenericValue project, String name)
          Deprecated. Use getVersion(Long,String) instead
 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)
 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 a project.
 Collection<Version> getVersionsArchived(org.ofbiz.core.entity.GenericValue projectGV)
          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(org.ofbiz.core.entity.GenericValue project, boolean includeArchived)
          Deprecated. use getVersionsReleased(Long,boolean) instead
 Collection<Version> getVersionsReleased(Long projectId, boolean includeArchived)
          Gets a list of released versions for a project.
 Collection<Version> getVersionsReleasedDesc(org.ofbiz.core.entity.GenericValue project, boolean includeArchived)
          Deprecated. use getVersionsReleasedDesc(Long, boolean) instead
 Collection<Version> getVersionsReleasedDesc(Long projectId, boolean includeArchived)
          Gets a list of released versions for a project in reverse order.
 Collection<Version> getVersionsUnarchived(org.ofbiz.core.entity.GenericValue projectGV)
          Deprecated. Use getVersionsUnarchived(Long) instead. Since v3.10
 Collection<Version> getVersionsUnarchived(Long projectId)
          Return all un-archived versions for a particular project
 Collection<Version> getVersionsUnreleased(org.ofbiz.core.entity.GenericValue project, boolean includeArchived)
          Deprecated. Use getVersionsUnreleased(Long,boolean) instead, since v3.10.
 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 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 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.
 

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 retreive all unreleased versions

See Also:
Constant Field Values

ALL_RELEASED_VERSIONS

static final String ALL_RELEASED_VERSIONS
Used to retreive all released versions

See Also:
Constant Field Values
Method Detail

createVersion

Version createVersion(String name,
                      Date releaseDate,
                      String description,
                      org.ofbiz.core.entity.GenericValue project,
                      Long scheduleAfterVersion)
                      throws CreateException
Deprecated. now use #createVersion with projectId instead of generic value

Creates a new Version object.

Parameters:
name -
releaseDate - date of release or null if not released.
description -
project - the GenericValue 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 releaseDate,
                      String description,
                      Long projectId,
                      Long scheduleAfterVersion)
                      throws CreateException
Creates a new Version object. Takes a project ID instead of a project GenericValue.

Parameters:
name -
releaseDate - date of release or null if not released.
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.

moveToStartVersionSequence

void moveToStartVersionSequence(Version version)
                                throws org.ofbiz.core.entity.GenericEntityException
Move a version to the start of the version list

Parameters:
version -
Throws:
org.ofbiz.core.entity.GenericEntityException

increaseVersionSequence

void increaseVersionSequence(Version version)
                             throws org.ofbiz.core.entity.GenericEntityException
Move a version to have a lower sequence number - ie make it earlier

Parameters:
version -
Throws:
org.ofbiz.core.entity.GenericEntityException

decreaseVersionSequence

void decreaseVersionSequence(Version version)
                             throws org.ofbiz.core.entity.GenericEntityException
Move a version to have a higher sequence number - ie make it later

Parameters:
version -
Throws:
org.ofbiz.core.entity.GenericEntityException

moveToEndVersionSequence

void moveToEndVersionSequence(Version version)
                              throws org.ofbiz.core.entity.GenericEntityException
Move a version to the end of the version sequence

Parameters:
version -
Throws:
org.ofbiz.core.entity.GenericEntityException

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(String actionType,
                   Version version,
                   String affectsAction,
                   Long affectsSwapVersionId,
                   String fixAction,
                   Long fixSwapVersionId)
                   throws org.ofbiz.core.entity.GenericEntityException
Deprecated. since v3.13. Use deleteVersion(Version) instead.

This method is used by the merge and delete actions. The action type needs to be specified as the action params are validated differently.

Parameters:
actionType - See VersionKeys.DELETE_ACTION,VersionKeys.MERGE_ACTION
version - The version to delete.
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
affectsSwapVersionId - The new affects version to move issues to.
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
fixSwapVersionId - The new fix version to move issues to.
Throws:
org.ofbiz.core.entity.GenericEntityException

deleteVersion

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

Parameters:
version - The version to be removed.

editVersionDetails

void editVersionDetails(Version version,
                        String name,
                        String description,
                        org.ofbiz.core.entity.GenericValue project)
                        throws org.ofbiz.core.entity.GenericEntityException
Updates details for an existing version.

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

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 org.ofbiz.core.entity.GenericEntityException,
                                   IndexException
Swaps the list of issues supplied from one version to another.

Parameters:
issues -
currentVersion -
swapToVersion -
Throws:
org.ofbiz.core.entity.GenericEntityException
IndexException

archiveVersions

void archiveVersions(String[] idsToArchive,
                     String[] idsToUnarchive)
                     throws org.ofbiz.core.entity.GenericEntityException
Method used to archive and un-archive a number of versions.

Parameters:
idsToArchive -
idsToUnarchive -
Throws:
org.ofbiz.core.entity.GenericEntityException

archiveVersion

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

Parameters:
version -
archive -

getVersionsUnarchived

Collection<Version> getVersionsUnarchived(org.ofbiz.core.entity.GenericValue projectGV)
                                          throws org.ofbiz.core.entity.GenericEntityException
Deprecated. Use getVersionsUnarchived(Long) instead. Since v3.10

Return all un-archived versions for a particular project

Parameters:
projectGV -
Returns:
A collection of Versions
Throws:
org.ofbiz.core.entity.GenericEntityException

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
Throws:
org.ofbiz.core.entity.GenericEntityException - If there's a problem retrieving versions
Since:
v3.10

getVersionsArchived

Collection<Version> getVersionsArchived(org.ofbiz.core.entity.GenericValue projectGV)
                                        throws org.ofbiz.core.entity.GenericEntityException
Return all archived versions for a particular project.

Parameters:
projectGV -
Returns:
A collections of Versions
Throws:
org.ofbiz.core.entity.GenericEntityException

editVersionReleaseDate

void editVersionReleaseDate(Version version,
                            Date duedate)
                            throws org.ofbiz.core.entity.GenericEntityException
Update the release date of a version.

Parameters:
version -
duedate -
Throws:
org.ofbiz.core.entity.GenericEntityException

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 -
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)

Gets all the versions for a project.

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

getVersions

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

Parameters:
projectId -
Returns:
a List of Version objects.

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 -
Returns:

getVersion

Version getVersion(Long id)
Returns a single version.

Parameters:
id -
Returns:
A Version object.

getVersion

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

Parameters:
projectId -
versionName -
Returns:
A Version object.

getVersion

Version getVersion(org.ofbiz.core.entity.GenericValue project,
                   String name)
Deprecated. Use getVersion(Long,String) instead

Search for a version by projectID and name.

Parameters:
project -
name -
Returns:
A Version object.

getVersionsUnreleased

Collection<Version> getVersionsUnreleased(org.ofbiz.core.entity.GenericValue project,
                                          boolean includeArchived)
Deprecated. Use getVersionsUnreleased(Long,boolean) instead, since v3.10.

Gets a list of un-released versions for a particular project.

Parameters:
project -
includeArchived -
Returns:
A collection of Versions

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(org.ofbiz.core.entity.GenericValue project,
                                        boolean includeArchived)
Deprecated. use getVersionsReleased(Long,boolean) instead

Gets a list of released versions for a project. This list will include archived versions if the 'includeArchived' flag is set to true.

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

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(org.ofbiz.core.entity.GenericValue project,
                                            boolean includeArchived)
Deprecated. use getVersionsReleasedDesc(Long, boolean) instead

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:
project - project generic value
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)
                                     throws org.ofbiz.core.entity.GenericEntityException
Return all other versions in the project except this one

Parameters:
version -
Returns:
Throws:
org.ofbiz.core.entity.GenericEntityException

getOtherUnarchivedVersions

Collection<Version> getOtherUnarchivedVersions(Version version)
                                               throws org.ofbiz.core.entity.GenericEntityException
Return all unarchived versions except this one

Parameters:
version -
Returns:
Throws:
org.ofbiz.core.entity.GenericEntityException

getAllAffectedIssues

Collection<org.ofbiz.core.entity.GenericValue> getAllAffectedIssues(Collection<Version> versions)
                                                                    throws org.ofbiz.core.entity.GenericEntityException
Return all Issues that are assoicated with the specified versions

Parameters:
versions - a collection of Version objects
Returns:
A collection of issue GenericValues
Throws:
org.ofbiz.core.entity.GenericEntityException

getFixIssues

Collection<org.ofbiz.core.entity.GenericValue> getFixIssues(Version version)
                                                            throws org.ofbiz.core.entity.GenericEntityException
Return Fix Issues

Parameters:
version -
Returns:
A collection of issue GenericValues
Throws:
org.ofbiz.core.entity.GenericEntityException

getAffectsIssues

Collection<org.ofbiz.core.entity.GenericValue> getAffectsIssues(Version version)
                                                                throws org.ofbiz.core.entity.GenericEntityException
Return 'Affects' Issues

Parameters:
version -
Returns:
A collection of issue GenericValues
Throws:
org.ofbiz.core.entity.GenericEntityException

getAffectedVersionsByIssue

Collection<Version> getAffectedVersionsByIssue(org.ofbiz.core.entity.GenericValue issue)
Parameters:
issue -
Returns:
A collection of 'affects' Versions for an issue.

getFixVersionsByIssue

Collection<Version> getFixVersionsByIssue(org.ofbiz.core.entity.GenericValue issue)
Parameters:
issue -
Returns:
A collection of 'fix for' Versions for an issue.

getAllVersions

Collection<Version> getAllVersions()
Returns:
all versions in JIRA. 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-2009 Atlassian. All Rights Reserved.