Class UpgradeManager
- java.lang.Object
-
- com.microstrategy.web.app.utils.upgrade.UpgradeManager
-
public class UpgradeManager extends java.lang.ObjectThe UpgradeManager is the class responsible to perform an upgrade. It manages a list of
UpgradeModuleinstances. 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'scanChangeEnabled()method.To run an upgrade, first create and populate an
UpgradeInfoinstance. On theUpgradeInfospecify 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. ThisUpgradeInfois then passed to therun(com.microstrategy.web.app.utils.upgrade.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) { System.out.println(e.getMessage()); } Once the upgrade is complete and successfull (i.e. noUpgradeExceptionis 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().- Since:
- MicroStrategy Web 9.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static charRELATIVE_PATH_CHARstatic charTEMP_PATH_CHARstatic java.lang.StringUPGRADE_MARK
-
Constructor Summary
Constructors Constructor Description UpgradeManager(java.lang.String customFolder)Default no-arg constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 LoggergetLogger()Returns theLoggerclass 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.voidrun(UpgradeInfo info)Performs the upgrade.
-
-
-
Field Detail
-
TEMP_PATH_CHAR
public static final char TEMP_PATH_CHAR
- See Also:
- Constant Field Values
-
RELATIVE_PATH_CHAR
public static final char RELATIVE_PATH_CHAR
- See Also:
- Constant Field Values
-
UPGRADE_MARK
public static final java.lang.String UPGRADE_MARK
- See Also:
- Constant Field Values
-
-
Method Detail
-
getUpgradeModules
public UpgradeModule[] getUpgradeModules()
Returns the list of available modules.
-
run
public void run(UpgradeInfo info) throws UpgradeException
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.
-
getLogger
public static Logger getLogger()
Returns theLoggerclass 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.
-
getMessages
public LogRecord[] getMessages()
Returns the list of all messages logged during the upgrade.
-
getErrors
public LogRecord[] getErrors()
Returns the list of all error messages logged during the upgrade.
-
getWarnings
public LogRecord[] getWarnings()
Returns the list of all warning messages logged during the upgrade.
-
getInfo
public LogRecord[] getInfo()
Returns the list of all info messages logged during the upgrade.
-
-