|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.ucsb.nceas.metacat.admin.MetacatAdmin
edu.ucsb.nceas.metacat.admin.DBAdmin
public class DBAdmin
Control the display of the database configuration page and the processing of the configuration values.
| Field Summary | |
|---|---|
static int |
DB_DOES_NOT_EXIST
|
static int |
TABLES_DO_NOT_EXIST
|
static int |
TABLES_EXIST
|
static int |
VERSION_ACTIVE
|
static int |
VERSION_INACTIVE
|
| Method Summary | |
|---|---|
void |
configureDatabase(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handle configuration of the database the first time that Metacat starts or when it is explicitly called. |
int |
getDBStatus()
Performs a status check on the database. |
DBVersion |
getDBVersion()
Get the version of the database as a string |
static DBAdmin |
getInstance()
Get the single instance of DBAdmin. |
DBVersion |
getUnRegisteredDBVersion()
Finds the version of the database for a database that does not have a dbVersion table yet. |
java.util.Vector<java.lang.String> |
getUpdateScripts()
Creates a list of database update script names by looking at the database version and the metacat version and then getting any script that is inbetween the two (inclusive of metacat version). |
java.util.Vector<java.lang.String> |
loadSQLFromFile(java.lang.String sqlFileName)
Very basic utility to read sql from a file and return a vector of the individual sql statements. |
void |
runSQLFile(java.lang.String sqlFileName)
Runs the commands in a sql script. |
void |
updateDBVersion()
Updates the version of the database. |
void |
upgradeDatabase()
Iterates through the list of scripts that need to be run to upgrade the database and calls runSQLFile on each. |
java.lang.String |
validateDBConnectivity(java.lang.String dbDriver,
java.lang.String connection,
java.lang.String user,
java.lang.String password)
Validate connectivity to the database. |
protected java.util.Vector<java.lang.String> |
validateOptions(javax.servlet.http.HttpServletRequest request)
Validate the most important configuration options submitted by the user. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DB_DOES_NOT_EXIST
public static final int TABLES_DO_NOT_EXIST
public static final int TABLES_EXIST
public static final int VERSION_INACTIVE
public static final int VERSION_ACTIVE
| Method Detail |
|---|
public static DBAdmin getInstance()
throws AdminException
AdminException
public void configureDatabase(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws AdminException
request - the http request informationresponse - the http response to be sent back to the client
AdminException
public int getDBStatus()
throws java.sql.SQLException,
edu.ucsb.nceas.utilities.PropertyNotFoundException
java.sql.SQLException
edu.ucsb.nceas.utilities.PropertyNotFoundException
public DBVersion getDBVersion()
throws AdminException
AdminException
public DBVersion getUnRegisteredDBVersion()
throws AdminException,
java.sql.SQLException
AdminException
java.sql.SQLException
public void updateDBVersion()
throws java.sql.SQLException
java.sql.SQLException
public java.lang.String validateDBConnectivity(java.lang.String dbDriver,
java.lang.String connection,
java.lang.String user,
java.lang.String password)
dbDriver - the database driverconnection - the jdbc connection stringuser - the user namepassword - the login password
public java.util.Vector<java.lang.String> getUpdateScripts()
throws AdminException
AdminException
public void upgradeDatabase()
throws AdminException
AdminException
public void runSQLFile(java.lang.String sqlFileName)
throws AdminException,
java.sql.SQLException
sqlFileName - the name of the file holding the sql statements that need to
get run.
AdminException
java.sql.SQLException
public java.util.Vector<java.lang.String> loadSQLFromFile(java.lang.String sqlFileName)
throws java.io.IOException
sqlFileName - the name of the file to read.
java.io.IOExceptionprotected java.util.Vector<java.lang.String> validateOptions(javax.servlet.http.HttpServletRequest request)
validateOptions in class MetacatAdmin
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||