edu.udo.cs.miningmart.installer
Class MmInstallerTools

java.lang.Object
  extended by edu.udo.cs.miningmart.installer.MmInstallerTools

public class MmInstallerTools
extends java.lang.Object

Author:
Timm Euler A class that handles creating and updating the M4 schema.

Field Summary
static boolean debugInstallation
           
 
Constructor Summary
MmInstallerTools(DB myM4Db)
          The constructor gets the DB connection object needed to access the M4 database schema.
 
Method Summary
 boolean checkM4Extension()
          This method checks if ROLES are present in the M4 schema.
static java.lang.String createHomePropertiesFile(java.lang.String homeDirectory)
          Creates the file MiningMartHome.properties and sets the system property "MM_HOME" into the file.
 void createM4Tables(java.lang.String fileNameAndPath)
          This method assumes that no M4 tables exist in the database.
static boolean doInstallation(java.lang.String possibleHomeDirectory)
           
static void endDebugMessaging()
           
 void ensureM4Extension(java.lang.String fileNameWithExtensions)
          This method ensures that ROLES are present in the M4 schema.
static void ensureOperatorsAreInserted()
           
static boolean installationIsValid()
           
 void installM4Sequence()
           
static java.util.HashMap makeDbConfigFile(java.lang.String nameForDbConfigFile, java.lang.String homePropertiesFileName, java.util.HashMap initialValues)
          A method to create a syntactically valid db.config file from information given by the user.
static boolean makeNewDbConnection(boolean dbConfigOk, java.util.HashMap connectionValues, java.lang.String dbFileName, java.lang.String propertiesFile)
           
static void prepareExtraDebugMessageLogFile(java.lang.String path)
           
static void printDebugMessage(java.lang.String what)
           
static void readSystemPropsFromHomeProperties(java.lang.String propFilename)
           
 void removeM4Sequence()
           
 void removeM4Tables()
          This method ensures that all M4 tables are removed.
static java.util.HashMap storeValuesFromFileInMap(ConfigReader theReader)
           
 void writeOperatorsIntoSchema(java.lang.String fileAndPathWithOperatorInfo)
          This method assumes that the M4 tables exist in the database, and updates the information about the operators (in the static part of M4) according to the SQL commands in the file whose name and path are given.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debugInstallation

public static final boolean debugInstallation
See Also:
Constant Field Values
Constructor Detail

MmInstallerTools

public MmInstallerTools(DB myM4Db)
                 throws M4Exception
The constructor gets the DB connection object needed to access the M4 database schema.

Throws:
M4Exception
Method Detail

installationIsValid

public static boolean installationIsValid()

doInstallation

public static boolean doInstallation(java.lang.String possibleHomeDirectory)

makeNewDbConnection

public static boolean makeNewDbConnection(boolean dbConfigOk,
                                          java.util.HashMap connectionValues,
                                          java.lang.String dbFileName,
                                          java.lang.String propertiesFile)

storeValuesFromFileInMap

public static java.util.HashMap storeValuesFromFileInMap(ConfigReader theReader)

prepareExtraDebugMessageLogFile

public static void prepareExtraDebugMessageLogFile(java.lang.String path)

printDebugMessage

public static void printDebugMessage(java.lang.String what)

endDebugMessaging

public static void endDebugMessaging()

createHomePropertiesFile

public static java.lang.String createHomePropertiesFile(java.lang.String homeDirectory)
Creates the file MiningMartHome.properties and sets the system property "MM_HOME" into the file. The Db config property will be set to a nonexisting filename.

Parameters:
homeDirectory - complete path of the MiningMart home directory
Returns:
the complete path and name of the created file

readSystemPropsFromHomeProperties

public static void readSystemPropsFromHomeProperties(java.lang.String propFilename)

makeDbConfigFile

public static java.util.HashMap makeDbConfigFile(java.lang.String nameForDbConfigFile,
                                                 java.lang.String homePropertiesFileName,
                                                 java.util.HashMap initialValues)
A method to create a syntactically valid db.config file from information given by the user.

Parameters:
nameForDbConfigFile - name and path of file to be written
homePropertiesFileName - name and path of file with global properties
initialValues - DB connection values to display initially in the window for the user. Can be null.
Returns:
null if any error occurred, otherwise a Map with the values of the connection

removeM4Tables

public void removeM4Tables()
                    throws M4Exception
This method ensures that all M4 tables are removed.

Throws:
M4Exception

writeOperatorsIntoSchema

public void writeOperatorsIntoSchema(java.lang.String fileAndPathWithOperatorInfo)
                              throws M4Exception
This method assumes that the M4 tables exist in the database, and updates the information about the operators (in the static part of M4) according to the SQL commands in the file whose name and path are given.

Parameters:
fileAndPathWithOperatorInfo - name and path of a file with SQL commands
Throws:
M4Exception

ensureOperatorsAreInserted

public static void ensureOperatorsAreInserted()

createM4Tables

public void createM4Tables(java.lang.String fileNameAndPath)
                    throws M4Exception
This method assumes that no M4 tables exist in the database. It creates them if the file whose name and path are given contains the commands for creating them.

Parameters:
fileNameAndPath - name and path of a file with SQL commands
Throws:
M4Exception

ensureM4Extension

public void ensureM4Extension(java.lang.String fileNameWithExtensions)
                       throws M4Exception
This method ensures that ROLES are present in the M4 schema.

Throws:
M4Exception

checkM4Extension

public boolean checkM4Extension()
                         throws M4Exception
This method checks if ROLES are present in the M4 schema.

Throws:
M4Exception

removeM4Sequence

public void removeM4Sequence()
                      throws M4Exception
Throws:
M4Exception

installM4Sequence

public void installM4Sequence()
                       throws M4Exception
Throws:
M4Exception


Copyright © 2001-2005