Class Installer


  • public class Installer
    extends java.lang.Object

    Installer class.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.apache.commons.cli.CommandLine m_commandLine  
      protected org.apache.commons.cli.Options options  
    • Constructor Summary

      Constructors 
      Constructor Description
      Installer()
      Constructor for Installer.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String checkServerVersion()
      checkServerVersion
      void checkServerXmlOldOpennmsContext()
      checkServerXmlOldOpennmsContext
      void checkWebappOldOpennmsDir()
      checkWebappOldOpennmsDir
      void copyFile​(java.lang.String source, java.lang.String destination, java.lang.String description, boolean recursive)
      copyFile
      void createConfiguredFile()
      createConfiguredFile
      java.lang.String fetchProperty​(java.lang.String property)
      fetchProperty
      java.lang.String findLibrary​(java.lang.String libname, java.lang.String path, boolean isRequired)
      findLibrary
      java.lang.String getTomcatVersion​(java.io.File file)
      getTomcatVersion
      void install​(java.lang.String[] argv)
      install
      void installLink​(java.lang.String source, java.lang.String destination, java.lang.String description, boolean recursive)
      installLink
      void installWebApp()
      installWebApp
      boolean loadLibrary​(java.lang.String path)
      loadLibrary
      void loadProperties()
      loadProperties
      static void main​(java.lang.String[] argv)
      main
      void parseArguments​(java.lang.String[] argv)
      parseArguments
      void pingLocalhost()
      pingLocalhost
      void printHeader()
      printHeader
      void removeFile​(java.lang.String destination, java.lang.String description, boolean recursive)
      removeFile
      void updateTomcatConf()
      updateTomcatConf
      void verifyFileExists​(boolean isDir, java.lang.String file, java.lang.String description, java.lang.String option)
      verifyFileExists
      void verifyFilesAndDirectories()
      verifyFilesAndDirectories
      void writeLibraryConfig​(java.lang.String jicmp_path, java.lang.String jicmp6_path, java.lang.String jrrd_path, java.lang.String jrrd2_path)
      writeLibraryConfig
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • options

        protected org.apache.commons.cli.Options options
      • m_commandLine

        protected org.apache.commons.cli.CommandLine m_commandLine
    • Constructor Detail

      • Installer

        public Installer()

        Constructor for Installer.

    • Method Detail

      • install

        public void install​(java.lang.String[] argv)
                     throws java.lang.Exception

        install

        Parameters:
        argv - an array of String objects.
        Throws:
        java.lang.Exception - if any.
      • createConfiguredFile

        public void createConfiguredFile()
                                  throws java.io.IOException

        createConfiguredFile

        Throws:
        java.io.IOException - if any.
      • printHeader

        public void printHeader()

        printHeader

      • loadProperties

        public void loadProperties()
                            throws java.lang.Exception

        loadProperties

        Throws:
        java.lang.Exception - if any.
      • fetchProperty

        public java.lang.String fetchProperty​(java.lang.String property)
                                       throws java.lang.Exception

        fetchProperty

        Parameters:
        property - a String object.
        Returns:
        a String object.
        Throws:
        java.lang.Exception - if any.
      • parseArguments

        public void parseArguments​(java.lang.String[] argv)
                            throws java.lang.Exception

        parseArguments

        Parameters:
        argv - an array of String objects.
        Throws:
        java.lang.Exception - if any.
      • verifyFilesAndDirectories

        public void verifyFilesAndDirectories()
                                       throws java.io.FileNotFoundException

        verifyFilesAndDirectories

        Throws:
        java.io.FileNotFoundException - if any.
      • verifyFileExists

        public void verifyFileExists​(boolean isDir,
                                     java.lang.String file,
                                     java.lang.String description,
                                     java.lang.String option)
                              throws java.io.FileNotFoundException

        verifyFileExists

        Parameters:
        isDir - a boolean.
        file - a String object.
        description - a String object.
        option - a String object.
        Throws:
        java.io.FileNotFoundException - if any.
      • checkWebappOldOpennmsDir

        public void checkWebappOldOpennmsDir()
                                      throws java.lang.Exception

        checkWebappOldOpennmsDir

        Throws:
        java.lang.Exception - if any.
      • checkServerXmlOldOpennmsContext

        public void checkServerXmlOldOpennmsContext()
                                             throws java.lang.Exception

        checkServerXmlOldOpennmsContext

        Throws:
        java.lang.Exception - if any.
      • installWebApp

        public void installWebApp()
                           throws java.lang.Exception

        installWebApp

        Throws:
        java.lang.Exception - if any.
      • copyFile

        public void copyFile​(java.lang.String source,
                             java.lang.String destination,
                             java.lang.String description,
                             boolean recursive)
                      throws java.lang.Exception

        copyFile

        Parameters:
        source - a String object.
        destination - a String object.
        description - a String object.
        recursive - a boolean.
        Throws:
        java.lang.Exception - if any.
      • installLink

        public void installLink​(java.lang.String source,
                                java.lang.String destination,
                                java.lang.String description,
                                boolean recursive)
                         throws java.lang.Exception

        installLink

        Parameters:
        source - a String object.
        destination - a String object.
        description - a String object.
        recursive - a boolean.
        Throws:
        java.lang.Exception - if any.
      • updateTomcatConf

        public void updateTomcatConf()
                              throws java.lang.Exception

        updateTomcatConf

        Throws:
        java.lang.Exception - if any.
      • removeFile

        public void removeFile​(java.lang.String destination,
                               java.lang.String description,
                               boolean recursive)
                        throws java.io.IOException,
                               java.lang.InterruptedException,
                               java.lang.Exception

        removeFile

        Parameters:
        destination - a String object.
        description - a String object.
        recursive - a boolean.
        Throws:
        java.io.IOException - if any.
        java.lang.InterruptedException - if any.
        java.lang.Exception - if any.
      • main

        public static void main​(java.lang.String[] argv)
                         throws java.lang.Exception

        main

        Parameters:
        argv - an array of String objects.
        Throws:
        java.lang.Exception - if any.
      • checkServerVersion

        public java.lang.String checkServerVersion()
                                            throws java.io.IOException

        checkServerVersion

        Returns:
        a String object.
        Throws:
        java.io.IOException - if any.
      • getTomcatVersion

        public java.lang.String getTomcatVersion​(java.io.File file)
                                          throws java.io.IOException

        getTomcatVersion

        Parameters:
        file - a File object.
        Returns:
        a String object.
        Throws:
        java.io.IOException - if any.
      • findLibrary

        public java.lang.String findLibrary​(java.lang.String libname,
                                            java.lang.String path,
                                            boolean isRequired)
                                     throws java.lang.Exception

        findLibrary

        Parameters:
        libname - a String object.
        path - a String object.
        isRequired - a boolean.
        Returns:
        a String object.
        Throws:
        java.lang.Exception - if any.
      • loadLibrary

        public boolean loadLibrary​(java.lang.String path)

        loadLibrary

        Parameters:
        path - a String object.
        Returns:
        a boolean.
      • writeLibraryConfig

        public void writeLibraryConfig​(java.lang.String jicmp_path,
                                       java.lang.String jicmp6_path,
                                       java.lang.String jrrd_path,
                                       java.lang.String jrrd2_path)
                                throws java.io.IOException

        writeLibraryConfig

        Parameters:
        jicmp_path - a String object.
        jicmp6_path - TODO
        jrrd_path - a String object.
        Throws:
        java.io.IOException - if any.
      • pingLocalhost

        public void pingLocalhost()
                           throws java.lang.Exception

        pingLocalhost

        Throws:
        java.io.IOException - if any.
        java.lang.Exception