Class 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 Detail

      • MockBootstrapManager

        public MockBootstrapManager​(URI brokerUri)
    • Method Detail

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

        @NotNull
        public @NotNull String getRepositoryLogsDirectory()
        Specified by:
        getRepositoryLogsDirectory in interface BootstrapManager
        Returns:
        the root directory underneath which the repositories logs directories are located.
      • 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
      • 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
      • initializeBuildNumberIfRequired

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