java.lang.Object | |
↳ | com.microstrategy.web.app.utils.upgrade.UpgradeManager |
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()
.
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Default no-arg constructor.
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.
Returns the list of all warning messages logged during the upgrade.
Performs the upgrade. Basically, it loops through each one of its modules and execute those modules that are enabled
info | UpgradeInfo class with information about the folders to upgrade. |
---|
UpgradeException | if any unexpected error occurs during the upgrade. |
---|