|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.jira.config.database.DatabaseConfigurationManagerImpl
public class DatabaseConfigurationManagerImpl
A threadsafe implementation which reads and writes configuration for the database using the given
DatabaseConfigurationLoader. Caches configuration.
| Constructor Summary | |
|---|---|
DatabaseConfigurationManagerImpl(JiraHome jiraHome,
DatabaseConfigurationLoader databaseConfigLoader,
ComponentLocator componentLocator)
|
|
| Method Summary | |
|---|---|
void |
activateDatabase()
Initialises the first connection to the database and causes each enqueued runnable that registered with DatabaseConfigurationManager.doNowOrWhenDatabaseActivated(Runnable, String) to be run. |
void |
doNowOrWhenDatabaseActivated(Runnable runnable,
String desc)
Requests that work that needs to read from and write to the database be done. |
void |
doNowOrWhenDatabaseConfigured(Runnable runnable,
String desc)
Requests that work dependent on the database configuration be done. |
DatabaseConfig |
getDatabaseConfiguration()
Gets the current database configuration. |
DatabaseConfig |
getInternalDatabaseConfiguration()
Provides the DatabaseConfig that represents the embedded JIRA database. |
boolean |
isDatabaseSetup()
Returns true only if the database configuration is available. |
void |
setDatabaseConfiguration(DatabaseConfig databaseConfiguration)
Persists the given config as JIRA's database configuration. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DatabaseConfigurationManagerImpl(JiraHome jiraHome,
DatabaseConfigurationLoader databaseConfigLoader,
ComponentLocator componentLocator)
| Method Detail |
|---|
public void setDatabaseConfiguration(DatabaseConfig databaseConfiguration)
DatabaseConfigurationManager
setDatabaseConfiguration in interface DatabaseConfigurationManagerdatabaseConfiguration - the config to use for JIRA's database connection.public DatabaseConfig getDatabaseConfiguration()
DatabaseConfigurationManager
getDatabaseConfiguration in interface DatabaseConfigurationManager
public void doNowOrWhenDatabaseActivated(Runnable runnable,
String desc)
DatabaseConfigurationManagerDatabaseConfigurationManager.activateDatabase(). Then it will be done in the thread
that calls DatabaseConfigurationManager.activateDatabase().
Callers can be sure that the database schema will already be updated to fit the model when the given runnable is
run.
doNowOrWhenDatabaseActivated in interface DatabaseConfigurationManagerrunnable - The work that must be done if or when the database is activated.desc - A description (for logging purposes) of the work.
public void doNowOrWhenDatabaseConfigured(Runnable runnable,
String desc)
DatabaseConfigurationManagerDatabaseConfigurationManager.activateDatabase(). Then it will be done in
the thread that calls DatabaseConfigurationManager.activateDatabase().
The puropse of this method is to execute tasks that want to check or read the database configuration before the
schema is modified to fit the current model.
doNowOrWhenDatabaseConfigured in interface DatabaseConfigurationManagerrunnable - The work that must be done if or when the database is configured.desc - A description (for logging purposes) of the work.public boolean isDatabaseSetup()
DatabaseConfigurationManager
isDatabaseSetup in interface DatabaseConfigurationManagerpublic void activateDatabase()
DatabaseConfigurationManagerDatabaseConfigurationManager.doNowOrWhenDatabaseActivated(Runnable, String) to be run. Should only be run once per application boot.
activateDatabase in interface DatabaseConfigurationManagerpublic DatabaseConfig getInternalDatabaseConfiguration()
DatabaseConfigurationManagerDatabaseConfig that represents the embedded JIRA database. This does not imply that this
config is current or that there is any current configuration for the JIRA database.
getInternalDatabaseConfiguration in interface DatabaseConfigurationManager
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||