public class Upgrade extends Object
This is the helper class that is going to be instantiated from outside OpenNMS to perform the upgrade operations.
| Constructor and Description | 
|---|
Upgrade()  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
execute()
Execute. 
 | 
protected void | 
executeUpgrade(OnmsUpgrade upg)
Execute upgrade. 
 | 
String | 
getClassScope()
Gets the class scope. 
 | 
protected List<OnmsUpgrade> | 
getUpgradeObjects()
Gets the upgrade objects. 
 | 
UpgradeStatus | 
getUpgradeStatus()
Gets the upgrade status. 
 | 
protected boolean | 
isOpennmsRunning()
Checks if is OpenNMS running. 
 | 
protected void | 
log(String msgFormat,
   Object... args)
Log. 
 | 
static void | 
main(String[] args)
The main method. 
 | 
protected void | 
markAsExecuted(OnmsUpgrade upg)
Mark as executed. 
 | 
void | 
setClassScope(String classScope)
Sets the class scope. 
 | 
void | 
setUpgradeStatus(UpgradeStatus upgradeStatus)
Sets the upgrade status. 
 | 
protected boolean | 
wasExecuted(OnmsUpgrade upg)
Was executed. 
 | 
public UpgradeStatus getUpgradeStatus() throws OnmsUpgradeException
OnmsUpgradeException - the OpenNMS upgrade exceptionpublic void setUpgradeStatus(UpgradeStatus upgradeStatus)
upgradeStatus - the new upgrade statuspublic String getClassScope()
public void setClassScope(String classScope)
classScope - the new class scopeprotected boolean isOpennmsRunning()
protected boolean wasExecuted(OnmsUpgrade upg) throws OnmsUpgradeException
upg - the upgrade implementation classOnmsUpgradeException - the OpenNMS upgrade exceptionprotected void executeUpgrade(OnmsUpgrade upg)
upg - the upgrade implementation classprotected void markAsExecuted(OnmsUpgrade upg) throws OnmsUpgradeException
upg - the upgrade implementation classOnmsUpgradeException - the OpenNMS upgrade exceptionprotected void log(String msgFormat, Object... args)
msgFormat - the message formatargs - the message's argumentsprotected List<OnmsUpgrade> getUpgradeObjects() throws OnmsUpgradeException
OnmsUpgradeException - the OpenNMS upgrade exceptionpublic void execute()
             throws OnmsUpgradeException
Perform the upgrade operations.
OnmsUpgradeException - the OpenNMS upgrade exceptionpublic static void main(String[] args) throws OnmsUpgradeException
This is the class that must be called externally to perform the upgrade.
TODO: be able to pass the class scope (package filter) TODO: be able to pass the execution status fileargs - the argumentsOnmsUpgradeException - the OpenNMS upgrade exceptionCopyright © 2021. All rights reserved.