org.opennms.install
Class Installer
java.lang.Object
org.opennms.install.Installer
- public class Installer
- extends java.lang.Object
Method Summary |
void |
addStoredProcedures()
|
void |
changeTable(java.lang.String table,
java.util.List oldColumns,
java.util.List newColumns)
|
void |
checkConstraints()
|
void |
checkOldTables()
|
void |
checkServerXmlOldOpennmsContext()
|
void |
checkUnicode()
|
void |
checkWebappOldOpennmsDir()
|
static java.lang.String |
cleanText(java.util.List list)
|
void |
createConfiguredFile()
|
void |
createIndexes()
|
void |
createSequences()
|
void |
createTables()
|
void |
databaseAddDB()
|
void |
databaseAddUser()
|
void |
databaseCheckLanguage()
|
void |
databaseCheckVersion()
|
void |
databaseConnect(java.lang.String database)
|
boolean |
databaseDBExists()
|
void |
databaseDisconnect()
|
boolean |
databaseUserExists()
|
java.lang.String |
fetchProperty(java.lang.String property)
|
Column |
findColumn(java.util.List columns,
java.lang.String column)
|
void |
fixConstraint()
|
void |
fixData()
|
boolean |
functionExists(java.lang.String function,
int[] columnTypes,
int retType)
|
boolean |
functionExists(java.lang.String function,
java.lang.String columns,
java.lang.String returnType)
|
java.lang.String |
getForeignConstraintWhere(java.lang.String table,
java.lang.String column,
java.lang.String ftable,
java.lang.String fcolumn)
|
java.lang.String[][] |
getForeignKeyConstraints()
|
java.lang.String |
getFunctionFromSQL(java.lang.String function)
|
java.lang.String |
getIndexFromSQL(java.lang.String index)
|
java.lang.String |
getLanguageFromSQL(java.lang.String language)
|
java.lang.String |
getNextArg(java.lang.String[] argv,
int i,
char letter)
|
java.util.List |
getTableColumnsFromDB(java.lang.String table)
|
java.util.List |
getTableColumnsFromSQL(java.lang.String table)
|
java.lang.String |
getTableFromSQL(java.lang.String table)
|
java.util.Map |
getTypesFromDB()
|
java.lang.String |
getXFromSQL(java.lang.String item,
java.lang.String regex,
int itemGroup,
int returnGroup,
java.lang.String description)
|
(package private) void |
insertData()
|
void |
install(java.lang.String[] argv)
|
void |
installLink(java.lang.String source,
java.lang.String destination,
java.lang.String description,
boolean recursive)
|
void |
installWebApp()
|
static java.lang.String |
join(java.lang.String sep,
java.lang.String[] array)
Join all of the elements of a String together into a single string,
inserting sep between each element. |
void |
loadProperties()
|
static void |
main(java.lang.String[] argv)
|
void |
parseArguments(java.lang.String[] argv)
|
void |
printDiagnostics()
|
void |
printHeader()
|
void |
printHelp()
|
void |
readTables()
|
void |
readTables(java.io.Reader reader)
|
void |
removeFile(java.lang.String destination,
java.lang.String description,
boolean recursive)
|
boolean |
tableColumnExists(java.lang.String table,
java.lang.String column)
|
boolean |
tableExists(java.lang.String table)
|
void |
transformData(java.lang.String table,
java.lang.String oldTable,
java.util.TreeMap columnChanges,
java.lang.String[] oldColumnNames)
|
void |
updateIplike()
|
void |
updatePlPgsql()
|
void |
updateTomcatConf()
|
void |
verifyFileExists(boolean isDir,
java.lang.String file,
java.lang.String description,
java.lang.String option)
|
void |
verifyFilesAndDirectories()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
POSTGRES_MIN_VERSION
static final float POSTGRES_MIN_VERSION
- See Also:
- Constant Field Values
s_version
static final java.lang.String s_version
- See Also:
- Constant Field Values
s_fetch_size
static final int s_fetch_size
- See Also:
- Constant Field Values
m_opennms_home
java.lang.String m_opennms_home
m_update_database
boolean m_update_database
m_do_inserts
boolean m_do_inserts
m_update_iplike
boolean m_update_iplike
m_update_unicode
boolean m_update_unicode
m_install_webapp
boolean m_install_webapp
m_fix_constraint
boolean m_fix_constraint
m_force
boolean m_force
m_debug
boolean m_debug
m_ignore_notnull
boolean m_ignore_notnull
m_no_revert
boolean m_no_revert
m_pg_driver
java.lang.String m_pg_driver
m_pg_url
java.lang.String m_pg_url
m_pg_user
java.lang.String m_pg_user
m_pg_pass
java.lang.String m_pg_pass
m_pg_bindir
java.lang.String m_pg_bindir
m_user
java.lang.String m_user
m_pass
java.lang.String m_pass
m_database
java.lang.String m_database
m_sql_dir
java.lang.String m_sql_dir
m_create_sql
java.lang.String m_create_sql
m_pg_iplike
java.lang.String m_pg_iplike
m_tomcat_conf
java.lang.String m_tomcat_conf
m_webappdir
java.lang.String m_webappdir
m_tomcatserverlibdir
java.lang.String m_tomcatserverlibdir
m_install_webappsdir
java.lang.String m_install_webappsdir
m_tomcat_serverlibs
java.lang.String m_tomcat_serverlibs
m_fix_constraint_name
java.lang.String m_fix_constraint_name
m_fix_constraint_remove_rows
boolean m_fix_constraint_remove_rows
m_seqmapping
java.util.HashMap m_seqmapping
m_tables
java.util.LinkedList m_tables
m_sequences
java.util.LinkedList m_sequences
m_indexes
java.util.LinkedList m_indexes
m_inserts
java.util.HashMap m_inserts
m_drops
java.util.HashSet m_drops
m_changed
java.util.HashSet m_changed
m_pg_version
float m_pg_version
m_cascade
java.lang.String m_cascade
m_sql
java.lang.String m_sql
m_out
java.io.PrintStream m_out
m_properties
java.util.Properties m_properties
m_dbconnection
java.sql.Connection m_dbconnection
m_dbtypes
java.util.Map m_dbtypes
m_required_options
java.lang.String m_required_options
Installer
public Installer()
install
public void install(java.lang.String[] argv)
throws java.lang.Exception
- Throws:
java.lang.Exception
createConfiguredFile
public void createConfiguredFile()
throws java.io.IOException
- Throws:
java.io.IOException
printHeader
public void printHeader()
loadProperties
public void loadProperties()
throws java.lang.Exception
- Throws:
java.lang.Exception
fetchProperty
public java.lang.String fetchProperty(java.lang.String property)
throws java.lang.Exception
- Throws:
java.lang.Exception
parseArguments
public void parseArguments(java.lang.String[] argv)
throws java.lang.Exception
- Throws:
java.lang.Exception
getNextArg
public java.lang.String getNextArg(java.lang.String[] argv,
int i,
char letter)
throws java.lang.Exception
- Throws:
java.lang.Exception
printDiagnostics
public void printDiagnostics()
readTables
public void readTables()
throws java.lang.Exception
- Throws:
java.lang.Exception
readTables
public void readTables(java.io.Reader reader)
throws java.lang.Exception
- Throws:
java.lang.Exception
databaseConnect
public void databaseConnect(java.lang.String database)
throws java.lang.Exception
- Throws:
java.lang.Exception
databaseDisconnect
public void databaseDisconnect()
throws java.lang.Exception
- Throws:
java.lang.Exception
databaseCheckVersion
public void databaseCheckVersion()
throws java.lang.Exception
- Throws:
java.lang.Exception
databaseCheckLanguage
public void databaseCheckLanguage()
throws java.lang.Exception
- Throws:
java.lang.Exception
checkOldTables
public void checkOldTables()
throws java.lang.Exception
- Throws:
java.lang.Exception
getForeignKeyConstraints
public java.lang.String[][] getForeignKeyConstraints()
throws java.lang.Exception
- Throws:
java.lang.Exception
checkConstraints
public void checkConstraints()
throws java.lang.Exception
- Throws:
java.lang.Exception
getForeignConstraintWhere
public java.lang.String getForeignConstraintWhere(java.lang.String table,
java.lang.String column,
java.lang.String ftable,
java.lang.String fcolumn)
throws java.lang.Exception
- Throws:
java.lang.Exception
fixConstraint
public void fixConstraint()
throws java.lang.Exception
- Throws:
java.lang.Exception
databaseUserExists
public boolean databaseUserExists()
throws java.sql.SQLException
- Throws:
java.sql.SQLException
databaseAddUser
public void databaseAddUser()
throws java.sql.SQLException
- Throws:
java.sql.SQLException
databaseDBExists
public boolean databaseDBExists()
throws java.sql.SQLException
- Throws:
java.sql.SQLException
databaseAddDB
public void databaseAddDB()
throws java.lang.Exception
- Throws:
java.lang.Exception
createSequences
public void createSequences()
throws java.lang.Exception
- Throws:
java.lang.Exception
createTables
public void createTables()
throws java.lang.Exception
- Throws:
java.lang.Exception
createIndexes
public void createIndexes()
throws java.lang.Exception
- Throws:
java.lang.Exception
getTypesFromDB
public java.util.Map getTypesFromDB()
throws java.sql.SQLException
- Throws:
java.sql.SQLException
fixData
public void fixData()
throws java.lang.Exception
- Throws:
java.lang.Exception
insertData
void insertData()
throws java.lang.Exception
- Throws:
java.lang.Exception
checkUnicode
public void checkUnicode()
throws java.lang.Exception
- Throws:
java.lang.Exception
verifyFilesAndDirectories
public void verifyFilesAndDirectories()
throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
verifyFileExists
public void verifyFileExists(boolean isDir,
java.lang.String file,
java.lang.String description,
java.lang.String option)
throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
addStoredProcedures
public void addStoredProcedures()
throws java.lang.Exception
- Throws:
java.lang.Exception
functionExists
public boolean functionExists(java.lang.String function,
java.lang.String columns,
java.lang.String returnType)
throws java.lang.Exception
- Throws:
java.lang.Exception
functionExists
public boolean functionExists(java.lang.String function,
int[] columnTypes,
int retType)
throws java.lang.Exception
- Throws:
java.lang.Exception
checkWebappOldOpennmsDir
public void checkWebappOldOpennmsDir()
throws java.lang.Exception
- Throws:
java.lang.Exception
checkServerXmlOldOpennmsContext
public void checkServerXmlOldOpennmsContext()
throws java.lang.Exception
- Throws:
java.lang.Exception
installWebApp
public void installWebApp()
throws java.lang.Exception
- Throws:
java.lang.Exception
installLink
public void installLink(java.lang.String source,
java.lang.String destination,
java.lang.String description,
boolean recursive)
throws java.lang.Exception
- Throws:
java.lang.Exception
updateTomcatConf
public void updateTomcatConf()
throws java.lang.Exception
- Throws:
java.lang.Exception
removeFile
public void removeFile(java.lang.String destination,
java.lang.String description,
boolean recursive)
throws java.io.IOException,
java.lang.InterruptedException,
java.lang.Exception
- Throws:
java.io.IOException
java.lang.InterruptedException
java.lang.Exception
updateIplike
public void updateIplike()
throws java.lang.Exception
- Throws:
java.lang.Exception
updatePlPgsql
public void updatePlPgsql()
throws java.lang.Exception
- Throws:
java.lang.Exception
findColumn
public Column findColumn(java.util.List columns,
java.lang.String column)
getXFromSQL
public java.lang.String getXFromSQL(java.lang.String item,
java.lang.String regex,
int itemGroup,
int returnGroup,
java.lang.String description)
throws java.lang.Exception
- Throws:
java.lang.Exception
getTableFromSQL
public java.lang.String getTableFromSQL(java.lang.String table)
throws java.lang.Exception
- Throws:
java.lang.Exception
getIndexFromSQL
public java.lang.String getIndexFromSQL(java.lang.String index)
throws java.lang.Exception
- Throws:
java.lang.Exception
getFunctionFromSQL
public java.lang.String getFunctionFromSQL(java.lang.String function)
throws java.lang.Exception
- Throws:
java.lang.Exception
getLanguageFromSQL
public java.lang.String getLanguageFromSQL(java.lang.String language)
throws java.lang.Exception
- Throws:
java.lang.Exception
getTableColumnsFromSQL
public java.util.List getTableColumnsFromSQL(java.lang.String table)
throws java.lang.Exception
- Throws:
java.lang.Exception
cleanText
public static java.lang.String cleanText(java.util.List list)
tableExists
public boolean tableExists(java.lang.String table)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
tableColumnExists
public boolean tableColumnExists(java.lang.String table,
java.lang.String column)
throws java.lang.Exception
- Throws:
java.lang.Exception
getTableColumnsFromDB
public java.util.List getTableColumnsFromDB(java.lang.String table)
throws java.lang.Exception
- Throws:
java.lang.Exception
changeTable
public void changeTable(java.lang.String table,
java.util.List oldColumns,
java.util.List newColumns)
throws java.lang.Exception
- Throws:
java.lang.Exception
transformData
public void transformData(java.lang.String table,
java.lang.String oldTable,
java.util.TreeMap columnChanges,
java.lang.String[] oldColumnNames)
throws java.sql.SQLException,
java.text.ParseException,
java.lang.Exception
- Throws:
java.sql.SQLException
java.text.ParseException
java.lang.Exception
printHelp
public void printHelp()
main
public static void main(java.lang.String[] argv)
throws java.lang.Exception
- Throws:
java.lang.Exception
join
public static java.lang.String join(java.lang.String sep,
java.lang.String[] array)
- Join all of the elements of a String together into a single string,
inserting sep between each element.
Generated by eevans on May 29 2005 2015.