com.atlassian.jira.config.database
Class AbstractJiraHomeDatabaseConfigurationLoader

java.lang.Object
  extended by com.atlassian.jira.config.database.AbstractJiraHomeDatabaseConfigurationLoader
All Implemented Interfaces:
DatabaseConfigurationLoader
Direct Known Subclasses:
JiraHomeDatabaseConfigurationLoader, SystemTenantDatabaseConfigurationLoader

public abstract class AbstractJiraHomeDatabaseConfigurationLoader
extends Object
implements DatabaseConfigurationLoader

Base implementation of DatabaseConfigurationLoader for loading Database Configuration from jira-home.

Since:
v4.4

Field Summary
static String FILENAME_DBCONFIG
           
 
Constructor Summary
AbstractJiraHomeDatabaseConfigurationLoader()
           
 
Method Summary
 boolean configExists()
          Returns true only if the database configuration file already exists in the JIRA home directory.
protected abstract  String getJiraHome()
           
 DatabaseConfig loadDatabaseConfiguration()
          Reads and deserialises the DatabaseConfig from its permanent store.
protected abstract  void logInfo(String message)
           
 void saveDatabaseConfiguration(DatabaseConfig config)
          Serialises and persists the given config to its permanent store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILENAME_DBCONFIG

public static final String FILENAME_DBCONFIG
See Also:
Constant Field Values
Constructor Detail

AbstractJiraHomeDatabaseConfigurationLoader

public AbstractJiraHomeDatabaseConfigurationLoader()
Method Detail

configExists

public boolean configExists()
Description copied from interface: DatabaseConfigurationLoader
Returns true only if the database configuration file already exists in the JIRA home directory.

Specified by:
configExists in interface DatabaseConfigurationLoader
Returns:
whether the config file exists.

loadDatabaseConfiguration

public DatabaseConfig loadDatabaseConfiguration()
Description copied from interface: DatabaseConfigurationLoader
Reads and deserialises the DatabaseConfig from its permanent store.

Specified by:
loadDatabaseConfiguration in interface DatabaseConfigurationLoader
Returns:
the database configuration.

saveDatabaseConfiguration

public void saveDatabaseConfiguration(DatabaseConfig config)
Description copied from interface: DatabaseConfigurationLoader
Serialises and persists the given config to its permanent store.

Specified by:
saveDatabaseConfiguration in interface DatabaseConfigurationLoader
Parameters:
config - the config to store.

getJiraHome

protected abstract String getJiraHome()
Returns:
path to jira's home
Throws:
IllegalStateException - if the JIRA home is not set.

logInfo

protected abstract void logInfo(String message)


Copyright © 2002-2012 Atlassian. All Rights Reserved.