Class DefaultBootstrapManager

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

public class DefaultBootstrapManager extends com.atlassian.config.internal.bootstrap.DefaultAtlassianBootstrapManager implements BootstrapManagerInternal
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 Details

  • Constructor Details

  • Method Details

    • init

      public void init() throws com.atlassian.config.bootstrap.BootstrapException
      Specified by:
      init in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
      Overrides:
      init in class com.atlassian.config.internal.bootstrap.DefaultAtlassianBootstrapManager
      Throws:
      com.atlassian.config.bootstrap.BootstrapException
    • publishConfiguration

      @Deprecated public void publishConfiguration()
      Deprecated.
      since 5.9
      Specified by:
      publishConfiguration in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
      Overrides:
      publishConfiguration in class com.atlassian.config.internal.bootstrap.DefaultAtlassianBootstrapManager
    • getDatabaseDetail

      public Optional<com.atlassian.config.db.DatabaseDetails> getDatabaseDetail(String database)
      Description copied from interface: BootstrapManagerInternal
      Get Db configuration from config file if we are using db.first setup type
      Specified by:
      getDatabaseDetail in interface BootstrapManagerInternal
      Parameters:
      database - the name of database
      Returns:
      Optional Database Configuration object
    • getString

      public String getString(String key)
      Specified by:
      getString in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
      Overrides:
      getString in class com.atlassian.config.internal.bootstrap.DefaultAtlassianBootstrapManager
    • getFilePathProperty

      public String getFilePathProperty(String key)
      "${confluenceHome}" 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
      Specified by:
      getFilePathProperty in interface BootstrapManager
      Overrides:
      getFilePathProperty in class com.atlassian.config.internal.bootstrap.DefaultAtlassianBootstrapManager
      Parameters:
      key - the property key whose value you want to perform replacement upon.
    • getDbUrl

      protected String getDbUrl(com.atlassian.config.db.DatabaseDetails dbDetails)
      Overrides:
      getDbUrl in class com.atlassian.config.internal.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
      Specified by:
      getApplicationHome in interface BootstrapManager
      Overrides:
      getApplicationHome in class com.atlassian.config.internal.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
      Specified by:
      setConfluenceHome in interface BootstrapManager
      Throws:
      com.atlassian.config.ConfigurationException
    • bootstrapSharedConfiguration

      @Deprecated public void bootstrapSharedConfiguration(SharedConfigurationMap sharedConfig)
      Deprecated.
      since 5.9
      Starts Confluence with a database configuration that has been retrieved from another cluster node.
      Specified by:
      bootstrapSharedConfiguration 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

      public boolean performPersistenceUpgrade()
      Description copied from interface: BootstrapManagerInternal
      Perform upgrade of DB configuration
      Specified by:
      performPersistenceUpgrade in interface BootstrapManagerInternal
      Overrides:
      performPersistenceUpgrade in class com.atlassian.config.internal.bootstrap.DefaultAtlassianBootstrapManager
      Returns:
      true if successful, false if failed
    • getHibernateProperties

      public Properties getHibernateProperties()
      Specified by:
      getHibernateProperties in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
      Overrides:
      getHibernateProperties in class com.atlassian.config.internal.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.internal.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
    • cleanupOnShutdown

      public void cleanupOnShutdown()
      Description copied from interface: BootstrapManager
      If there's any resource that needs to be cleaned up, do it here.
      Specified by:
      cleanupOnShutdown in interface BootstrapManager
    • getDataSourceName

      public Optional<String> getDataSourceName()
      Description copied from interface: BootstrapManager
      Returns the name of the JNDI-based DataSource, if any.
      Specified by:
      getDataSourceName in interface BootstrapManager
      Returns:
      empty if Confluence is using a direct JDBC connection
    • getHibernateDialect

      public String getHibernateDialect()
      Description copied from interface: BootstrapManager
      Returns the SQL dialect being used by Hibernate.
      Specified by:
      getHibernateDialect in interface BootstrapManager
      Returns:
      see above
      See Also:
      • AvailableSettings.DIALECT
    • afterConfigurationLoaded

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

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

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

      public void setWebAppContextPath(String webAppContextPath)
      Specified by:
      setWebAppContextPath in interface BootstrapManager
    • isWebAppContextPathSet

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