public abstract class

AbstractModule

extends Object
implements UpgradeModule
java.lang.Object
   ↳ com.microstrategy.web.app.utils.upgrade.AbstractModule
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

This is the based implementation of an UpgradeModule. It implements the logic to enabled/disabled the module. It also defines an abstract run(UpgradeInfo) method that is used to trigger the module's execution.

Summary

Protected Constructors
AbstractModule(UpgradeManager manager)
Default constructor.
Public Methods
boolean canChangeEnabled()
Default implementation, returns true.
boolean isEnabled()
Whether the module is enabled.
abstract void run(UpgradeInfo info)
Method triggered to execute the module's upgrade tasks.
void setEnabled(boolean value)
Method to change the enabled status of the module.
Protected Methods
String getRelativePath(String baseDir, File file)

Helper method that calculates the relative path of file, based on the given baseDir.

UpgradeManager getUpgradeManager()
Returns the UpgradeManager that created this AbstractModule instance.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.microstrategy.web.app.utils.upgrade.UpgradeModule

Protected Constructors

protected AbstractModule (UpgradeManager manager)

Default constructor. Receives the UpgradeManager instantiating this AbstractModule.

Public Methods

public boolean canChangeEnabled ()

Default implementation, returns true.

public boolean isEnabled ()

Whether the module is enabled. If not enabled, the module will not be executed during the upgrade.

public abstract void run (UpgradeInfo info)

Method triggered to execute the module's upgrade tasks.

Parameters
info upgrade information.
Throws
UpgradeException when an unexpected error that prevents the module to cotinue occurs. Other errors should simply be logged.

public void setEnabled (boolean value)

Method to change the enabled status of the module. This method can only be invoked if the canChangeEnabled() return true, otherwise it will throw an IllegalArgumentException

Protected Methods

protected String getRelativePath (String baseDir, File file)

Helper method that calculates the relative path of file, based on the given baseDir. Basically, it removes the baseDir from the file's absolute path.

If file is not within baseDir (i.e. file's absolutePath doesn't start with baseDir it throws an IllegalArgumentException

Throws
IllegalArgumentException

protected UpgradeManager getUpgradeManager ()

Returns the UpgradeManager that created this AbstractModule instance.