com.atlassian.jira.upgrade.tasks
Class UpgradeTask_Build47

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

public class UpgradeTask_Build47
extends AbstractUpgradeTask


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.jira.upgrade.UpgradeTask
UpgradeTask.Status
 
Constructor Summary
UpgradeTask_Build47(PermissionSchemeManager psm, SchemePermissions schemePermissions)
           
 
Method Summary
 void addOldGlobalPermissionsToScheme(SchemeManager psm, int permType, org.ofbiz.core.entity.GenericValue scheme)
          Given a scheme, add the old global permissions to it.
 void addOldProjectPermissionsToScheme(SchemeManager psm, int permType, org.ofbiz.core.entity.GenericValue scheme, Long project)
          Adds all project permissions to the scheme.
 void createProjectSchemes(SchemeManager psm, org.ofbiz.core.entity.GenericValue defaultScheme)
          Create schemes based on project specific permissions.
 void deleteSchemeAndMoveProjects(SchemeManager psm, org.ofbiz.core.entity.GenericValue schemeA, org.ofbiz.core.entity.GenericValue schemeB)
          Deletes one scheme and moves projects to the other scheme
 void doUpgrade(boolean setupMode)
          Perform the upgrade.
 String getBuildNumber()
           
 String getShortDescription()
          A short (<50 chars) description of the upgrade action
 boolean isDuplicate(SchemeManager psm, org.ofbiz.core.entity.GenericValue schemeA, org.ofbiz.core.entity.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, org.ofbiz.core.entity.GenericValue scheme)
          Given a scheme, find any duplicates and merge them.
 
Methods inherited from class com.atlassian.jira.upgrade.AbstractUpgradeTask
addError, addErrors, addErrors, convertToSchemaTableName, getApplicationProperties, getDatabaseConnection, getDelegator, getErrors, getI18nBean, isReindexRequired
 
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(PermissionSchemeManager psm,
                           SchemePermissions schemePermissions)
Method Detail

getBuildNumber

public String getBuildNumber()
Specified by:
getBuildNumber in interface UpgradeTask
Specified by:
getBuildNumber in class AbstractUpgradeTask
Returns:
The build number that this upgrade is applicable to

getShortDescription

public 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(boolean setupMode)
               throws Exception
Description copied from interface: UpgradeTask
Perform the upgrade.

Specified by:
doUpgrade in interface UpgradeTask
Specified by:
doUpgrade in class AbstractUpgradeTask
Parameters:
setupMode - Indicating this upgrade task is running during set up.
Throws:
Exception

addOldGlobalPermissionsToScheme

public void addOldGlobalPermissionsToScheme(SchemeManager psm,
                                            int permType,
                                            org.ofbiz.core.entity.GenericValue scheme)
                                     throws org.ofbiz.core.entity.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:
org.ofbiz.core.entity.GenericEntityException
CreateException

addOldProjectPermissionsToScheme

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

Throws:
org.ofbiz.core.entity.GenericEntityException

createProjectSchemes

public void createProjectSchemes(SchemeManager psm,
                                 org.ofbiz.core.entity.GenericValue defaultScheme)
                          throws org.ofbiz.core.entity.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:
org.ofbiz.core.entity.GenericEntityException
CreateException

mergeDuplicateSchemes

public void mergeDuplicateSchemes(SchemeManager psm)
                           throws 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:
Exception

mergeSchemeIter

public boolean mergeSchemeIter(SchemeManager psm,
                               org.ofbiz.core.entity.GenericValue scheme)
                        throws Exception
Given a scheme, find any duplicates and merge them.

Throws:
Exception

deleteSchemeAndMoveProjects

public void deleteSchemeAndMoveProjects(SchemeManager psm,
                                        org.ofbiz.core.entity.GenericValue schemeA,
                                        org.ofbiz.core.entity.GenericValue schemeB)
                                 throws 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:
Exception

isDuplicate

public boolean isDuplicate(SchemeManager psm,
                           org.ofbiz.core.entity.GenericValue schemeA,
                           org.ofbiz.core.entity.GenericValue schemeB)
                    throws org.ofbiz.core.entity.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:
org.ofbiz.core.entity.GenericEntityException


Copyright © 2002-2011 Atlassian. All Rights Reserved.