com.atlassian.jira.project.version
Class DefaultVersionManager

java.lang.Object
  extended bycom.atlassian.jira.project.version.DefaultVersionManager
All Implemented Interfaces:
VersionManager

public class DefaultVersionManager
extends Object
implements VersionManager


Field Summary
protected  com.atlassian.core.ofbiz.association.AssociationManager associationManager
           
protected  CacheManager cacheManager
           
protected  CollectionReorderer collectionReorderer
           
protected  IssueIndexManager issueIndexManager
           
protected  IssueManager issueManager
           
protected  ProjectManager projectManager
           
protected  VersionStore versionStore
           
 
Constructor Summary
DefaultVersionManager(IssueManager issueManager, CacheManager cacheManager, CollectionReorderer collectionReorderer, com.atlassian.core.ofbiz.association.AssociationManager associationManager, IssueIndexManager issueIndexManager, ProjectManager projectManager, VersionStore versionStore)
           
 
Method Summary
 void archiveVersion(Version version, boolean archive)
           
 void archiveVersions(String[] idsToArchive, String[] idsToUnarchive)
           
 Version createVersion(String name, Date releaseDate, String description, org.ofbiz.core.entity.GenericValue project, 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(String actionType, Version version, String affectsAction, Long affectsSwapVersionId, String fixAction, Long fixSwapVersionId)
          This method is used by the merge and delete actions.
 void editVersionDetails(Version version, String versionName, String description, org.ofbiz.core.entity.GenericValue project)
           
 void editVersionReleaseDate(Version version, Date duedate)
           
 Collection getAffectedVersionsByIssue(org.ofbiz.core.entity.GenericValue issue)
           
 Collection getAffectsIssues(Version version)
           
 Collection getAllAffectedIssues(Collection versions)
          Return all Issues that are assoicated with the specified versions
 Collection getFixIssues(Version version)
          Return Fix Issues
 Collection getFixVersionsByIssue(org.ofbiz.core.entity.GenericValue issue)
           
 Collection getOtherUnarchivedVersions(Version version)
          Return all unarchived versions except this one
 Collection getOtherVersions(Version version)
          Return all other versions in the project except this one
 Version getVersion(org.ofbiz.core.entity.GenericValue project, String versionName)
          Retrieve a specific Version in a project, or null if no such version exists in that project.
 Version getVersion(Long id)
           
 Version getVersion(Long projectId, String versionName)
          Retrieve a specific Version in a project given the project id, or null if no such version exists in that project.
 List getVersions(org.ofbiz.core.entity.GenericValue project)
          Gets all the versions for a project.
 Collection getVersions(List ids)
           
 List getVersions(Long projectId)
          Return a list of Versions for a project.
 Collection getVersionsArchived(org.ofbiz.core.entity.GenericValue projectGV)
           
protected  Collection getVersionsByIssue(org.ofbiz.core.entity.GenericValue issue, String relationName)
           
 Collection getVersionsReleased(org.ofbiz.core.entity.GenericValue project, boolean includeArchived)
           
 Collection getVersionsReleasedDesc(org.ofbiz.core.entity.GenericValue project, boolean includeArchived)
           
 Collection getVersionsUnarchived(org.ofbiz.core.entity.GenericValue projectGV)
           
 Collection getVersionsUnreleased(org.ofbiz.core.entity.GenericValue project, boolean includeArchived)
           
 void increaseVersionSequence(Version version)
          Move a version to have a lower sequence number - ie make it earlier
 boolean isVersionOverDue(Version version)
           
 void moveIssuesToNewVersion(List issues, Version currentVersion, Version swapToVersion)
           
 void moveToEndVersionSequence(Version version)
          Move a version to to the end of the version sequence
 void moveToStartVersionSequence(Version version)
          Move a version to the start of the version list
 void releaseVersions(Collection versions, boolean release)
           
 void storeReorderedVersionList(List versions)
          Given a re-ordered list of versions, commit the changes to the backend datastore.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

issueManager

protected final IssueManager issueManager

cacheManager

protected final CacheManager cacheManager

collectionReorderer

protected final CollectionReorderer collectionReorderer

associationManager

protected final com.atlassian.core.ofbiz.association.AssociationManager associationManager

issueIndexManager

protected final IssueIndexManager issueIndexManager

projectManager

protected final ProjectManager projectManager

versionStore

protected final VersionStore versionStore
Constructor Detail

DefaultVersionManager

public DefaultVersionManager(IssueManager issueManager,
                             CacheManager cacheManager,
                             CollectionReorderer collectionReorderer,
                             com.atlassian.core.ofbiz.association.AssociationManager associationManager,
                             IssueIndexManager issueIndexManager,
                             ProjectManager projectManager,
                             VersionStore versionStore)
Method Detail

createVersion

public Version createVersion(String name,
                             Date releaseDate,
                             String description,
                             org.ofbiz.core.entity.GenericValue project,
                             Long scheduleAfterVersion)
                      throws CreateException,
                             org.ofbiz.core.entity.GenericEntityException
Description copied from interface: VersionManager
Creates a new Version object.

Specified by:
createVersion in interface VersionManager
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.
org.ofbiz.core.entity.GenericEntityException - If there was a problem creating the version.

createVersion

public Version createVersion(String name,
                             Date releaseDate,
                             String description,
                             Long projectId,
                             Long scheduleAfterVersion)
                      throws CreateException,
                             org.ofbiz.core.entity.GenericEntityException
Description copied from interface: VersionManager
Creates a new Version object.

Specified by:
createVersion in interface VersionManager
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.
org.ofbiz.core.entity.GenericEntityException - If there was a problem creating the version.

moveToStartVersionSequence

public void moveToStartVersionSequence(Version version)
Description copied from interface: VersionManager
Move a version to the start of the version list

Specified by:
moveToStartVersionSequence in interface VersionManager

increaseVersionSequence

public void increaseVersionSequence(Version version)
Description copied from interface: VersionManager
Move a version to have a lower sequence number - ie make it earlier

Specified by:
increaseVersionSequence in interface VersionManager

decreaseVersionSequence

public void decreaseVersionSequence(Version version)
Description copied from interface: VersionManager
Move a version to have a higher sequence number - ie make it later

Specified by:
decreaseVersionSequence in interface VersionManager

moveToEndVersionSequence

public void moveToEndVersionSequence(Version version)
Description copied from interface: VersionManager
Move a version to to the end of the version sequence

Specified by:
moveToEndVersionSequence in interface VersionManager

deleteVersion

public void deleteVersion(String actionType,
                          Version version,
                          String affectsAction,
                          Long affectsSwapVersionId,
                          String fixAction,
                          Long fixSwapVersionId)
This method is used by the merge and delete actions. The action type needs to be specified as the action params are validated differently.

Specified by:
deleteVersion in interface VersionManager

editVersionDetails

public void editVersionDetails(Version version,
                               String versionName,
                               String description,
                               org.ofbiz.core.entity.GenericValue project)
Specified by:
editVersionDetails in interface VersionManager

releaseVersions

public void releaseVersions(Collection versions,
                            boolean release)
Specified by:
releaseVersions in interface VersionManager

moveIssuesToNewVersion

public void moveIssuesToNewVersion(List issues,
                                   Version currentVersion,
                                   Version swapToVersion)
                            throws IndexException
Specified by:
moveIssuesToNewVersion in interface VersionManager
Throws:
IndexException

archiveVersions

public void archiveVersions(String[] idsToArchive,
                            String[] idsToUnarchive)
Specified by:
archiveVersions in interface VersionManager

archiveVersion

public void archiveVersion(Version version,
                           boolean archive)
Specified by:
archiveVersion in interface VersionManager

editVersionReleaseDate

public void editVersionReleaseDate(Version version,
                                   Date duedate)
Specified by:
editVersionReleaseDate in interface VersionManager

isVersionOverDue

public boolean isVersionOverDue(Version version)
Specified by:
isVersionOverDue in interface VersionManager

getVersionsUnarchived

public Collection getVersionsUnarchived(org.ofbiz.core.entity.GenericValue projectGV)
Specified by:
getVersionsUnarchived in interface VersionManager

getVersionsArchived

public Collection getVersionsArchived(org.ofbiz.core.entity.GenericValue projectGV)
Specified by:
getVersionsArchived in interface VersionManager

getVersions

public List getVersions(org.ofbiz.core.entity.GenericValue project)
Description copied from interface: VersionManager
Gets all the versions for a project.

Specified by:
getVersions in interface VersionManager
Parameters:
project -
Returns:
a List of Version objects.

getVersions

public List getVersions(Long projectId)
Description copied from interface: VersionManager
Return a list of Versions for a project.

Specified by:
getVersions in interface VersionManager
Parameters:
projectId -
Returns:
a List of Version objects.

getAffectedVersionsByIssue

public Collection getAffectedVersionsByIssue(org.ofbiz.core.entity.GenericValue issue)
Specified by:
getAffectedVersionsByIssue in interface VersionManager
Returns:
A collection of Versions for an issue.

getFixVersionsByIssue

public Collection getFixVersionsByIssue(org.ofbiz.core.entity.GenericValue issue)
Specified by:
getFixVersionsByIssue in interface VersionManager
Returns:
A collection of Versions for an issue.

getVersionsByIssue

protected Collection getVersionsByIssue(org.ofbiz.core.entity.GenericValue issue,
                                        String relationName)
Parameters:
issue -
relationName - IssueRelationConstants.VERSION or IssueRelationConstants.FIX_VERSION.
Returns:
A collection of Versions for this issue.

getVersions

public Collection getVersions(List ids)
Specified by:
getVersions in interface VersionManager

getVersionsUnreleased

public Collection getVersionsUnreleased(org.ofbiz.core.entity.GenericValue project,
                                        boolean includeArchived)
Specified by:
getVersionsUnreleased in interface VersionManager

getVersionsReleased

public Collection getVersionsReleased(org.ofbiz.core.entity.GenericValue project,
                                      boolean includeArchived)
Specified by:
getVersionsReleased in interface VersionManager

getVersionsReleasedDesc

public Collection getVersionsReleasedDesc(org.ofbiz.core.entity.GenericValue project,
                                          boolean includeArchived)
Specified by:
getVersionsReleasedDesc in interface VersionManager

getVersion

public Version getVersion(Long id)
Specified by:
getVersion in interface VersionManager

getVersion

public Version getVersion(org.ofbiz.core.entity.GenericValue project,
                          String versionName)
Retrieve a specific Version in a project, or null if no such version exists in that project.

Specified by:
getVersion in interface VersionManager

getVersion

public Version getVersion(Long projectId,
                          String versionName)
Retrieve a specific Version in a project given the project id, or null if no such version exists in that project.

Specified by:
getVersion in interface VersionManager

getAllAffectedIssues

public Collection getAllAffectedIssues(Collection versions)
Description copied from interface: VersionManager
Return all Issues that are assoicated with the specified versions

Specified by:
getAllAffectedIssues in interface VersionManager

getOtherVersions

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

Specified by:
getOtherVersions in interface VersionManager

getOtherUnarchivedVersions

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

Specified by:
getOtherUnarchivedVersions in interface VersionManager

getFixIssues

public Collection getFixIssues(Version version)
Description copied from interface: VersionManager
Return Fix Issues

Specified by:
getFixIssues in interface VersionManager

getAffectsIssues

public Collection getAffectsIssues(Version version)
Specified by:
getAffectsIssues in interface VersionManager

storeReorderedVersionList

public void storeReorderedVersionList(List versions)
Given a re-ordered list of versions, commit the changes to the backend datastore.



Copyright © 2002-2007 Atlassian. All Rights Reserved.