public class InstallerDb extends Object
Constructor and Description |
---|
InstallerDb()
Constructor for InstallerDb.
|
Modifier and Type | Method and Description |
---|---|
void |
addStoredProcedures()
addStoredProcedures
|
void |
checkTime() |
void |
checkUnicode()
checkUnicode
|
static String |
cleanText(List<String> list)
cleanText
|
void |
closeConnection()
closeConnection
|
void |
createSequences()
createSequences
|
void |
createTables()
createTables
|
void |
createViews() |
void |
databaseRemoveDB()
databaseRemoveDB
|
void |
databaseSetUser()
databaseSetUser
|
void |
disconnect()
Close all connections to the database.
|
List<Column> |
getColumnsFromDB(String tableName)
getColumnsFromDB
|
List<Constraint> |
getConstraintsFromDB(String tableName)
getConstraintsFromDB
|
String |
getCreateSqlLocation()
getCreateSqlLocation
|
int |
getDbMajorVersion()
getDbMajorVersion
|
String |
getStoredProcedureDirectory()
getStoredProcedureDirectory
|
List<Column> |
getTableColumnsFromDB(String tableName)
getTableColumnsFromDB
|
List<Column> |
getTableColumnsFromSQL(String tableName)
getTableColumnsFromSQL
|
String |
getTableCreateFromSQL(String table)
getTableCreateFromSQL
|
Table |
getTableFromDB(String tableName)
getTableFromDB
|
Table |
getTableFromSQL(String tableName)
getTableFromSQL
|
void |
insertData()
insertData
|
void |
insertData(String table) |
boolean |
isIpLikeUsable()
isIpLikeUsable
|
void |
readTables()
readTables
|
void |
readTables(Reader reader)
readTables
|
void |
setAdminDataSource(DataSource dataSource)
setAdminDataSource
|
void |
setCreateSqlLocation(String createSqlLocation)
setCreateSqlLocation
|
void |
setDatabaseName(String name)
setDatabaseName
|
void |
setDataSource(DataSource dataSource)
setDataSource
|
void |
setDebug(boolean debug)
setDebug
|
void |
setForce(boolean force)
setForce
|
void |
setIgnoreNotNull(boolean ignoreNotNull)
setIgnoreNotNull
|
void |
setNoRevert(boolean noRevert)
setNoRevert
|
void |
setOutputStream(PrintStream out)
setOutputStream
|
void |
setPostgresIpLikeLocation(String location)
setPostgresIpLikeLocation
|
void |
setPostgresOpennmsUser(String user)
setPostgresOpennmsUser
|
void |
setPostgresPlPgsqlLocation(String location)
setPostgresPlPgsqlLocation
|
void |
setStoredProcedureDirectory(String directory)
setStoredProcedureDirectory
|
void |
setupPlPgsqlIplike()
setupPlPgsqlIplike
|
void |
updateIplike()
updateIplike
|
void |
updatePlPgsql()
updatePlPgsql
|
void |
vacuumDatabase(boolean full)
vacuumDatabase
|
public void createSequences() throws Exception
createSequences
Exception
- if any.public void updatePlPgsql() throws Exception
updatePlPgsql
Exception
- if any.public boolean isIpLikeUsable()
isIpLikeUsable
public void setupPlPgsqlIplike() throws Exception
setupPlPgsqlIplike
Exception
- if any.public void addStoredProcedures() throws Exception
addStoredProcedures
Exception
- if any.public int getDbMajorVersion() throws Exception
getDbMajorVersion
Exception
- if any.public List<Column> getTableColumnsFromDB(String tableName) throws Exception
getTableColumnsFromDB
public List<Column> getColumnsFromDB(String tableName) throws Exception
getColumnsFromDB
public List<Constraint> getConstraintsFromDB(String tableName) throws SQLException, Exception
getConstraintsFromDB
tableName
- a String
object.List
object.SQLException
- if any.Exception
- if any.public void databaseSetUser() throws SQLException
databaseSetUser
SQLException
- if any.public void databaseRemoveDB() throws SQLException
databaseRemoveDB
SQLException
- if any.public List<Column> getTableColumnsFromSQL(String tableName) throws Exception
getTableColumnsFromSQL
public String getTableCreateFromSQL(String table) throws Exception
getTableCreateFromSQL
public void closeConnection() throws SQLException
closeConnection
SQLException
- if any.public void disconnect() throws SQLException
SQLException
- if any.public void setCreateSqlLocation(String createSqlLocation)
setCreateSqlLocation
createSqlLocation
- a String
object.public String getCreateSqlLocation()
getCreateSqlLocation
String
object.public void setOutputStream(PrintStream out)
setOutputStream
out
- a PrintStream
object.public void setStoredProcedureDirectory(String directory)
setStoredProcedureDirectory
directory
- a String
object.public String getStoredProcedureDirectory()
getStoredProcedureDirectory
String
object.public void setDataSource(DataSource dataSource)
setDataSource
dataSource
- a DataSource
object.public void setAdminDataSource(DataSource dataSource)
setAdminDataSource
dataSource
- a DataSource
object.public void setForce(boolean force)
setForce
force
- a boolean.public void setDebug(boolean debug)
setDebug
debug
- a boolean.public void setIgnoreNotNull(boolean ignoreNotNull)
setIgnoreNotNull
ignoreNotNull
- a boolean.public void setDatabaseName(String name)
setDatabaseName
name
- a String
object.public void setNoRevert(boolean noRevert)
setNoRevert
noRevert
- a boolean.public void setPostgresOpennmsUser(String user)
setPostgresOpennmsUser
user
- a String
object.public void setPostgresIpLikeLocation(String location)
setPostgresIpLikeLocation
location
- a String
object.public void setPostgresPlPgsqlLocation(String location)
setPostgresPlPgsqlLocation
location
- a String
object.public void vacuumDatabase(boolean full) throws SQLException
vacuumDatabase
full
- a boolean.SQLException
- if any.Copyright © 2020. All rights reserved.