|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager
public class DefaultAtlassianBootstrapManager
Generic Bootstrap Manager using Spring & Hibernate
Field Summary | |
---|---|
protected ApplicationConfiguration |
applicationConfig
|
protected String |
bootstrapFailureReason
|
protected boolean |
bootstrapped
|
protected HibernateConfig |
hibernateConfig
|
protected HibernateConfigurator |
hibernateConfigurator
|
protected HomeLocator |
homeLocator
|
static org.apache.log4j.Logger |
log
|
protected SetupPersister |
setupPersister
|
Constructor Summary | |
---|---|
DefaultAtlassianBootstrapManager()
|
Method Summary | |
---|---|
protected void |
afterConfigurationLoaded()
Extension point for initialization performed after configuration is loaded |
void |
bootstrapDatabase(DatabaseDetails dbDetails,
boolean embedded)
Mediates the call to HibernateConfigurator's instance method, configureDatabase(dbDetails, embedded) |
void |
bootstrapDatasource(String datasourceName,
String hibernateDialect)
Mediates the call to HibernateConfigurator's instance method, configureDatasource(datasourceName, hibernateDialect) |
boolean |
databaseContainsExistingData(Connection connection)
Returns true if any of the specified tables exists, otherwise false. |
protected void |
finishBootstrapInitialisation()
Generic extension point to run before bootstrapping can be successful. |
ApplicationConfiguration |
getApplicationConfig()
|
String |
getApplicationHome()
|
String |
getBootstrapFailureReason()
|
String |
getBuildNumber()
This is the build number of the current version that the user is running under. |
String |
getConfiguredApplicationHome()
|
protected String |
getDbUrl(DatabaseDetails dbDetails)
Get the URL form the DatabaseDetails object. |
String |
getFilePathProperty(String key)
|
HibernateConfig |
getHibernateConfig()
|
HibernateConfigurator |
getHibernateConfigurator()
|
Properties |
getHibernateProperties()
Gets all hibernate properties from the config starting 'hibernate.' |
HomeLocator |
getHomeLocator()
|
String |
getOperation()
|
Map |
getPropertiesWithPrefix(String prefix)
Get a map of all properties with a given prefix. |
Object |
getProperty(String key)
Get a single property. |
Collection |
getPropertyKeys()
Retrieve all property keys. |
SetupPersister |
getSetupPersister()
|
String |
getString(String key)
Convenience method to retrieve a property as a string. |
List |
getTables()
|
Connection |
getTestDatabaseConnection(DatabaseDetails databaseDetails)
Ensure we can open a connection to the configured database. |
Connection |
getTestDatasourceConnection(String datasourceName)
Gets a test connection to the datasource. |
void |
init()
Does final initialisation of the BootstrapManager, including looking up the confluence home (Previously was the afterPropertiesSet method) |
boolean |
isApplicationHomeValid()
|
boolean |
isBootstrapped()
|
boolean |
isPropertyTrue(String prop)
|
boolean |
isSetupComplete()
This should be the first method called before any bootstrapManager logic is performed. |
protected boolean |
performPersistenceUpgrade()
Extension point for peforming custom upgardes of dB |
protected void |
postBootstrapDatabase()
Allows a custom actions to be performed after bootstrapping the database |
void |
publishConfiguration()
|
void |
removeProperty(String key)
Remove a single property. |
void |
save()
|
void |
setApplicationConfig(ApplicationConfiguration applicationConfig)
|
void |
setBuildNumber(String buildNumber)
|
void |
setHibernateConfig(HibernateConfig hibernateConfig)
|
void |
setHibernateConfigurator(HibernateConfigurator hibernateConfigurator)
|
void |
setHomeLocator(HomeLocator homeLocator)
|
void |
setOperation(String operation)
|
void |
setProperty(String key,
Object value)
Set a single property. |
void |
setSetupComplete(boolean complete)
|
void |
setSetupPersister(SetupPersister setupPersister)
|
void |
setTables(List tables)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.apache.log4j.Logger log
protected boolean bootstrapped
protected String bootstrapFailureReason
protected ApplicationConfiguration applicationConfig
protected SetupPersister setupPersister
protected HomeLocator homeLocator
protected HibernateConfigurator hibernateConfigurator
protected HibernateConfig hibernateConfig
Constructor Detail |
---|
public DefaultAtlassianBootstrapManager()
Method Detail |
---|
public void init() throws BootstrapException
AtlassianBootstrapManager
init
in interface AtlassianBootstrapManager
BootstrapException
public void publishConfiguration()
publishConfiguration
in interface AtlassianBootstrapManager
public Object getProperty(String key)
getProperty
in interface AtlassianBootstrapManager
public void setProperty(String key, Object value)
setProperty
in interface AtlassianBootstrapManager
public boolean isPropertyTrue(String prop)
isPropertyTrue
in interface AtlassianBootstrapManager
public void removeProperty(String key)
removeProperty
in interface AtlassianBootstrapManager
public String getString(String key)
getString
in interface AtlassianBootstrapManager
public String getFilePathProperty(String key)
getFilePathProperty
in interface AtlassianBootstrapManager
public Collection getPropertyKeys()
getPropertyKeys
in interface AtlassianBootstrapManager
public Map getPropertiesWithPrefix(String prefix)
getPropertiesWithPrefix
in interface AtlassianBootstrapManager
public void save() throws ConfigurationException
save
in interface AtlassianBootstrapManager
ConfigurationException
public String getConfiguredApplicationHome()
getConfiguredApplicationHome
in interface AtlassianBootstrapManager
public boolean isSetupComplete()
isSetupComplete
in interface AtlassianBootstrapManager
public void setSetupComplete(boolean complete)
setSetupComplete
in interface AtlassianBootstrapManager
public String getBuildNumber()
AtlassianBootstrapManager
getBuildNumber
in interface AtlassianBootstrapManager
public void setBuildNumber(String buildNumber)
setBuildNumber
in interface AtlassianBootstrapManager
public Properties getHibernateProperties()
getHibernateProperties
in interface AtlassianBootstrapManager
public void bootstrapDatabase(DatabaseDetails dbDetails, boolean embedded) throws BootstrapException
bootstrapDatabase
in interface AtlassianBootstrapManager
dbDetails
- - DatabaseDetails object holding connection detailsembedded
- - true if using the default Confluence database, HSQLDB
BootstrapException
public void bootstrapDatasource(String datasourceName, String hibernateDialect) throws BootstrapException
bootstrapDatasource
in interface AtlassianBootstrapManager
datasourceName
- hibernateDialect
-
BootstrapException
public Connection getTestDatabaseConnection(DatabaseDetails databaseDetails) throws BootstrapException
getTestDatabaseConnection
in interface AtlassianBootstrapManager
BootstrapException
- if the connection fails for any reason.public Connection getTestDatasourceConnection(String datasourceName) throws BootstrapException
getTestDatasourceConnection
in interface AtlassianBootstrapManager
BootstrapException
- if a connection cannot be made.public boolean databaseContainsExistingData(Connection connection)
databaseContainsExistingData
in interface AtlassianBootstrapManager
connection
- the Connection to the Db to check#setTables(List)}
public boolean isApplicationHomeValid()
isApplicationHomeValid
in interface AtlassianBootstrapManager
protected boolean performPersistenceUpgrade()
protected void finishBootstrapInitialisation() throws ConfigurationException
ConfigurationException
- is thrown if bootstrapping should failprotected String getDbUrl(DatabaseDetails dbDetails)
DatabaseDetails
object. Allows sub-classes to post-process the URL
dbDetails
-
protected void postBootstrapDatabase()
protected void afterConfigurationLoaded() throws ConfigurationException
ConfigurationException
public void setApplicationConfig(ApplicationConfiguration applicationConfig)
public void setHomeLocator(HomeLocator homeLocator)
public void setSetupPersister(SetupPersister setupPersister)
public HomeLocator getHomeLocator()
public ApplicationConfiguration getApplicationConfig()
getApplicationConfig
in interface AtlassianBootstrapManager
public String getApplicationHome()
getApplicationHome
in interface AtlassianBootstrapManager
public SetupPersister getSetupPersister()
getSetupPersister
in interface AtlassianBootstrapManager
public boolean isBootstrapped()
isBootstrapped
in interface AtlassianBootstrapManager
public String getOperation()
getOperation
in interface AtlassianBootstrapManager
public void setOperation(String operation)
setOperation
in interface AtlassianBootstrapManager
public HibernateConfigurator getHibernateConfigurator()
getHibernateConfigurator
in interface AtlassianBootstrapManager
public void setHibernateConfigurator(HibernateConfigurator hibernateConfigurator)
setHibernateConfigurator
in interface AtlassianBootstrapManager
public HibernateConfig getHibernateConfig()
getHibernateConfig
in interface AtlassianBootstrapManager
public void setHibernateConfig(HibernateConfig hibernateConfig)
public String getBootstrapFailureReason()
getBootstrapFailureReason
in interface AtlassianBootstrapManager
public List getTables()
public void setTables(List tables)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |