public class JmxRrdMigratorOffline extends AbstractOnmsUpgrade
The fix for the following issues is going to break existing collected data specially for JRBs. For this reason, these files must be updated too.
Issues fixed:
AbstractOnmsUpgrade.VersionOperator| Modifier and Type | Field and Description |
|---|---|
protected List<File> |
backupFiles
Backup files.
|
protected List<String> |
badMetrics
The list of bad metrics.
|
ZIP_EXT| Constructor and Description |
|---|
JmxRrdMigratorOffline()
Instantiates a new JMX RRD migrator offline.
|
| Modifier and Type | Method and Description |
|---|---|
void |
execute()
Execute.
|
String |
getDescription()
Gets the description.
|
protected String |
getFixedDsName(String dsName)
Gets the fixed DS name.
|
protected String |
getFixedFileName(String oldFile)
Gets the fixed file name.
|
int |
getOrder()
Gets the order.
|
void |
postExecute()
Post execute.
|
void |
preExecute()
Pre-execute
|
boolean |
requiresOnmsRunning()
Requires OpenNMS running.
|
void |
rollback()
Rollback.
|
getDbConnection, getFiles, getHomeDirectory, getId, getInstalledVersion, getMainProperties, getOpennmsProductDescription, getOpennmsProductName, getOpennmsVersion, getRrdExtension, getRrdProperties, getRrdStrategy, initializeDatasource, isInstalledVersion, isInstalledVersionGreaterOrEqual, isMeridian, isRrdToolEnabled, isStoreByForeignSourceEnabled, isStoreByGroupEnabled, loadProperties, log, printFullSettings, printMainSettings, registerProperties, setProductDescription, setProductName, setVersion, unzipFile, versionToInteger, zipDir, zipFilepublic JmxRrdMigratorOffline()
throws OnmsUpgradeException
OnmsUpgradeException - the OpenNMS upgrade exceptionpublic int getOrder()
OnmsUpgradeIn order to execute all the implementations of this interface on a specify order, each implementation must return an integer for this purpose.
public String getDescription()
OnmsUpgradeThis is for informational purposes, and should contain a brief description about what is the purpose of this upgrade class.
public boolean requiresOnmsRunning()
OnmsUpgradepublic void preExecute()
throws OnmsUpgradeException
OnmsUpgradeRuns 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 exceptionpublic void postExecute()
throws OnmsUpgradeException
OnmsUpgradeRuns some clean up tasks after executing the execute() method. If something is wrong, an exception will be thrown
OnmsUpgradeException - the OpenNMS upgrade exceptionpublic void rollback()
throws OnmsUpgradeException
OnmsUpgradeRestore 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 exceptionpublic void execute()
throws OnmsUpgradeException
OnmsUpgradeThis is the main method, and this is the one where all the upgrade code must be placed.
OnmsUpgradeException - the OpenNMS upgrade exceptionprotected String getFixedDsName(String dsName)
dsName - the DS nameCopyright © 2020. All rights reserved.