public interface OnmsUpgrade
All the post-processing scripts must implement this class.
Modifier and Type | Method and Description |
---|---|
void |
execute()
Execute.
|
String |
getDescription()
Gets the description.
|
String |
getId()
Gets the id.
|
int |
getOrder()
Gets the order.
|
void |
postExecute()
Post execute.
|
void |
preExecute()
Pre-execute
|
boolean |
requiresOnmsRunning()
Requires OpenNMS running.
|
void |
rollback()
Rollback.
|
int getOrder()
In order to execute all the implementations of this interface on a specify order, each implementation must return an integer for this purpose.
String getId()
This is for informational purposes, and will be used to store the execution status.
It is recommended to use the class-name, but any other text can be used.
String getDescription()
This is for informational purposes, and should contain a brief description about what is the purpose of this upgrade class.
void preExecute() throws OnmsUpgradeException
Runs some checks to ensure that what it would execute() would work. If something is missing, an exception will be thrown
Execute backups of the JRBs/RRDs if they are going to be modified.
OnmsUpgradeException
- the OpenNMS upgrade exceptionvoid postExecute() throws OnmsUpgradeException
Runs some clean up tasks after executing the execute() method. If something is wrong, an exception will be thrown
OnmsUpgradeException
- the OpenNMS upgrade exceptionvoid rollback() throws OnmsUpgradeException
Restore the initial state of the OpenNMS files if something went wrong while running the execute() method.
Must restore the backups of the files if necessary.
OnmsUpgradeException
- the onms upgrade exceptionvoid execute() throws OnmsUpgradeException
This is the main method, and this is the one where all the upgrade code must be placed.
OnmsUpgradeException
- the OpenNMS upgrade exceptionboolean requiresOnmsRunning()
Copyright © 2021. All rights reserved.