Package com.atlassian.bamboo.setup
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.
- 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
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected BambooSharedPropertiesstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class com.atlassian.config.internal.bootstrap.DefaultAtlassianBootstrapManager
applicationConfig, bootstrapFailureReason, bootstrapped, hibernateConfig, hibernateConfigurator, homeLocator, setupPersisterFields inherited from interface com.atlassian.bamboo.setup.BootstrapManager
INSTANCE_FINGERPRINT_PARAM, SERVER_FINGERPRINT_PARAM -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidThis method returns the root directory underneath which the artifacts are stored.Shared home properties (bamboo-shared.cfg.xml)Gets the directory where Bamboo's build files sit.This method returns the root directory underneath which the build directories are located.Gets the directory where Bamboo's administration.xml file sitsprotected StringgetDbUrl(com.atlassian.config.db.DatabaseDetails dbDetails) @NotNull ServerFingerprintLocal home directory;intReturns server key used forBambooEntityOids of this Bamboo instance.Shared home directory;booleanprotected booleaninitializeBuildNumberIfRequired(@NotNull Supplier<String> currentBuildNumberSupplier) booleanInitializes server key used forBambooEntityOids of this Bamboo instance based onserver ID.protected booleanprotected voidvoidbooleanvoidsetArtifactsDirectory(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.protected voidverifyLicenseIsSet(BambooLicenseManager licenseManager, boolean setupComplete) Methods inherited from class com.atlassian.config.internal.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, setTablesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
-
Field Details
-
CONFIG_DIRECTORY_PARAM
- See Also:
-
BUILD_DIRECTORY_PARAM
- See Also:
-
BUILD_WORKING_DIR
- See Also:
-
ARTIFACTS_DIR
- See Also:
-
REPOSITORY_LOGS_PARAM
- See Also:
-
-
Constructor Details
-
DefaultBootstrapManager
public DefaultBootstrapManager()
-
-
Method Details
-
afterConfigurationLoaded
protected void afterConfigurationLoaded() throws com.atlassian.config.ConfigurationException- Overrides:
afterConfigurationLoadedin classcom.atlassian.config.internal.bootstrap.DefaultAtlassianBootstrapManager- Throws:
com.atlassian.config.ConfigurationException
-
verifyLicenseIsSet
protected void verifyLicenseIsSet(BambooLicenseManager licenseManager, boolean setupComplete) throws com.atlassian.config.ConfigurationException - 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
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
- Specified by:
setConfigDirectoryin interfaceBootstrapManager
-
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
- Specified by:
setBuildWorkingDirectoryin interfaceBootstrapManager
-
setArtifactsDirectory
- Specified by:
setArtifactsDirectoryin interfaceBootstrapManager
-
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
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
- Specified by:
setBuildDirectoryin interfaceBootstrapManager
-
getRepositoryLogsDirectory
- Specified by:
getRepositoryLogsDirectoryin interfaceBootstrapManager- Returns:
- the root directory underneath which the repositories logs directories are located.
-
setRepositoryLogsDirectory
- Specified by:
setRepositoryLogsDirectoryin interfaceBootstrapManager
-
publishConfiguration
public void publishConfiguration()- Specified by:
publishConfigurationin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager- Overrides:
publishConfigurationin classcom.atlassian.config.internal.bootstrap.DefaultAtlassianBootstrapManager
-
getBrokerURI
- Specified by:
getBrokerURIin interfaceBootstrapManager- Throws:
URISyntaxException
-
setBrokerURI
- Specified by:
setBrokerURIin interfaceBootstrapManager
-
getBrokerClientURI
- Specified by:
getBrokerClientURIin interfaceBootstrapManager- Throws:
URISyntaxException
-
setBrokerClientURI
- Specified by:
setBrokerClientURIin interfaceBootstrapManager
-
performPersistenceUpgrade
protected boolean performPersistenceUpgrade()- Overrides:
performPersistenceUpgradein classcom.atlassian.config.internal.bootstrap.DefaultAtlassianBootstrapManager
-
postBootstrapDatabase
protected void postBootstrapDatabase() throws com.atlassian.config.bootstrap.BootstrapException- Overrides:
postBootstrapDatabasein classcom.atlassian.config.internal.bootstrap.DefaultAtlassianBootstrapManager- Throws:
com.atlassian.config.bootstrap.BootstrapException
-
getDbUrl
- Overrides:
getDbUrlin classcom.atlassian.config.internal.bootstrap.DefaultAtlassianBootstrapManager
-
getServerID
- Specified by:
getServerIDin interfaceBootstrapManager
-
setServerID
- 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
- Specified by:
getFingerprintin interfaceBootstrapManager- Returns:
- a unique identifier for this startup
-
getH2VersionFromConfig
- Specified by:
getH2VersionFromConfigin interfaceBootstrapManager
-
resetH2Version
public boolean resetH2Version()- Specified by:
resetH2Versionin interfaceBootstrapManager
-
setH2Version
- Specified by:
setH2Versionin interfaceBootstrapManager- Throws:
com.atlassian.config.ConfigurationException
-
getLocalHomePath
Description copied from interface:BootstrapManagerLocal home directory;- Specified by:
getLocalHomePathin interfaceBootstrapManager
-