public class

UpgradeManager

extends Object
java.lang.Object
   ↳ com.microstrategy.web.app.utils.upgrade.UpgradeManager

Class Overview

The UpgradeManager is the class responsible to perform an upgrade. It manages a list of UpgradeModule instances. Each module has a name and a description that can be used for informative purpose. Most of them, can be programatically disabled before running the upgrade. Users can check which modules can be disabled by checking the module's canChangeEnabled() method.

To run an upgrade, first create and populate an UpgradeInfo instance. On the UpgradeInfo specify the base folder (that is, the location of the out-of-the-box Microstrategy Web version being upgraded), the customization folder (that is, the location of the customized version of Microstrategy Web being upgraded), the target folder (that is, the location of the new Microstrategy Web version), and the name of the plugin where the changes will be saved. This UpgradeInfo is then passed to the run(UpgradeInfo) method, which will loop through each one of its modules and execute those that are enabled.

The following is an example of how an upgrade can be performed:

public void upgrade() throws Exception { UpgradeManager um = new UpgradeManager(); UpgradeInfo info = new UpgradeInfo( "c:\\Program Files\\Microstrategy Web 8.0.2\\", "c:\\Program Files\\Custom Microstrategy Web\\", "c:\\Program Files\\Microstrategy Web\\", "Upgrade"); try { um.run(info); } catch (UpgradeException e) { e.printStackTrace(); System.out.println(e.getMessage()); } Once the upgrade is complete and successfull (i.e. no UpgradeException is thrown, this class provides a method to list the all the messages that were logged as part of the upgrade process (getMessages()); it also provides helper method to list only errors, (getErrors(), warnings (getWarnings(), or information messages (getInfo().

Summary

Constants
char RELATIVE_PATH_CHAR
char TEMP_PATH_CHAR
String UPGRADE_MARK
Public Constructors
UpgradeManager(String customFolder)
Default no-arg constructor.
Public Methods
LogRecord[] getErrors()
Returns the list of all error messages logged during the upgrade.
LogRecord[] getInfo()
Returns the list of all info messages logged during the upgrade.
static Logger getLogger()
Returns the Logger class used by this package.
LogRecord[] getMessages()
Returns the list of all messages logged during the upgrade.
UpgradeModule[] getUpgradeModules()
Returns the list of available modules.
LogRecord[] getWarnings()
Returns the list of all warning messages logged during the upgrade.
synchronized void run(UpgradeInfo info)
Performs the upgrade.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final char RELATIVE_PATH_CHAR

Constant Value: 47 (0x0000002f)

public static final char TEMP_PATH_CHAR

Constant Value: 64 (0x00000040)

public static final String UPGRADE_MARK

Constant Value: ".mstr-upgrade"

Public Constructors

public UpgradeManager (String customFolder)

Default no-arg constructor.

Public Methods

public LogRecord[] getErrors ()

Returns the list of all error messages logged during the upgrade.

public LogRecord[] getInfo ()

Returns the list of all info messages logged during the upgrade.

public static Logger getLogger ()

Returns the Logger class used by this package. Users can then attach handlers and filters to this Logger programatically to keep track of messages being logged during the upgrade.

public LogRecord[] getMessages ()

Returns the list of all messages logged during the upgrade.

public UpgradeModule[] getUpgradeModules ()

Returns the list of available modules.

public LogRecord[] getWarnings ()

Returns the list of all warning messages logged during the upgrade.

public synchronized void run (UpgradeInfo info)

Performs the upgrade. Basically, it loops through each one of its modules and execute those modules that are enabled

Parameters
info UpgradeInfo class with information about the folders to upgrade.
Throws
UpgradeException if any unexpected error occurs during the upgrade.