public class DefaultAtlassianBootstrapManager extends Object implements AtlassianBootstrapManager
| Modifier and Type | Field and Description |
|---|---|
protected ApplicationConfiguration |
applicationConfig |
protected String |
bootstrapFailureReason |
protected boolean |
bootstrapped |
protected HibernateConfig |
hibernateConfig |
protected HibernateConfigurator |
hibernateConfigurator |
protected HomeLocator |
homeLocator |
protected SetupPersister |
setupPersister |
| Constructor and Description |
|---|
DefaultAtlassianBootstrapManager() |
| Modifier and Type | Method and Description |
|---|---|
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() |
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() |
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) |
protected boolean bootstrapped
protected String bootstrapFailureReason
protected ApplicationConfiguration applicationConfig
protected SetupPersister setupPersister
protected HomeLocator homeLocator
protected HibernateConfigurator hibernateConfigurator
protected HibernateConfig hibernateConfig
public void init()
throws BootstrapException
init in interface AtlassianBootstrapManagerBootstrapExceptionpublic void publishConfiguration()
publishConfiguration in interface AtlassianBootstrapManagerpublic Object getProperty(String key)
getProperty in interface AtlassianBootstrapManagerpublic 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 AtlassianBootstrapManagerpublic 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()
getBuildNumber in interface AtlassianBootstrapManagerpublic void setBuildNumber(String buildNumber)
setBuildNumber in interface AtlassianBootstrapManagerpublic Properties getHibernateProperties()
getHibernateProperties in interface AtlassianBootstrapManagerpublic void bootstrapDatabase(DatabaseDetails dbDetails, boolean embedded) throws BootstrapException
bootstrapDatabase in interface AtlassianBootstrapManagerdbDetails - - DatabaseDetails object holding connection detailsembedded - - true if using the default product database, HSQLDBBootstrapExceptionpublic void bootstrapDatasource(String datasourceName, String hibernateDialect) throws BootstrapException
bootstrapDatasource in interface AtlassianBootstrapManagerBootstrapExceptionpublic 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 checksetTables(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 URLprotected void postBootstrapDatabase()
throws BootstrapException
BootstrapExceptionprotected void afterConfigurationLoaded()
throws ConfigurationException
ConfigurationExceptionpublic HomeLocator getHomeLocator()
public void setHomeLocator(HomeLocator homeLocator)
public ApplicationConfiguration getApplicationConfig()
getApplicationConfig in interface AtlassianBootstrapManagerpublic void setApplicationConfig(ApplicationConfiguration applicationConfig)
public String getApplicationHome()
getApplicationHome in interface AtlassianBootstrapManagerpublic SetupPersister getSetupPersister()
getSetupPersister in interface AtlassianBootstrapManagerpublic void setSetupPersister(SetupPersister setupPersister)
public 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)
Copyright © 2006–2024 Atlassian. All rights reserved.