Package org.opennms.upgrade.support
Class Upgrade
- java.lang.Object
-
- org.opennms.upgrade.support.Upgrade
-
public class Upgrade extends Object
The Class Upgrade.This is the helper class that is going to be instantiated from outside OpenNMS to perform the upgrade operations.
- Author:
- Alejandro Galue
-
-
Constructor Summary
Constructors Constructor Description Upgrade()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
getUpgradeStatus
public UpgradeStatus getUpgradeStatus() throws OnmsUpgradeException
Gets the upgrade status.- Returns:
- the upgrade status
- Throws:
OnmsUpgradeException
- the OpenNMS upgrade exception
-
setUpgradeStatus
public void setUpgradeStatus(UpgradeStatus upgradeStatus)
Sets the upgrade status.- Parameters:
upgradeStatus
- the new upgrade status
-
getClassScope
public String getClassScope()
Gets the class scope.- Returns:
- the class scope
-
setClassScope
public void setClassScope(String classScope)
Sets the class scope.- Parameters:
classScope
- the new class scope
-
isOpennmsRunning
protected boolean isOpennmsRunning()
Checks if is OpenNMS running.- Returns:
- true, if is OpenNMS running
-
wasExecuted
protected boolean wasExecuted(OnmsUpgrade upg) throws OnmsUpgradeException
Was executed.- Parameters:
upg
- the upgrade implementation class- Returns:
- true, if successful
- Throws:
OnmsUpgradeException
- the OpenNMS upgrade exception
-
executeUpgrade
protected void executeUpgrade(OnmsUpgrade upg)
Execute upgrade.- Parameters:
upg
- the upgrade implementation class
-
markAsExecuted
protected void markAsExecuted(OnmsUpgrade upg) throws OnmsUpgradeException
Mark as executed.- Parameters:
upg
- the upgrade implementation class- Throws:
OnmsUpgradeException
- the OpenNMS upgrade exception
-
log
protected void log(String msgFormat, Object... args)
Log.- Parameters:
msgFormat
- the message formatargs
- the message's arguments
-
getUpgradeObjects
protected List<OnmsUpgrade> getUpgradeObjects() throws OnmsUpgradeException
Gets the upgrade objects.- Returns:
- the upgrade objects
- Throws:
OnmsUpgradeException
- the OpenNMS upgrade exception
-
execute
public void execute() throws OnmsUpgradeException
Execute.Perform the upgrade operations.
- Throws:
OnmsUpgradeException
- the OpenNMS upgrade exception
-
main
public static void main(String[] args) throws OnmsUpgradeException
The main method.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 file- Parameters:
args
- the arguments- Throws:
OnmsUpgradeException
- the OpenNMS upgrade exception
-
-