Class Upgrade


  • public class Upgrade
    extends java.lang.Object
    The Class Upgrade.

    This is the helper class that is going to be instantiated from outside OpenNMS to perform the upgrade operations.

    Author:
    Alejandro Galue
    • Constructor Detail

      • Upgrade

        public Upgrade()
    • Method Detail

      • setUpgradeStatus

        public void setUpgradeStatus​(UpgradeStatus upgradeStatus)
        Sets the upgrade status.
        Parameters:
        upgradeStatus - the new upgrade status
      • getClassScope

        public java.lang.String getClassScope()
        Gets the class scope.
        Returns:
        the class scope
      • setClassScope

        public void setClassScope​(java.lang.String classScope)
        Sets the class scope.
        Parameters:
        classScope - the new class scope
      • isOpennmsRunning

        protected boolean isOpennmsRunning()
        Checks if is OpenNMS running.
        Returns:
        true, if is OpenNMS running
      • executeUpgrade

        protected void executeUpgrade​(OnmsUpgrade upg)
        Execute upgrade.
        Parameters:
        upg - the upgrade implementation class
      • log

        protected void log​(java.lang.String msgFormat,
                           java.lang.Object... args)
        Log.
        Parameters:
        msgFormat - the message format
        args - the message's arguments
      • main

        public static void main​(java.lang.String[] args)
                         throws OnmsUpgradeException
        The main method.

        This is the class that must be called externally to perform the upgrade.

        TODO: be able to pass the class scope (package filter) TODO: be able to pass the execution status file
        Parameters:
        args - the arguments
        Throws:
        OnmsUpgradeException - the OpenNMS upgrade exception