Class JmxRrdMigratorOffline
- java.lang.Object
-
- org.opennms.upgrade.api.AbstractOnmsUpgrade
-
- org.opennms.upgrade.implementations.JmxRrdMigratorOffline
-
- All Implemented Interfaces:
OnmsUpgrade
public class JmxRrdMigratorOffline extends AbstractOnmsUpgrade
The Class RRD/JRB Migrator for JMX Collector.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:
- NMS-1539
- NMS-3485
- NMS-4592
- NMS-4612
- NMS-5247
- NMS-5279
- NMS-5824
- NMS-8507
- Author:
- Alejandro Galue
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opennms.upgrade.api.AbstractOnmsUpgrade
AbstractOnmsUpgrade.VersionOperator
-
-
Field Summary
Fields Modifier and Type Field Description protected List<File>
backupFiles
Backup files.protected List<String>
badMetrics
The list of bad metrics.-
Fields inherited from class org.opennms.upgrade.api.AbstractOnmsUpgrade
ZIP_EXT
-
-
Constructor Summary
Constructors Constructor Description JmxRrdMigratorOffline()
Instantiates a new JMX RRD migrator offline.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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-executeboolean
requiresOnmsRunning()
Requires OpenNMS running.void
rollback()
Rollback.-
Methods inherited from class org.opennms.upgrade.api.AbstractOnmsUpgrade
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, zipFile
-
-
-
-
Constructor Detail
-
JmxRrdMigratorOffline
public JmxRrdMigratorOffline() throws OnmsUpgradeException
Instantiates a new JMX RRD migrator offline.- Throws:
OnmsUpgradeException
- the OpenNMS upgrade exception
-
-
Method Detail
-
getOrder
public int getOrder()
Description copied from interface:OnmsUpgrade
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
-
getDescription
public String getDescription()
Description copied from interface:OnmsUpgrade
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
-
requiresOnmsRunning
public boolean requiresOnmsRunning()
Description copied from interface:OnmsUpgrade
Requires OpenNMS running.- Returns:
- true, if OpenNMS must be running to execute this upgrade or false if OpenNMS must be stopped.
-
preExecute
public void preExecute() throws OnmsUpgradeException
Description copied from interface:OnmsUpgrade
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
public void postExecute() throws OnmsUpgradeException
Description copied from interface:OnmsUpgrade
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
public void rollback() throws OnmsUpgradeException
Description copied from interface:OnmsUpgrade
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
public void execute() throws OnmsUpgradeException
Description copied from interface:OnmsUpgrade
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
-
getFixedDsName
protected String getFixedDsName(String dsName)
Gets the fixed DS name.- Parameters:
dsName
- the DS name- Returns:
- the fixed DS name
-
-