com.atlassian.confluence.setup
Class DefaultBootstrapManager

java.lang.Object
  extended by com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager
      extended by com.atlassian.confluence.setup.DefaultBootstrapManager
All Implemented Interfaces:
com.atlassian.config.bootstrap.AtlassianBootstrapManager, BootstrapManager, ConfluenceBootstrapConstants

public class DefaultBootstrapManager
extends com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager
implements BootstrapManager

BootstrapManager is responsible for initializing the dependencies of Confluence environment.

  1. Initializing the Confluence environment, beginning with loading confluence.cfg.xml from the confluence.home property specified in confluence-init.properties.
  2. Delegating, monitoring, and answering all client requests concerning Confluence initialization routines.
  3. Providing the SetupPersister with whatever resources it needs to let a user bootstrapManager Confluence.


Field Summary
static String CONFIG_DIR_NAME
           
 
Fields inherited from class com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager
applicationConfig, bootstrapFailureReason, bootstrapped, hibernateConfig, hibernateConfigurator, homeLocator, setupPersister
 
Fields inherited from interface com.atlassian.confluence.setup.ConfluenceBootstrapConstants
ATLASSIAN_LICENSE_KEY, ATTACHMENTS_DIR_PROP, CONFLUENCE_HOME_CONSTANT, CONFLUENCE_LOCAL_HOME_CONSTANT, DEFAULT_LICENSE_REGISTRY_KEY, GLOBAL_PLUGIN_STATE, INSTALLATION_DATE_KEY, LICENSE_HASH_KEY, LICENSE_MESSAGE_KEY, LUCENE_INDEX_DIR_PROP, TEMP_DIR_PROP, WEBAPP_CONTEXT_PATH_KEY
 
Constructor Summary
DefaultBootstrapManager()
           
 
Method Summary
protected  void afterConfigurationLoaded()
           
 void bootstrapSharedConfiguration(SharedConfigurationMap sharedConfig)
          Starts Confluence with a database configuration that has been retrieved from another cluster node.
 void checkConfigurationOnStartup()
           
 String getApplicationHome()
           
 String getBaseUrl()
          Deprecated. 
 String getConfiguredConfluenceHome()
           
 File getConfiguredLocalHome()
          Returns the configured local home or null if not configured.
 String getConfluenceHome()
          Deprecated. 
protected  String getDbUrl(com.atlassian.config.db.DatabaseDetails dbDetails)
           
 String getDomainName()
          Deprecated. 
 String getFilePathProperty(String key)
          CONFLUENCE_HOME_CONSTANT is replaced on the fly with the current location of confluence.
 Properties getHibernateProperties()
           
 File getLocalHome()
          Confluence local home directory.
 File getSharedHome()
          Confluence shared home directory.
 Connection getTestDatabaseConnection(com.atlassian.config.db.DatabaseDetails databaseDetails)
           
 String getWebAppContextPath()
           
 boolean isWebAppContextPathSet()
           
protected  boolean performPersistenceUpgrade()
           
protected  void postBootstrapDatabase()
           
 void publishConfiguration()
           
 void setClusterConfigurationHelper(ClusterConfigurationHelper clusterConfigurationHelper)
           
 void setConfluenceHome(String confluenceHome)
          Use for test cases only
 void setDatabaseHelper(com.atlassian.config.db.DatabaseHelper databaseHelper)
           
 void setWebAppContextPath(String webAppContextPath)
           
 
Methods inherited from class com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager
bootstrapDatabase, bootstrapDatasource, databaseContainsExistingData, finishBootstrapInitialisation, getApplicationConfig, getBootstrapFailureReason, getBuildNumber, getConfiguredApplicationHome, getHibernateConfig, getHibernateConfigurator, getHomeLocator, getOperation, getPropertiesWithPrefix, getProperty, getPropertyKeys, getSetupPersister, getString, getTables, getTestDatasourceConnection, init, isApplicationHomeValid, isBootstrapped, isPropertyTrue, isSetupComplete, removeProperty, save, setApplicationConfig, setBuildNumber, setHibernateConfig, setHibernateConfigurator, setHomeLocator, setOperation, setProperty, setSetupComplete, setSetupPersister, setTables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
bootstrapDatabase, bootstrapDatasource, databaseContainsExistingData, getApplicationConfig, getBootstrapFailureReason, getBuildNumber, getConfiguredApplicationHome, getHibernateConfig, getHibernateConfigurator, getOperation, getPropertiesWithPrefix, getProperty, getPropertyKeys, getSetupPersister, getString, getTestDatasourceConnection, init, isApplicationHomeValid, isBootstrapped, isPropertyTrue, isSetupComplete, removeProperty, save, setBuildNumber, setHibernateConfigurator, setOperation, setProperty, setSetupComplete
 

Field Detail

CONFIG_DIR_NAME

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

DefaultBootstrapManager

public DefaultBootstrapManager()
Method Detail

publishConfiguration

public void publishConfiguration()
Specified by:
publishConfiguration in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
Overrides:
publishConfiguration in class com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager

getFilePathProperty

public String getFilePathProperty(String key)
CONFLUENCE_HOME_CONSTANT is replaced on the fly with the current location of confluence.
This effectively allows confluence to be moved without breaking some system paths (like attachments)
This does not handle moves to a different drive though.

Specified by:
getFilePathProperty in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
Overrides:
getFilePathProperty in class com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager
Parameters:
key - the applicationConfig key who's value you want to perform replacement on.

getDbUrl

protected String getDbUrl(com.atlassian.config.db.DatabaseDetails dbDetails)
Overrides:
getDbUrl in class com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager

getConfluenceHome

@Deprecated
public String getConfluenceHome()
Deprecated. 

Description copied from interface: BootstrapManager
Returns local home in standalone installation and shared home in clustered installation.

Specified by:
getConfluenceHome in interface BootstrapManager
Returns:
local home in standalone installation and shared home in clustered installation

getApplicationHome

public String getApplicationHome()
Specified by:
getApplicationHome in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
Overrides:
getApplicationHome in class com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager

getSharedHome

public File getSharedHome()
Description copied from interface: BootstrapManager
Confluence shared home directory.

This directory is shared between all nodes in a cluster. In non-clustered installations without a shared directory, directory called "shared-home" inside local home directory is returned instead.

This directory should be used for data that can be safely shared across a cluster. Any users of this directory should take into account locking to prevent concurrency errors.

Specified by:
getSharedHome in interface BootstrapManager
Returns:
shared home directory

getLocalHome

public File getLocalHome()
Description copied from interface: BootstrapManager
Confluence local home directory.

This directory is only visible to the local node in a cluster.

This directory should be used for data that must be node specific and cannot be shared between cluster nodes.

Specified by:
getLocalHome in interface BootstrapManager
Returns:
String representing the path to Confluence's home directory on disk.

setConfluenceHome

public void setConfluenceHome(String confluenceHome)
                       throws com.atlassian.config.ConfigurationException
Use for test cases only

Specified by:
setConfluenceHome in interface BootstrapManager
Throws:
com.atlassian.config.ConfigurationException

getBaseUrl

@Deprecated
public String getBaseUrl()
Deprecated. 

Specified by:
getBaseUrl in interface BootstrapManager

getDomainName

@Deprecated
public String getDomainName()
Deprecated. 

Specified by:
getDomainName in interface BootstrapManager

bootstrapSharedConfiguration

public void bootstrapSharedConfiguration(SharedConfigurationMap sharedConfig)
                                  throws com.atlassian.config.bootstrap.BootstrapException
Starts Confluence with a database configuration that has been retrieved from another cluster node.

Specified by:
bootstrapSharedConfiguration in interface BootstrapManager
Throws:
com.atlassian.config.bootstrap.BootstrapException

getConfiguredConfluenceHome

public String getConfiguredConfluenceHome()
Specified by:
getConfiguredConfluenceHome in interface BootstrapManager

getConfiguredLocalHome

public File getConfiguredLocalHome()
Description copied from interface: BootstrapManager
Returns the configured local home or null if not configured.

Only bootstrap code should need this method. Most code should use BootstrapManager.getLocalHome() instead.

Specified by:
getConfiguredLocalHome in interface BootstrapManager
Returns:
configured local home

performPersistenceUpgrade

protected boolean performPersistenceUpgrade()
Overrides:
performPersistenceUpgrade in class com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager

getHibernateProperties

public Properties getHibernateProperties()
Specified by:
getHibernateProperties in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
Overrides:
getHibernateProperties in class com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager

getTestDatabaseConnection

public Connection getTestDatabaseConnection(com.atlassian.config.db.DatabaseDetails databaseDetails)
                                     throws com.atlassian.config.bootstrap.BootstrapException
Specified by:
getTestDatabaseConnection in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
Overrides:
getTestDatabaseConnection in class com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager
Throws:
com.atlassian.config.bootstrap.BootstrapException

checkConfigurationOnStartup

public void checkConfigurationOnStartup()
                                 throws com.atlassian.config.bootstrap.BootstrapException
Specified by:
checkConfigurationOnStartup in interface BootstrapManager
Throws:
com.atlassian.config.bootstrap.BootstrapException

afterConfigurationLoaded

protected void afterConfigurationLoaded()
                                 throws com.atlassian.config.ConfigurationException
Overrides:
afterConfigurationLoaded in class com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager
Throws:
com.atlassian.config.ConfigurationException

postBootstrapDatabase

protected void postBootstrapDatabase()
                              throws com.atlassian.config.bootstrap.BootstrapException
Overrides:
postBootstrapDatabase in class com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager
Throws:
com.atlassian.config.bootstrap.BootstrapException

getWebAppContextPath

public String getWebAppContextPath()
Specified by:
getWebAppContextPath in interface BootstrapManager

setWebAppContextPath

public void setWebAppContextPath(String webAppContextPath)
                          throws com.atlassian.config.ConfigurationException
Specified by:
setWebAppContextPath in interface BootstrapManager
Throws:
com.atlassian.config.ConfigurationException

isWebAppContextPathSet

public boolean isWebAppContextPathSet()
Specified by:
isWebAppContextPathSet in interface BootstrapManager

setDatabaseHelper

public void setDatabaseHelper(com.atlassian.config.db.DatabaseHelper databaseHelper)

setClusterConfigurationHelper

public void setClusterConfigurationHelper(ClusterConfigurationHelper clusterConfigurationHelper)


Copyright © 2003–2015 Atlassian. All rights reserved.