Class AbstractModule
- java.lang.Object
 - 
- com.microstrategy.web.app.utils.upgrade.AbstractModule
 
 
- 
- All Implemented Interfaces:
 UpgradeModule
- Direct Known Subclasses:
 AbstractXMLConfigModule,CleanUpModule,CopyFilesModule,EventsModule,GenericFileModule,PropertiesModule,WebXMLModule
public abstract class AbstractModule extends java.lang.Object implements UpgradeModule
This is the based implementation of anUpgradeModule. It implements the logic to enabled/disabled the module. It also defines an abstractrun(com.microstrategy.web.app.utils.upgrade.UpgradeInfo)method that is used to trigger the module's execution.- Since:
 - MicroStrategy Web 9.0.0
 
 
- 
- 
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractModule(UpgradeManager manager)Default constructor. 
- 
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancanChangeEnabled()Default implementation, returnstrue.protected java.lang.StringgetRelativePath(java.lang.String baseDir, java.io.File file)Helper method that calculates the relative path offile, based on the givenbaseDir.protected UpgradeManagergetUpgradeManager()Returns the UpgradeManager that created this AbstractModule instance.booleanisEnabled()Whether the module is enabled.abstract voidrun(UpgradeInfo info)Method triggered to execute the module's upgrade tasks.voidsetEnabled(boolean value)Method to change the enabled status of the module.- 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface com.microstrategy.web.app.utils.upgrade.UpgradeModule
getDescription, getName 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
AbstractModule
protected AbstractModule(UpgradeManager manager)
Default constructor. Receives the UpgradeManager instantiating this AbstractModule. 
 - 
 
- 
Method Detail
- 
run
public abstract void run(UpgradeInfo info) throws UpgradeException
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.
 
- 
getUpgradeManager
protected UpgradeManager getUpgradeManager()
Returns the UpgradeManager that created this AbstractModule instance. 
- 
isEnabled
public boolean isEnabled()
Description copied from interface:UpgradeModuleWhether the module is enabled. If not enabled, the module will not be executed during the upgrade.- Specified by:
 isEnabledin interfaceUpgradeModule
 
- 
setEnabled
public void setEnabled(boolean value)
Description copied from interface:UpgradeModuleMethod to change the enabled status of the module. This method can only be invoked if theUpgradeModule.canChangeEnabled()returntrue, otherwise it will throw an IllegalArgumentException- Specified by:
 setEnabledin interfaceUpgradeModule
 
- 
canChangeEnabled
public boolean canChangeEnabled()
Default implementation, returnstrue.- Specified by:
 canChangeEnabledin interfaceUpgradeModule
 
- 
getRelativePath
protected java.lang.String getRelativePath(java.lang.String baseDir, java.io.File file) throws java.lang.IllegalArgumentExceptionHelper method that calculates the relative path of
Iffile, based on the givenbaseDir. Basically, it removes thebaseDirfrom the file's absolute path.fileis not withinbaseDir(i.e. file's absolutePath doesn't start withbaseDirit throws an IllegalArgumentException- Throws:
 java.lang.IllegalArgumentException
 
 - 
 
 -