Interface OnmsUpgrade
-
- All Known Implementing Classes:
AbstractOnmsUpgrade
,DataCollectionConfigMigrator17Offline
,DataCollectionConfigMigratorOffline
,DiscoveryConfigurationLocationMigratorOffline
,DiscoveryConfigurationMigratorOffline
,EOLServiceConfigMigratorOffline
,EventParameterMigratorOffline
,JettyConfigMigratorOffline
,JmxRrdMigratorOffline
,KscReportsMigrator
,MagicUsersMigratorOffline
,RemotePollerServiceConfigMigratorOffline
,RequisitionsMigratorOffline
,ServiceConfig1701MigratorOffline
,ServiceConfigMigratorOffline
,SnmpInterfaceRrdMigratorOnline
,VmwareAssetsMigratorOffline
public interface OnmsUpgrade
The Interface OnmsUpgrade.All the post-processing scripts must implement this class.
- Author:
- Alejandro Galue
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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-executeboolean
requiresOnmsRunning()
Requires OpenNMS running.void
rollback()
Rollback.
-
-
-
Method Detail
-
getOrder
int getOrder()
Gets the order.In order to execute all the implementations of this interface on a specify order, each implementation must return an integer for this purpose.
- Returns:
- the order
-
getId
String getId()
Gets the id.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.
- Returns:
- the id
-
getDescription
String getDescription()
Gets the description.This is for informational purposes, and should contain a brief description about what is the purpose of this upgrade class.
- Returns:
- the description
-
preExecute
void preExecute() throws OnmsUpgradeException
Pre-executeRuns 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.
- Throws:
OnmsUpgradeException
- the OpenNMS upgrade exception
-
postExecute
void postExecute() throws OnmsUpgradeException
Post execute.Runs some clean up tasks after executing the execute() method. If something is wrong, an exception will be thrown
- Throws:
OnmsUpgradeException
- the OpenNMS upgrade exception
-
rollback
void rollback() throws OnmsUpgradeException
Rollback.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.
- Throws:
OnmsUpgradeException
- the onms upgrade exception
-
execute
void execute() throws OnmsUpgradeException
Execute.This is the main method, and this is the one where all the upgrade code must be placed.
- Throws:
OnmsUpgradeException
- the OpenNMS upgrade exception
-
requiresOnmsRunning
boolean requiresOnmsRunning()
Requires OpenNMS running.- Returns:
- true, if OpenNMS must be running to execute this upgrade or false if OpenNMS must be stopped.
-
-