public interface DatabaseConfigurationManager
Modifier and Type | Method and Description |
---|---|
void |
activateDatabase()
Initialises the first connection to the database and causes each enqueued runnable that registered with
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 databaseConfiguration)
Persists the given config as JIRA's database configuration.
|
void setDatabaseConfiguration(DatabaseConfig databaseConfiguration)
databaseConfiguration
- the config to use for JIRA's database connection.RuntimeException
- if the database configuration is wrong.DatabaseConfig getDatabaseConfiguration()
RuntimeException
- if the database has not been configured or the config can't be read.void doNowOrWhenDatabaseActivated(Runnable runnable, String desc)
activateDatabase()
. Then it will be done in the thread
that calls activateDatabase()
.
Callers can be sure that the database schema will already be updated to fit the model when the given runnable is run.
runnable
- The work that must be done if or when the database is activated.desc
- A description (for logging purposes) of the work.void doNowOrWhenDatabaseConfigured(Runnable runnable, String desc)
activateDatabase()
. Then it will be done in
the thread that calls 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.
runnable
- The work that must be done if or when the database is configured.desc
- A description (for logging purposes) of the work.boolean isDatabaseSetup()
void activateDatabase()
doNowOrWhenDatabaseActivated(Runnable, String)
to be run. Should only be run once per application boot.void activateDatabaseWithoutRunningPostDbSetupRunnables()
void runPostDbSetupRunnables()
DatabaseConfig getInternalDatabaseConfiguration()
DatabaseConfig
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.void createDbConfigFromEntityDefinition()
Copyright © 2002-2021 Atlassian. All Rights Reserved.