Class DefaultBootstrapManager

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

public class DefaultBootstrapManager extends com.atlassian.config.internal.bootstrap.DefaultAtlassianBootstrapManager implements BootstrapManager
BootstrapManager is responsible for initializing the dependencies of Bamboo environment.
  1. Initializing the Bamboo environment, beginning with loading both bamboo.cfg.xml from the bamboo.home property and the bamboo-shared.cfg.xml from the bamboo.shared.home, both specified in bamboo-init.properties.
  2. Delegating, monitoring, and answering all client requests concerning Bamboo initialization routines.
  3. Providing the SetupPersister with whatever resources it needs to let a user bootstrapManager Bamboo.
  • Field Details

  • Constructor Details

    • DefaultBootstrapManager

      public DefaultBootstrapManager()
  • Method Details

    • afterConfigurationLoaded

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

      public boolean initializeBuildNumberIfRequired() throws com.atlassian.config.ConfigurationException
      Specified by:
      initializeBuildNumberIfRequired in interface BootstrapManager
      Throws:
      com.atlassian.config.ConfigurationException
    • initializeBuildNumberIfRequired

      protected boolean initializeBuildNumberIfRequired(@NotNull @NotNull Supplier<String> currentBuildNumberSupplier) throws com.atlassian.config.ConfigurationException
      Throws:
      com.atlassian.config.ConfigurationException
    • getConfigDirectory

      public String getConfigDirectory()
      Description copied from interface: BootstrapManager
      Gets the directory where Bamboo's administration.xml file sits
      Specified by:
      getConfigDirectory in interface BootstrapManager
      Returns:
      String representing the path to the folder. Null if not configured
    • setConfigDirectory

      public void setConfigDirectory(String configurationDirectory)
      Specified by:
      setConfigDirectory in interface BootstrapManager
    • getBuildWorkingDirectory

      public String getBuildWorkingDirectory()
      Description copied from interface: BootstrapManager
      This method returns the root directory underneath which the build directories are located. The structure below this directory is not documented - you most likely do not want to use this method, consider using DefaultBuildDirectoryManager methods instead.
      Specified by:
      getBuildWorkingDirectory in interface BootstrapManager
    • setBuildWorkingDirectory

      public void setBuildWorkingDirectory(String buildWorkingDirectory)
      Specified by:
      setBuildWorkingDirectory in interface BootstrapManager
    • setArtifactsDirectory

      public void setArtifactsDirectory(String artifactsDir)
      Specified by:
      setArtifactsDirectory in interface BootstrapManager
    • getArtifactsDirectory

      public String getArtifactsDirectory()
      Description copied from interface: BootstrapManager
      This method returns the root directory underneath which the artifacts are stored. The structure below this directory is not documented - you most likely do not want to use this method, consider using com.atlassian.bamboo.fileserver.SystemDirectory methods instead.
      Specified by:
      getArtifactsDirectory in interface BootstrapManager
    • getBuildDirectory

      public String getBuildDirectory()
      Description copied from interface: BootstrapManager
      Gets the directory where Bamboo's build files sit. This includes artifacts and the like
      Specified by:
      getBuildDirectory in interface BootstrapManager
      Returns:
      String representing the path to the folder. Null if not configured
    • setBuildDirectory

      public void setBuildDirectory(String buildDirectory)
      Specified by:
      setBuildDirectory in interface BootstrapManager
    • getRepositoryLogsDirectory

      public String getRepositoryLogsDirectory()
      Specified by:
      getRepositoryLogsDirectory in interface BootstrapManager
      Returns:
      the root directory underneath which the repositories logs directories are located.
    • setRepositoryLogsDirectory

      public void setRepositoryLogsDirectory(@NotNull @NotNull String repositoryLogsDirectory)
      Specified by:
      setRepositoryLogsDirectory in interface BootstrapManager
    • publishConfiguration

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

      public URI getBrokerURI() throws URISyntaxException
      Specified by:
      getBrokerURI in interface BootstrapManager
      Throws:
      URISyntaxException
    • setBrokerURI

      public void setBrokerURI(URI brokerURI)
      Specified by:
      setBrokerURI in interface BootstrapManager
    • getBrokerClientURI

      public URI getBrokerClientURI() throws URISyntaxException
      Specified by:
      getBrokerClientURI in interface BootstrapManager
      Throws:
      URISyntaxException
    • setBrokerClientURI

      public void setBrokerClientURI(URI brokerURI)
      Specified by:
      setBrokerClientURI in interface BootstrapManager
    • performPersistenceUpgrade

      protected boolean performPersistenceUpgrade()
      Overrides:
      performPersistenceUpgrade in class com.atlassian.config.internal.bootstrap.DefaultAtlassianBootstrapManager
    • 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
    • getDbUrl

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

      public String getServerID()
      Specified by:
      getServerID in interface BootstrapManager
    • setServerID

      public void setServerID(String serverId)
      Specified by:
      setServerID in interface BootstrapManager
    • initializeServerKey

      public boolean initializeServerKey()
      Description copied from interface: BootstrapManager
      Initializes server key used for BambooEntityOids of this Bamboo instance based on server ID. Does nothing if the server key is already configured. This method should be externally synchronized.
      Specified by:
      initializeServerKey in interface BootstrapManager
      Returns:
      true if server key has been initialized, false otherwise
    • getServerKey

      public int getServerKey()
      Description copied from interface: BootstrapManager
      Returns server key used for BambooEntityOids of this Bamboo instance.
      Specified by:
      getServerKey in interface BootstrapManager
    • setServerKey

      public void setServerKey(int serverKey)
      Description copied from interface: BootstrapManager
      Set server key used for BambooEntityOids for this Bamboo instance.
      Specified by:
      setServerKey in interface BootstrapManager
      Parameters:
      serverKey - server key of this instance
    • getFingerprint

      @NotNull public @NotNull ServerFingerprint getFingerprint()
      Specified by:
      getFingerprint in interface BootstrapManager
      Returns:
      a unique identifier for this startup
    • getH2VersionFromConfig

      public String getH2VersionFromConfig()
      Specified by:
      getH2VersionFromConfig in interface BootstrapManager
    • resetH2Version

      public boolean resetH2Version()
      Specified by:
      resetH2Version in interface BootstrapManager
    • setH2Version

      public void setH2Version(String h2Version) throws com.atlassian.config.ConfigurationException
      Specified by:
      setH2Version in interface BootstrapManager
      Throws:
      com.atlassian.config.ConfigurationException
    • getLocalHomePath

      public String getLocalHomePath()
      Description copied from interface: BootstrapManager
      Local home directory;
      Specified by:
      getLocalHomePath in interface BootstrapManager
    • getSharedHomePath

      public String getSharedHomePath()
      Description copied from interface: BootstrapManager
      Shared home directory;
      Specified by:
      getSharedHomePath in interface BootstrapManager
    • getBambooSharedProperties

      public BambooSharedProperties getBambooSharedProperties()
      Description copied from interface: BootstrapManager
      Shared home properties (bamboo-shared.cfg.xml)
      Specified by:
      getBambooSharedProperties in interface BootstrapManager
      Returns:
      BambooSharedProperties