Class MockBootstrapManager

java.lang.Object
it.com.atlassian.bamboo.agent.elastic.mocks.MockBootstrapManager
All Implemented Interfaces:
BootstrapManager, com.atlassian.config.bootstrap.AtlassianBootstrapManager

public class MockBootstrapManager extends Object implements BootstrapManager
Created by rstephens on 21/04/15.
  • Constructor Details

    • MockBootstrapManager

      public MockBootstrapManager(URI brokerUri)
  • Method Details

    • 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
    • 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
    • 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
    • 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
    • setArtifactsDirectory

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

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

      public void setRepositoryLogsDirectory(String repositoryLogsDirectory)
      Specified by:
      setRepositoryLogsDirectory in interface BootstrapManager
    • 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
    • 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
    • getFingerprint

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

      public boolean isBootstrapped()
      Specified by:
      isBootstrapped in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • getProperty

      public Object getProperty(String s)
      Specified by:
      getProperty in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • setProperty

      public void setProperty(String s, Object o)
      Specified by:
      setProperty in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • isPropertyTrue

      public boolean isPropertyTrue(String s)
      Specified by:
      isPropertyTrue in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • removeProperty

      public void removeProperty(String s)
      Specified by:
      removeProperty in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • getString

      public String getString(String s)
      Specified by:
      getString in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • getFilePathProperty

      public String getFilePathProperty(String s)
      Specified by:
      getFilePathProperty in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • getPropertyKeys

      public Collection getPropertyKeys()
      Specified by:
      getPropertyKeys in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • getPropertiesWithPrefix

      public Map getPropertiesWithPrefix(String s)
      Specified by:
      getPropertiesWithPrefix in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • getBuildNumber

      public String getBuildNumber()
      Specified by:
      getBuildNumber in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • setBuildNumber

      public void setBuildNumber(String s)
      Specified by:
      setBuildNumber in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • isApplicationHomeValid

      public boolean isApplicationHomeValid()
      Specified by:
      isApplicationHomeValid in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • getHibernateProperties

      public Properties getHibernateProperties()
      Specified by:
      getHibernateProperties in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • save

      public void save() throws com.atlassian.config.ConfigurationException
      Specified by:
      save in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
      Throws:
      com.atlassian.config.ConfigurationException
    • isSetupComplete

      public boolean isSetupComplete()
      Specified by:
      isSetupComplete in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • getOperation

      public String getOperation()
      Specified by:
      getOperation in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • setOperation

      public void setOperation(String s)
      Specified by:
      setOperation in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • setSetupComplete

      public void setSetupComplete(boolean b)
      Specified by:
      setSetupComplete in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • bootstrapDatasource

      public void bootstrapDatasource(String s, String s1) throws com.atlassian.config.bootstrap.BootstrapException
      Specified by:
      bootstrapDatasource in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
      Throws:
      com.atlassian.config.bootstrap.BootstrapException
    • getSetupPersister

      public com.atlassian.config.setup.SetupPersister getSetupPersister()
      Specified by:
      getSetupPersister in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • getApplicationConfig

      public com.atlassian.config.ApplicationConfiguration getApplicationConfig()
      Specified by:
      getApplicationConfig in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • getApplicationHome

      public String getApplicationHome()
      Specified by:
      getApplicationHome in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • getConfiguredApplicationHome

      public String getConfiguredApplicationHome()
      Specified by:
      getConfiguredApplicationHome in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • getBootstrapFailureReason

      public String getBootstrapFailureReason()
      Specified by:
      getBootstrapFailureReason in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • init

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

      public void publishConfiguration()
      Specified by:
      publishConfiguration in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • bootstrapDatabase

      public void bootstrapDatabase(com.atlassian.config.db.DatabaseDetails databaseDetails, boolean b) throws com.atlassian.config.bootstrap.BootstrapException
      Specified by:
      bootstrapDatabase in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
      Throws:
      com.atlassian.config.bootstrap.BootstrapException
    • getHibernateConfigurator

      public com.atlassian.config.db.HibernateConfigurator getHibernateConfigurator()
      Specified by:
      getHibernateConfigurator in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • setHibernateConfigurator

      public void setHibernateConfigurator(com.atlassian.config.db.HibernateConfigurator hibernateConfigurator)
      Specified by:
      setHibernateConfigurator in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • getHibernateConfig

      public com.atlassian.config.db.HibernateConfig getHibernateConfig()
      Specified by:
      getHibernateConfig in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • getTestDatasourceConnection

      public Connection getTestDatasourceConnection(String s) throws com.atlassian.config.bootstrap.BootstrapException
      Specified by:
      getTestDatasourceConnection in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
      Throws:
      com.atlassian.config.bootstrap.BootstrapException
    • databaseContainsExistingData

      public boolean databaseContainsExistingData(Connection connection)
      Specified by:
      databaseContainsExistingData in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
    • 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
      Throws:
      com.atlassian.config.bootstrap.BootstrapException
    • 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)
      Specified by:
      setH2Version in interface BootstrapManager
    • 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
    • initializeBuildNumberIfRequired

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