|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cmu.jspsurveymanager.data.DatabaseObjectStorage
public class DatabaseObjectStorage
Field Summary | |
---|---|
static short |
PERMISSION_ALL
|
Constructor Summary | |
---|---|
DatabaseObjectStorage()
You must call connect() after this to connect before doing anything. |
Method Summary | |
---|---|
void |
close()
Closes the database connection to free resources. |
boolean |
connect(WebappConfiguration webappConfiguration)
|
boolean |
createDatabase(java.lang.String databaseName)
|
void |
createDatabaseUser(java.lang.String username,
java.lang.String password)
|
boolean |
deleteDatabase(java.lang.String databaseName)
|
void |
deleteDatabaseUser(java.lang.String username)
|
boolean |
doesDatabaseExist(java.lang.String databaseName)
|
java.util.List |
getActiveUsers(java.lang.String db)
Returns the list of users currently wokring with the given database, db. |
AdminStorage |
getAdminStorage()
|
HasKeyValues |
getConnectionKeyValues(java.lang.String serverDomainName,
java.lang.String databaseName,
java.lang.String username,
java.lang.String password)
|
java.lang.String |
getConnectionString(java.lang.String serverDomainName,
java.lang.String databaseName,
java.lang.String user,
java.lang.String password)
|
java.lang.String |
getDatabaseProgramName()
Returns the name of this database program. |
java.lang.String |
getHelpURL()
Returns a URL with help about installing, starting, and stopping this database program. |
java.lang.String |
getSurveysDir()
Directory that new surveys should be copied into, ending with a slash. |
SurveyStorage |
getSurveyStorage()
|
java.lang.String |
getSystemLoginMessage()
Announcement messages for the login page. |
java.lang.String |
getSystemMOTD()
Announcement messages for the home page. |
java.lang.String |
getTomcatDirectory()
|
TomcatManagerConnection |
getTomcatManagerConnection(java.lang.String possibleTomcatPath)
|
boolean |
initializeSurveyDatabase(java.lang.String databaseName)
|
java.lang.String |
isLabelValid(java.lang.String labelString)
If it's a valid string for a name of a database, it returns null. |
void |
renameDatabaseUser(java.lang.String username,
java.lang.String newUsername)
|
boolean |
revokeDatabasePermissions(java.lang.String title,
java.lang.String user,
short permLevel)
Revoke database-level permissions (if applicable) for a user. |
boolean |
setDatabasePermissions(java.lang.String title,
java.lang.String user,
short permLevel)
Sets database-level permissions (if applicable) for a user. |
void |
setTomcatDirectory(java.lang.String newTomcatDirectory)
|
void |
updateDatabaseUser(java.lang.String username,
java.lang.String password)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final short PERMISSION_ALL
Constructor Detail |
---|
public DatabaseObjectStorage()
Method Detail |
---|
public boolean connect(WebappConfiguration webappConfiguration)
public void close()
public java.lang.String getDatabaseProgramName()
public java.lang.String getHelpURL()
public java.lang.String getSystemLoginMessage()
public java.lang.String getSystemMOTD()
public java.lang.String getSurveysDir()
public java.lang.String getTomcatDirectory()
public void setTomcatDirectory(java.lang.String newTomcatDirectory)
public TomcatManagerConnection getTomcatManagerConnection(java.lang.String possibleTomcatPath) throws java.lang.Exception
java.lang.Exception
public boolean doesDatabaseExist(java.lang.String databaseName)
public boolean createDatabase(java.lang.String databaseName)
public boolean deleteDatabase(java.lang.String databaseName)
public java.lang.String getConnectionString(java.lang.String serverDomainName, java.lang.String databaseName, java.lang.String user, java.lang.String password)
public HasKeyValues getConnectionKeyValues(java.lang.String serverDomainName, java.lang.String databaseName, java.lang.String username, java.lang.String password)
public boolean initializeSurveyDatabase(java.lang.String databaseName)
public java.lang.String isLabelValid(java.lang.String labelString)
labelString
-
public AdminStorage getAdminStorage()
public SurveyStorage getSurveyStorage()
public boolean setDatabasePermissions(java.lang.String title, java.lang.String user, short permLevel) throws java.lang.IllegalArgumentException
title
- The name of the database.you
- The Admin to configure permissions for.permLevel
- The permission level to provide (see constants).
java.lang.IllegalArgumentException
public boolean revokeDatabasePermissions(java.lang.String title, java.lang.String user, short permLevel) throws java.lang.IllegalArgumentException
title
- The name of the database.you
- The Admin to configure permissions for.permLevel
- The permission level to revoke (see constants).
java.lang.IllegalArgumentException
public void createDatabaseUser(java.lang.String username, java.lang.String password)
username
- password
- public void updateDatabaseUser(java.lang.String username, java.lang.String password)
username
- password
- public void renameDatabaseUser(java.lang.String username, java.lang.String newUsername)
public void deleteDatabaseUser(java.lang.String username)
username
- public java.util.List getActiveUsers(java.lang.String db)
the
- database in question, or null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |