com.atlassian.jira.upgrade.tasks
Class UpgradeTask_Build47

java.lang.Object
  extended bycom.atlassian.jira.upgrade.AbstractUpgradeTask
      extended bycom.atlassian.jira.upgrade.tasks.UpgradeTask_Build47
All Implemented Interfaces:
UpgradeTask

public class UpgradeTask_Build47
extends AbstractUpgradeTask


Constructor Summary
UpgradeTask_Build47()
           
 
Method Summary
 void addOldGlobalPermissionsToScheme(SchemeManager psm, int permType, GenericValue scheme)
          Given a scheme, add the old global permissions to it.
 void addOldProjectPermissionsToScheme(SchemeManager psm, int permType, GenericValue scheme, java.lang.Long project)
          Adds all project permissions to the scheme.
 void createProjectSchemes(SchemeManager psm, GenericValue defaultScheme)
          Create schemes based on project specific permissions.
 void deleteSchemeAndMoveProjects(SchemeManager psm, GenericValue schemeA, GenericValue schemeB)
          Deletes one scheme and moves projects to the other scheme
 void doUpgrade()
          Perform the upgrade.
 java.lang.String getBuildNumber()
           
 java.lang.String getShortDescription()
          A short (<50 chars) description of the upgrade action
 boolean isDuplicate(SchemeManager psm, GenericValue schemeA, GenericValue schemeB)
          Checks to see if two schemes are duplicates based on their permissions, parameters and types
 void mergeDuplicateSchemes(SchemeManager psm)
          Merges duplicate schemes.
 boolean mergeSchemeIter(SchemeManager psm, GenericValue scheme)
          Given a scheme, find any duplicates and merge them.
 
Methods inherited from class com.atlassian.jira.upgrade.AbstractUpgradeTask
addError, addErrors, addErrors, getApplicationProperties, getDelegator, getErrors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpgradeTask_Build47

public UpgradeTask_Build47()
Method Detail

getBuildNumber

public java.lang.String getBuildNumber()
Specified by:
getBuildNumber in interface UpgradeTask
Specified by:
getBuildNumber in class AbstractUpgradeTask

getShortDescription

public java.lang.String getShortDescription()
Description copied from interface: UpgradeTask
A short (<50 chars) description of the upgrade action

Specified by:
getShortDescription in interface UpgradeTask
Overrides:
getShortDescription in class AbstractUpgradeTask

doUpgrade

public void doUpgrade()
               throws java.lang.Exception
Description copied from interface: UpgradeTask
Perform the upgrade.

Specified by:
doUpgrade in interface UpgradeTask
Specified by:
doUpgrade in class AbstractUpgradeTask
Throws:
java.lang.Exception

addOldGlobalPermissionsToScheme

public void addOldGlobalPermissionsToScheme(SchemeManager psm,
                                            int permType,
                                            GenericValue scheme)
                                     throws GenericEntityException,
                                            CreateException
Given a scheme, add the old global permissions to it. This is needed as the old global permissions were part of project permissions as well.

Throws:
GenericEntityException
CreateException

addOldProjectPermissionsToScheme

public void addOldProjectPermissionsToScheme(SchemeManager psm,
                                             int permType,
                                             GenericValue scheme,
                                             java.lang.Long project)
                                      throws GenericEntityException
Adds all project permissions to the scheme. Given a project, get the project specific permissions, and add them to this scheme.

Throws:
GenericEntityException

createProjectSchemes

public void createProjectSchemes(SchemeManager psm,
                                 GenericValue defaultScheme)
                          throws GenericEntityException,
                                 CreateException
Create schemes based on project specific permissions. Get all projects and check if they have project specific permissions set up. If there are project specific permissions, then create a new scheme for it. If there are no specific permissions then associate the project with the default scheme.

Throws:
GenericEntityException
CreateException

mergeDuplicateSchemes

public void mergeDuplicateSchemes(SchemeManager psm)
                           throws java.lang.Exception
Merges duplicate schemes. The second scheme of a duplicate set will be deleted and all projects associated to that scheme will be moved to the first scheme

Throws:
java.lang.Exception

mergeSchemeIter

public boolean mergeSchemeIter(SchemeManager psm,
                               GenericValue scheme)
                        throws java.lang.Exception
Given a scheme, find any duplicates and merge them.

Throws:
java.lang.Exception

deleteSchemeAndMoveProjects

public void deleteSchemeAndMoveProjects(SchemeManager psm,
                                        GenericValue schemeA,
                                        GenericValue schemeB)
                                 throws java.lang.Exception
Deletes one scheme and moves projects to the other scheme

Parameters:
schemeA - The scheme that the projects will be moved to
schemeB - The scheme that will be deleted
Throws:
java.lang.Exception

isDuplicate

public boolean isDuplicate(SchemeManager psm,
                           GenericValue schemeA,
                           GenericValue schemeB)
                    throws GenericEntityException
Checks to see if two schemes are duplicates based on their permissions, parameters and types

Parameters:
schemeA - First scheme to compare
schemeB - Second scheme to compare
Returns:
true if the schemes are duplicates otherwise false
Throws:
GenericEntityException