public class DatabaseConfigurationManagerImpl extends Object implements DatabaseConfigurationManager
DatabaseConfigurationLoader. Caches configuration.| Constructor and Description |
|---|
DatabaseConfigurationManagerImpl(JiraHome jiraHome,
DatabaseConfigurationLoader databaseConfigLoader,
ComponentLocator componentLocator) |
| Modifier and Type | Method and Description |
|---|---|
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 |
activateDatabaseWithoutRunningPostDbSetupRunnables() |
void |
createDbConfigFromEntityDefinition()
Creates a new dbconfig.xml using the values in entityengine.xml if there are any
Allows for upgrade from pre 5.0 instances
|
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 |
runPostDbSetupRunnables() |
void |
setDatabaseConfiguration(DatabaseConfig databaseConfig)
Persists the given config as JIRA's database configuration.
|
public DatabaseConfigurationManagerImpl(JiraHome jiraHome, DatabaseConfigurationLoader databaseConfigLoader, ComponentLocator componentLocator)
public void setDatabaseConfiguration(DatabaseConfig databaseConfig)
DatabaseConfigurationManagersetDatabaseConfiguration in interface DatabaseConfigurationManagerdatabaseConfig - the config to use for JIRA's database connection.public void createDbConfigFromEntityDefinition()
DatabaseConfigurationManagercreateDbConfigFromEntityDefinition in interface DatabaseConfigurationManagerpublic DatabaseConfig getDatabaseConfiguration()
DatabaseConfigurationManagergetDatabaseConfiguration in interface DatabaseConfigurationManagerpublic 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()
DatabaseConfigurationManagerisDatabaseSetup in interface DatabaseConfigurationManagerpublic void activateDatabase()
DatabaseConfigurationManagerDatabaseConfigurationManager.doNowOrWhenDatabaseActivated(Runnable, String) to be run. Should only be run once per application boot.activateDatabase in interface DatabaseConfigurationManagerpublic void activateDatabaseWithoutRunningPostDbSetupRunnables()
activateDatabaseWithoutRunningPostDbSetupRunnables in interface DatabaseConfigurationManagerpublic void runPostDbSetupRunnables()
runPostDbSetupRunnables 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 DatabaseConfigurationManagerCopyright © 2002-2018 Atlassian. All Rights Reserved.