Package com.atlassian.bamboo.setup
Class DefaultBootstrapManager
- java.lang.Object
-
- com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager
-
- com.atlassian.bamboo.setup.DefaultBootstrapManager
-
- All Implemented Interfaces:
BootstrapManager,com.atlassian.config.bootstrap.AtlassianBootstrapManager
public class DefaultBootstrapManager extends com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager implements BootstrapManager
BootstrapManager is responsible for initializing the dependencies of Bamboo environment.- 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.
- Delegating, monitoring, and answering all client requests concerning Bamboo initialization routines.
- Providing the SetupPersister with whatever resources it needs to let a user bootstrapManager Bamboo.
-
-
Field Summary
Fields Modifier and Type Field Description static StringARTIFACTS_DIRprotected BambooSharedPropertiesbambooSharedPropertiesstatic StringBUILD_DIRECTORY_PARAMstatic StringBUILD_WORKING_DIRstatic StringCONFIG_DIRECTORY_PARAMstatic StringREPOSITORY_LOGS_PARAM-
Fields inherited from class com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager
applicationConfig, bootstrapFailureReason, bootstrapped, hibernateConfig, hibernateConfigurator, homeLocator, setupPersister
-
Fields inherited from interface com.atlassian.bamboo.setup.BootstrapManager
INSTANCE_FINGERPRINT_PARAM, SERVER_FINGERPRINT_PARAM
-
-
Constructor Summary
Constructors Constructor Description DefaultBootstrapManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafterConfigurationLoaded()StringgetArtifactsDirectory()This method returns the root directory underneath which the artifacts are stored.BambooSharedPropertiesgetBambooSharedProperties()Shared home properties (bamboo-shared.cfg.xml)URIgetBrokerClientURI()URIgetBrokerURI()StringgetBuildDirectory()Gets the directory where Bamboo's build files sit.StringgetBuildWorkingDirectory()This method returns the root directory underneath which the build directories are located.StringgetConfigDirectory()Gets the directory where Bamboo's administration.xml file sitsprotected StringgetDbUrl(com.atlassian.config.db.DatabaseDetails dbDetails)@NotNull ServerFingerprintgetFingerprint()StringgetH2VersionFromConfig()StringgetLocalHomePath()Local home directory;StringgetRepositoryLogsDirectory()StringgetServerID()intgetServerKey()Returns server key used forBambooEntityOids of this Bamboo instance.StringgetSharedHomePath()Shared home directory;booleaninitializeBuildNumberIfRequired()protected booleaninitializeBuildNumberIfRequired(@NotNull Supplier<String> currentBuildNumberSupplier)booleaninitializeServerKey()Initializes server key used forBambooEntityOids of this Bamboo instance based onserver ID.protected booleanperformPersistenceUpgrade()protected voidpostBootstrapDatabase()voidpublishConfiguration()booleanresetH2Version()voidsetArtifactsDirectory(String artifactsDir)voidsetBrokerClientURI(URI brokerURI)voidsetBrokerURI(URI brokerURI)voidsetBuildDirectory(String buildDirectory)voidsetBuildWorkingDirectory(String buildWorkingDirectory)voidsetConfigDirectory(String configurationDirectory)voidsetH2Version(String h2Version)voidsetRepositoryLogsDirectory(@NotNull String repositoryLogsDirectory)voidsetServerID(String serverId)voidsetServerKey(int serverKey)Set server key used forBambooEntityOids for this Bamboo instance.-
Methods inherited from class com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager
bootstrapDatabase, bootstrapDatasource, databaseContainsExistingData, finishBootstrapInitialisation, getApplicationConfig, getApplicationHome, getBootstrapFailureReason, getBuildNumber, getConfiguredApplicationHome, getFilePathProperty, getHibernateConfig, getHibernateConfigurator, getHibernateProperties, getHomeLocator, getOperation, getPropertiesWithPrefix, getProperty, getPropertyKeys, getSetupPersister, getString, getTables, getTestDatabaseConnection, 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, getApplicationHome, getBootstrapFailureReason, getBuildNumber, getConfiguredApplicationHome, getFilePathProperty, getHibernateConfig, getHibernateConfigurator, getHibernateProperties, getOperation, getPropertiesWithPrefix, getProperty, getPropertyKeys, getSetupPersister, getString, getTestDatabaseConnection, getTestDatasourceConnection, init, isApplicationHomeValid, isBootstrapped, isPropertyTrue, isSetupComplete, removeProperty, save, setBuildNumber, setHibernateConfigurator, setOperation, setProperty, setSetupComplete
-
Methods inherited from interface com.atlassian.bamboo.setup.BootstrapManager
getIndexDirectory
-
-
-
-
Field Detail
-
CONFIG_DIRECTORY_PARAM
public static final String CONFIG_DIRECTORY_PARAM
- See Also:
- Constant Field Values
-
BUILD_DIRECTORY_PARAM
public static final String BUILD_DIRECTORY_PARAM
- See Also:
- Constant Field Values
-
BUILD_WORKING_DIR
public static final String BUILD_WORKING_DIR
- See Also:
- Constant Field Values
-
ARTIFACTS_DIR
public static final String ARTIFACTS_DIR
- See Also:
- Constant Field Values
-
REPOSITORY_LOGS_PARAM
public static final String REPOSITORY_LOGS_PARAM
- See Also:
- Constant Field Values
-
bambooSharedProperties
protected BambooSharedProperties bambooSharedProperties
-
-
Method Detail
-
afterConfigurationLoaded
protected void afterConfigurationLoaded() throws com.atlassian.config.ConfigurationException- Overrides:
afterConfigurationLoadedin classcom.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager- Throws:
com.atlassian.config.ConfigurationException
-
initializeBuildNumberIfRequired
public boolean initializeBuildNumberIfRequired() throws com.atlassian.config.ConfigurationException- Specified by:
initializeBuildNumberIfRequiredin interfaceBootstrapManager- 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:BootstrapManagerGets the directory where Bamboo's administration.xml file sits- Specified by:
getConfigDirectoryin interfaceBootstrapManager- Returns:
- String representing the path to the folder. Null if not configured
-
setConfigDirectory
public void setConfigDirectory(String configurationDirectory)
- Specified by:
setConfigDirectoryin interfaceBootstrapManager
-
getBuildWorkingDirectory
public String getBuildWorkingDirectory()
Description copied from interface:BootstrapManagerThis 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:
getBuildWorkingDirectoryin interfaceBootstrapManager
-
setBuildWorkingDirectory
public void setBuildWorkingDirectory(String buildWorkingDirectory)
- Specified by:
setBuildWorkingDirectoryin interfaceBootstrapManager
-
setArtifactsDirectory
public void setArtifactsDirectory(String artifactsDir)
- Specified by:
setArtifactsDirectoryin interfaceBootstrapManager
-
getArtifactsDirectory
public String getArtifactsDirectory()
Description copied from interface:BootstrapManagerThis 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:
getArtifactsDirectoryin interfaceBootstrapManager
-
getBuildDirectory
public String getBuildDirectory()
Description copied from interface:BootstrapManagerGets the directory where Bamboo's build files sit. This includes artifacts and the like- Specified by:
getBuildDirectoryin interfaceBootstrapManager- Returns:
- String representing the path to the folder. Null if not configured
-
setBuildDirectory
public void setBuildDirectory(String buildDirectory)
- Specified by:
setBuildDirectoryin interfaceBootstrapManager
-
getRepositoryLogsDirectory
public String getRepositoryLogsDirectory()
- Specified by:
getRepositoryLogsDirectoryin interfaceBootstrapManager- Returns:
- the root directory underneath which the repositories logs directories are located.
-
setRepositoryLogsDirectory
public void setRepositoryLogsDirectory(@NotNull @NotNull String repositoryLogsDirectory)- Specified by:
setRepositoryLogsDirectoryin interfaceBootstrapManager
-
publishConfiguration
public void publishConfiguration()
- Specified by:
publishConfigurationin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager- Overrides:
publishConfigurationin classcom.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager
-
getBrokerURI
public URI getBrokerURI() throws URISyntaxException
- Specified by:
getBrokerURIin interfaceBootstrapManager- Throws:
URISyntaxException
-
setBrokerURI
public void setBrokerURI(URI brokerURI)
- Specified by:
setBrokerURIin interfaceBootstrapManager
-
getBrokerClientURI
public URI getBrokerClientURI() throws URISyntaxException
- Specified by:
getBrokerClientURIin interfaceBootstrapManager- Throws:
URISyntaxException
-
setBrokerClientURI
public void setBrokerClientURI(URI brokerURI)
- Specified by:
setBrokerClientURIin interfaceBootstrapManager
-
performPersistenceUpgrade
protected boolean performPersistenceUpgrade()
- Overrides:
performPersistenceUpgradein classcom.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager
-
postBootstrapDatabase
protected void postBootstrapDatabase() throws com.atlassian.config.bootstrap.BootstrapException- Overrides:
postBootstrapDatabasein classcom.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager- Throws:
com.atlassian.config.bootstrap.BootstrapException
-
getDbUrl
protected String getDbUrl(com.atlassian.config.db.DatabaseDetails dbDetails)
- Overrides:
getDbUrlin classcom.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager
-
getServerID
public String getServerID()
- Specified by:
getServerIDin interfaceBootstrapManager
-
setServerID
public void setServerID(String serverId)
- Specified by:
setServerIDin interfaceBootstrapManager
-
initializeServerKey
public boolean initializeServerKey()
Description copied from interface:BootstrapManagerInitializes server key used forBambooEntityOids of this Bamboo instance based onserver ID. Does nothing if the server key is already configured. This method should be externally synchronized.- Specified by:
initializeServerKeyin interfaceBootstrapManager- Returns:
- true if server key has been initialized, false otherwise
-
getServerKey
public int getServerKey()
Description copied from interface:BootstrapManagerReturns server key used forBambooEntityOids of this Bamboo instance.- Specified by:
getServerKeyin interfaceBootstrapManager
-
setServerKey
public void setServerKey(int serverKey)
Description copied from interface:BootstrapManagerSet server key used forBambooEntityOids for this Bamboo instance.- Specified by:
setServerKeyin interfaceBootstrapManager- Parameters:
serverKey- server key of this instance
-
getFingerprint
@NotNull public @NotNull ServerFingerprint getFingerprint()
- Specified by:
getFingerprintin interfaceBootstrapManager- Returns:
- a unique identifier for this startup
-
getH2VersionFromConfig
public String getH2VersionFromConfig()
- Specified by:
getH2VersionFromConfigin interfaceBootstrapManager
-
resetH2Version
public boolean resetH2Version()
- Specified by:
resetH2Versionin interfaceBootstrapManager
-
setH2Version
public void setH2Version(String h2Version) throws com.atlassian.config.ConfigurationException
- Specified by:
setH2Versionin interfaceBootstrapManager- Throws:
com.atlassian.config.ConfigurationException
-
getLocalHomePath
public String getLocalHomePath()
Description copied from interface:BootstrapManagerLocal home directory;- Specified by:
getLocalHomePathin interfaceBootstrapManager
-
getSharedHomePath
public String getSharedHomePath()
Description copied from interface:BootstrapManagerShared home directory;- Specified by:
getSharedHomePathin interfaceBootstrapManager
-
getBambooSharedProperties
public BambooSharedProperties getBambooSharedProperties()
Description copied from interface:BootstrapManagerShared home properties (bamboo-shared.cfg.xml)- Specified by:
getBambooSharedPropertiesin interfaceBootstrapManager- Returns:
- BambooSharedProperties
-
-