|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.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 AtlassianBootstrapManagerBootstrapExceptionpublic void publishConfiguration()
publishConfiguration in interface AtlassianBootstrapManagerpublic Object getProperty(String key)
getProperty in interface AtlassianBootstrapManager
public void setProperty(String key,
Object value)
setProperty in interface AtlassianBootstrapManagerpublic boolean isPropertyTrue(String prop)
isPropertyTrue in interface AtlassianBootstrapManagerpublic void removeProperty(String key)
removeProperty in interface AtlassianBootstrapManagerpublic String getString(String key)
getString in interface AtlassianBootstrapManagerpublic String getFilePathProperty(String key)
getFilePathProperty in interface AtlassianBootstrapManagerpublic Collection getPropertyKeys()
getPropertyKeys in interface AtlassianBootstrapManagerpublic Map getPropertiesWithPrefix(String prefix)
getPropertiesWithPrefix in interface AtlassianBootstrapManager
public void save()
throws ConfigurationException
save in interface AtlassianBootstrapManagerConfigurationExceptionpublic String getConfiguredApplicationHome()
getConfiguredApplicationHome in interface AtlassianBootstrapManagerpublic boolean isSetupComplete()
isSetupComplete in interface AtlassianBootstrapManagerpublic void setSetupComplete(boolean complete)
setSetupComplete in interface AtlassianBootstrapManagerpublic String getBuildNumber()
AtlassianBootstrapManager
getBuildNumber in interface AtlassianBootstrapManagerpublic void setBuildNumber(String buildNumber)
setBuildNumber in interface AtlassianBootstrapManagerpublic Properties getHibernateProperties()
getHibernateProperties in interface AtlassianBootstrapManager
public void bootstrapDatabase(DatabaseDetails dbDetails,
boolean embedded)
throws BootstrapException
bootstrapDatabase in interface AtlassianBootstrapManagerdbDetails - - 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 AtlassianBootstrapManagerdatasourceName - hibernateDialect -
BootstrapException
public Connection getTestDatabaseConnection(DatabaseDetails databaseDetails)
throws BootstrapException
getTestDatabaseConnection in interface AtlassianBootstrapManagerBootstrapException - if the connection fails for any reason.
public Connection getTestDatasourceConnection(String datasourceName)
throws BootstrapException
getTestDatasourceConnection in interface AtlassianBootstrapManagerBootstrapException - if a connection cannot be made.public boolean databaseContainsExistingData(Connection connection)
databaseContainsExistingData in interface AtlassianBootstrapManagerconnection - the Connection to the Db to check#setTables(List)}public boolean isApplicationHomeValid()
isApplicationHomeValid in interface AtlassianBootstrapManagerprotected 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
ConfigurationExceptionpublic void setApplicationConfig(ApplicationConfiguration applicationConfig)
public void setHomeLocator(HomeLocator homeLocator)
public void setSetupPersister(SetupPersister setupPersister)
public HomeLocator getHomeLocator()
public ApplicationConfiguration getApplicationConfig()
getApplicationConfig in interface AtlassianBootstrapManagerpublic String getApplicationHome()
getApplicationHome in interface AtlassianBootstrapManagerpublic SetupPersister getSetupPersister()
getSetupPersister in interface AtlassianBootstrapManagerpublic boolean isBootstrapped()
isBootstrapped in interface AtlassianBootstrapManagerpublic String getOperation()
getOperation in interface AtlassianBootstrapManagerpublic void setOperation(String operation)
setOperation in interface AtlassianBootstrapManagerpublic HibernateConfigurator getHibernateConfigurator()
getHibernateConfigurator in interface AtlassianBootstrapManagerpublic void setHibernateConfigurator(HibernateConfigurator hibernateConfigurator)
setHibernateConfigurator in interface AtlassianBootstrapManagerpublic HibernateConfig getHibernateConfig()
getHibernateConfig in interface AtlassianBootstrapManagerpublic void setHibernateConfig(HibernateConfig hibernateConfig)
public String getBootstrapFailureReason()
getBootstrapFailureReason in interface AtlassianBootstrapManagerpublic List getTables()
public void setTables(List tables)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||