com.atlassian.jira.project.version
Interface VersionManager

All Known Implementing Classes:
DefaultVersionManager

public interface VersionManager

Manager responsible for JIRA versions.


Field Summary
static java.lang.String ALL_RELEASED_VERSIONS
          Used to retreive all released versions
static java.lang.String ALL_UNRELEASED_VERSIONS
          Used to retreive all unreleased versions
static java.lang.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(java.lang.String[] idsToArchive, java.lang.String[] idsToUnarchive)
          Method used to archive and un-archive a number of versions.
 Version createVersion(java.lang.String name, java.util.Date releaseDate, java.lang.String description, org.ofbiz.core.entity.GenericValue project, java.lang.Long scheduleAfterVersion)
          Deprecated. now use #createVersion with projectId instead of generic value
 Version createVersion(java.lang.String name, java.util.Date releaseDate, java.lang.String description, java.lang.Long projectId, java.lang.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(java.lang.String actionType, Version version, java.lang.String affectsAction, java.lang.Long affectsSwapVersionId, java.lang.String fixAction, java.lang.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, java.lang.String name, java.lang.String description, org.ofbiz.core.entity.GenericValue project)
          Updates details for an existing version.
 void editVersionReleaseDate(Version version, java.util.Date duedate)
          Update the release date of a version.
 java.util.Collection<Version> getAffectedVersionsByIssue(org.ofbiz.core.entity.GenericValue issue)
           
 java.util.Collection<org.ofbiz.core.entity.GenericValue> getAffectsIssues(Version version)
          Return 'Affects' Issues
 java.util.Collection<org.ofbiz.core.entity.GenericValue> getAllAffectedIssues(java.util.Collection<Version> versions)
          Return all Issues that are assoicated with the specified versions
 java.util.Collection<Version> getAllVersions()
           
 java.util.Collection<Version> getAllVersionsReleased(boolean includeArchived)
           
 java.util.Collection<Version> getAllVersionsUnreleased(boolean includeArchived)
           
 java.util.Collection<org.ofbiz.core.entity.GenericValue> getFixIssues(Version version)
          Return Fix Issues
 java.util.Collection<Version> getFixVersionsByIssue(org.ofbiz.core.entity.GenericValue issue)
           
 java.util.Collection<Version> getOtherUnarchivedVersions(Version version)
          Return all unarchived versions except this one
 java.util.Collection<Version> getOtherVersions(Version version)
          Return all other versions in the project except this one
 Version getVersion(org.ofbiz.core.entity.GenericValue project, java.lang.String name)
          Deprecated. Use getVersion(Long,String) instead
 Version getVersion(java.lang.Long id)
          Returns a single version.
 Version getVersion(java.lang.Long projectId, java.lang.String versionName)
          Search for a version by projectID and name.
 java.util.List<Version> getVersions(org.ofbiz.core.entity.GenericValue project)
          Deprecated. use #getVersions(Long)
 java.util.Collection<Version> getVersions(java.util.List<java.lang.Long> ids)
          Return a collection of Versions matching the ids passed in.
 java.util.List<Version> getVersions(java.lang.Long projectId)
          Return a list of Versions for a project.
 java.util.Collection<Version> getVersionsArchived(org.ofbiz.core.entity.GenericValue projectGV)
          Return all archived versions for a particular project.
 java.util.Collection<Version> getVersionsByName(java.lang.String versionName)
          Return a collection of Versions that have the specified name.
 java.util.Collection<Version> getVersionsReleased(org.ofbiz.core.entity.GenericValue project, boolean includeArchived)
          Deprecated. use getVersionsReleased(Long,boolean) instead
 java.util.Collection<Version> getVersionsReleased(java.lang.Long projectId, boolean includeArchived)
          Gets a list of released versions for a project.
 java.util.Collection<Version> getVersionsReleasedDesc(org.ofbiz.core.entity.GenericValue project, boolean includeArchived)
          Deprecated. use getVersionsReleasedDesc(Long, boolean) instead
 java.util.Collection<Version> getVersionsReleasedDesc(java.lang.Long projectId, boolean includeArchived)
          Gets a list of released versions for a project in reverse order.
 java.util.Collection<Version> getVersionsUnarchived(org.ofbiz.core.entity.GenericValue projectGV)
          Deprecated. Use getVersionsUnarchived(Long) instead. Since v3.10
 java.util.Collection<Version> getVersionsUnarchived(java.lang.Long projectId)
          Return all un-archived versions for a particular project
 java.util.Collection<Version> getVersionsUnreleased(org.ofbiz.core.entity.GenericValue project, boolean includeArchived)
          Deprecated. Use getVersionsUnreleased(Long,boolean) instead, since v3.10.
 java.util.Collection<Version> getVersionsUnreleased(java.lang.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(java.util.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, java.lang.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(java.util.Collection<Version> versions, boolean release)
          Used to release versions depending on the release flag.
 

Field Detail

NO_VERSIONS

static final java.lang.String NO_VERSIONS
Used to represent empty version fields

See Also:
Constant Field Values

ALL_UNRELEASED_VERSIONS

static final java.lang.String ALL_UNRELEASED_VERSIONS
Used to retreive all unreleased versions

See Also:
Constant Field Values

ALL_RELEASED_VERSIONS

static final java.lang.String ALL_RELEASED_VERSIONS
Used to retreive all released versions

See Also:
Constant Field Values
Method Detail

createVersion

Version createVersion(java.lang.String name,
                      java.util.Date releaseDate,
                      java.lang.String description,
                      org.ofbiz.core.entity.GenericValue project,
                      java.lang.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(java.lang.String name,
                      java.util.Date releaseDate,
                      java.lang.String description,
                      java.lang.Long projectId,
                      java.lang.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,
                      java.lang.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(java.lang.String actionType,
                   Version version,
                   java.lang.String affectsAction,
                   java.lang.Long affectsSwapVersionId,
                   java.lang.String fixAction,
                   java.lang.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,
                        java.lang.String name,
                        java.lang.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
java.lang.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(java.util.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(java.util.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(java.lang.String[] idsToArchive,
                     java.lang.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

java.util.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

java.util.Collection<Version> getVersionsUnarchived(java.lang.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

java.util.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,
                            java.util.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

java.util.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

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

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

getVersionsByName

java.util.Collection<Version> getVersionsByName(java.lang.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

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

Parameters:
ids -
Returns:

getVersion

Version getVersion(java.lang.Long id)
Returns a single version.

Parameters:
id -
Returns:
A Version object.

getVersion

Version getVersion(java.lang.Long projectId,
                   java.lang.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,
                   java.lang.String name)
Deprecated. Use getVersion(Long,String) instead

Search for a version by projectID and name.

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

getVersionsUnreleased

java.util.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

java.util.Collection<Version> getVersionsUnreleased(java.lang.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

java.util.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

java.util.Collection<Version> getVersionsReleased(java.lang.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

java.util.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

java.util.Collection<Version> getVersionsReleasedDesc(java.lang.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

java.util.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

java.util.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

java.util.Collection<org.ofbiz.core.entity.GenericValue> getAllAffectedIssues(java.util.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

java.util.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

java.util.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

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

getFixVersionsByIssue

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

getAllVersions

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

getAllVersionsReleased

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

getAllVersionsUnreleased

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


Copyright © 2002-2010 Atlassian. All Rights Reserved.