Package org.opennms.install
Class Installer
- java.lang.Object
-
- org.opennms.install.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()
checkServerVersionvoid
checkServerXmlOldOpennmsContext()
checkServerXmlOldOpennmsContextvoid
checkWebappOldOpennmsDir()
checkWebappOldOpennmsDirvoid
copyFile(java.lang.String source, java.lang.String destination, java.lang.String description, boolean recursive)
copyFilevoid
createConfiguredFile()
createConfiguredFilejava.lang.String
fetchProperty(java.lang.String property)
fetchPropertyjava.lang.String
findLibrary(java.lang.String libname, java.lang.String path, boolean isRequired)
findLibraryprotected java.lang.String
getRunas()
java.lang.String
getTomcatVersion(java.io.File file)
getTomcatVersionvoid
install(java.lang.String[] argv)
installvoid
installLink(java.lang.String source, java.lang.String destination, java.lang.String description, boolean recursive)
installLinkvoid
installWebApp()
installWebAppboolean
loadLibrary(java.lang.String path)
loadLibraryvoid
loadProperties()
loadPropertiesstatic void
main(java.lang.String[] argv)
mainvoid
parseArguments(java.lang.String[] argv)
parseArgumentsvoid
pingLocalhost()
pingLocalhostvoid
printHeader()
printHeaderprotected java.util.Properties
readOpennmsConf()
void
removeFile(java.lang.String destination, java.lang.String description, boolean recursive)
removeFilevoid
updateTomcatConf()
updateTomcatConfvoid
verifyFileExists(boolean isDir, java.lang.String file, java.lang.String description, java.lang.String option)
verifyFileExistsvoid
verifyFilesAndDirectories()
verifyFilesAndDirectoriesvoid
writeLibraryConfig(java.lang.String jicmp_path, java.lang.String jicmp6_path, java.lang.String jrrd_path, java.lang.String jrrd2_path)
writeLibraryConfig
-
-
-
Method Detail
-
install
public void install(java.lang.String[] argv) throws java.lang.Exception
install
- Parameters:
argv
- an array ofString
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.io.IOException
loadProperties
- Throws:
java.io.IOException
java.lang.Exception
- if any.
-
fetchProperty
public java.lang.String fetchProperty(java.lang.String property) throws java.lang.IllegalStateException
fetchProperty
- Parameters:
property
- aString
object.- Returns:
- a
String
object. - Throws:
java.lang.Exception
- if any.java.lang.IllegalStateException
-
parseArguments
public void parseArguments(java.lang.String[] argv) throws java.lang.Exception
parseArguments
- Parameters:
argv
- an array ofString
objects.- Throws:
java.lang.Exception
- if any.
-
verifyFilesAndDirectories
public void verifyFilesAndDirectories() throws java.io.IOException, java.io.FileNotFoundException, FilesystemPermissionException
verifyFilesAndDirectories
- Throws:
java.io.FileNotFoundException
- if any.java.io.IOException
FilesystemPermissionException
-
getRunas
protected java.lang.String getRunas() throws java.io.IOException
- Throws:
java.io.IOException
-
readOpennmsConf
protected java.util.Properties readOpennmsConf() throws java.io.IOException
- Throws:
java.io.IOException
-
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
- aString
object.description
- aString
object.option
- aString
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
- aString
object.destination
- aString
object.description
- aString
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
- aString
object.destination
- aString
object.description
- aString
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
- aString
object.description
- aString
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 ofString
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
- aFile
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
- aString
object.path
- aString
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
- aString
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
- aString
object.jicmp6_path
- TODOjrrd_path
- aString
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
-
-