Class RequisitionsMigratorOffline

  • All Implemented Interfaces:
    OnmsUpgrade

    public class RequisitionsMigratorOffline
    extends AbstractOnmsUpgrade
    The Class Requisitions Migrator.

    The attributes non-ip-snmp-primary and non-ip-interfaces which are valid in 1.10 have been removed in 1.12.

    This tool will parse the raw requisitions XML and remove those tags.

    Issues fixed:

    • NMS-5630
    • NMS-5571
    Author:
    Alejandro Galue
    • Constructor Detail

      • RequisitionsMigratorOffline

        public RequisitionsMigratorOffline()
                                    throws OnmsUpgradeException
        Instantiates a new requisitions 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-execute

        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.

        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