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
Modifier and TypeFieldDescriptionstatic final String
protected BambooSharedProperties
static final String
static final String
static final String
static final String
Fields inherited from class com.atlassian.config.internal.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
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
This 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 String
getDbUrl
(com.atlassian.config.db.DatabaseDetails dbDetails) @NotNull ServerFingerprint
Local home directory;int
Returns server key used forBambooEntityOid
s of this Bamboo instance.Shared home directory;boolean
protected boolean
initializeBuildNumberIfRequired
(@NotNull Supplier<String> currentBuildNumberSupplier) boolean
Initializes server key used forBambooEntityOid
s of this Bamboo instance based onserver ID
.protected boolean
protected void
void
boolean
void
setArtifactsDirectory
(String artifactsDir) void
setBrokerClientURI
(URI brokerURI) void
setBrokerURI
(URI brokerURI) void
setBuildDirectory
(String buildDirectory) void
setBuildWorkingDirectory
(String buildWorkingDirectory) void
setConfigDirectory
(String configurationDirectory) void
setH2Version
(String h2Version) void
setRepositoryLogsDirectory
(@NotNull String repositoryLogsDirectory) void
setServerID
(String serverId) void
setServerKey
(int serverKey) Set server key used forBambooEntityOid
s for this Bamboo instance.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, 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 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:
afterConfigurationLoaded
in classcom.atlassian.config.internal.bootstrap.DefaultAtlassianBootstrapManager
- Throws:
com.atlassian.config.ConfigurationException
-
initializeBuildNumberIfRequired
public boolean initializeBuildNumberIfRequired() throws com.atlassian.config.ConfigurationException- Specified by:
initializeBuildNumberIfRequired
in 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:BootstrapManager
Gets the directory where Bamboo's administration.xml file sits- Specified by:
getConfigDirectory
in interfaceBootstrapManager
- Returns:
- String representing the path to the folder. Null if not configured
-
setConfigDirectory
- Specified by:
setConfigDirectory
in interfaceBootstrapManager
-
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 interfaceBootstrapManager
-
setBuildWorkingDirectory
- Specified by:
setBuildWorkingDirectory
in interfaceBootstrapManager
-
setArtifactsDirectory
- Specified by:
setArtifactsDirectory
in interfaceBootstrapManager
-
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 interfaceBootstrapManager
-
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 interfaceBootstrapManager
- Returns:
- String representing the path to the folder. Null if not configured
-
setBuildDirectory
- Specified by:
setBuildDirectory
in interfaceBootstrapManager
-
getRepositoryLogsDirectory
- Specified by:
getRepositoryLogsDirectory
in interfaceBootstrapManager
- Returns:
- the root directory underneath which the repositories logs directories are located.
-
setRepositoryLogsDirectory
- Specified by:
setRepositoryLogsDirectory
in interfaceBootstrapManager
-
publishConfiguration
public void publishConfiguration()- Specified by:
publishConfiguration
in interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
- Overrides:
publishConfiguration
in classcom.atlassian.config.internal.bootstrap.DefaultAtlassianBootstrapManager
-
getBrokerURI
- Specified by:
getBrokerURI
in interfaceBootstrapManager
- Throws:
URISyntaxException
-
setBrokerURI
- Specified by:
setBrokerURI
in interfaceBootstrapManager
-
getBrokerClientURI
- Specified by:
getBrokerClientURI
in interfaceBootstrapManager
- Throws:
URISyntaxException
-
setBrokerClientURI
- Specified by:
setBrokerClientURI
in interfaceBootstrapManager
-
performPersistenceUpgrade
protected boolean performPersistenceUpgrade()- Overrides:
performPersistenceUpgrade
in classcom.atlassian.config.internal.bootstrap.DefaultAtlassianBootstrapManager
-
postBootstrapDatabase
protected void postBootstrapDatabase() throws com.atlassian.config.bootstrap.BootstrapException- Overrides:
postBootstrapDatabase
in classcom.atlassian.config.internal.bootstrap.DefaultAtlassianBootstrapManager
- Throws:
com.atlassian.config.bootstrap.BootstrapException
-
getDbUrl
- Overrides:
getDbUrl
in classcom.atlassian.config.internal.bootstrap.DefaultAtlassianBootstrapManager
-
getServerID
- Specified by:
getServerID
in interfaceBootstrapManager
-
setServerID
- Specified by:
setServerID
in interfaceBootstrapManager
-
initializeServerKey
public boolean initializeServerKey()Description copied from interface:BootstrapManager
Initializes server key used forBambooEntityOid
s of this Bamboo instance based onserver ID
. Does nothing if the server key is already configured. This method should be externally synchronized.- Specified by:
initializeServerKey
in interfaceBootstrapManager
- Returns:
- true if server key has been initialized, false otherwise
-
getServerKey
public int getServerKey()Description copied from interface:BootstrapManager
Returns server key used forBambooEntityOid
s of this Bamboo instance.- Specified by:
getServerKey
in interfaceBootstrapManager
-
setServerKey
public void setServerKey(int serverKey) Description copied from interface:BootstrapManager
Set server key used forBambooEntityOid
s for this Bamboo instance.- Specified by:
setServerKey
in interfaceBootstrapManager
- Parameters:
serverKey
- server key of this instance
-
getFingerprint
- Specified by:
getFingerprint
in interfaceBootstrapManager
- Returns:
- a unique identifier for this startup
-
getH2VersionFromConfig
- Specified by:
getH2VersionFromConfig
in interfaceBootstrapManager
-
resetH2Version
public boolean resetH2Version()- Specified by:
resetH2Version
in interfaceBootstrapManager
-
setH2Version
- Specified by:
setH2Version
in interfaceBootstrapManager
- Throws:
com.atlassian.config.ConfigurationException
-
getLocalHomePath
Description copied from interface:BootstrapManager
Local home directory;- Specified by:
getLocalHomePath
in interfaceBootstrapManager
-