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 String
ARTIFACTS_DIR
protected BambooSharedProperties
bambooSharedProperties
static String
BUILD_DIRECTORY_PARAM
static String
BUILD_WORKING_DIR
static String
CONFIG_DIRECTORY_PARAM
static String
REPOSITORY_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 void
afterConfigurationLoaded()
String
getArtifactsDirectory()
This method returns the root directory underneath which the artifacts are stored.BambooSharedProperties
getBambooSharedProperties()
Shared home properties (bamboo-shared.cfg.xml)URI
getBrokerClientURI()
URI
getBrokerURI()
String
getBuildDirectory()
Gets the directory where Bamboo's build files sit.String
getBuildWorkingDirectory()
This method returns the root directory underneath which the build directories are located.String
getConfigDirectory()
Gets the directory where Bamboo's administration.xml file sitsprotected String
getDbUrl(com.atlassian.config.db.DatabaseDetails dbDetails)
@NotNull ServerFingerprint
getFingerprint()
String
getH2VersionFromConfig()
String
getLocalHomePath()
Local home directory;String
getRepositoryLogsDirectory()
String
getServerID()
int
getServerKey()
Returns server key used forBambooEntityOid
s of this Bamboo instance.String
getSharedHomePath()
Shared home directory;boolean
initializeBuildNumberIfRequired()
protected boolean
initializeBuildNumberIfRequired(@NotNull Supplier<String> currentBuildNumberSupplier)
boolean
initializeServerKey()
Initializes server key used forBambooEntityOid
s of this Bamboo instance based onserver ID
.protected boolean
performPersistenceUpgrade()
protected void
postBootstrapDatabase()
void
publishConfiguration()
boolean
resetH2Version()
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.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:
afterConfigurationLoaded
in classcom.atlassian.config.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
public String 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
public void setConfigDirectory(String configurationDirectory)
- Specified by:
setConfigDirectory
in interfaceBootstrapManager
-
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 interfaceBootstrapManager
-
setBuildWorkingDirectory
public void setBuildWorkingDirectory(String buildWorkingDirectory)
- Specified by:
setBuildWorkingDirectory
in interfaceBootstrapManager
-
setArtifactsDirectory
public void setArtifactsDirectory(String artifactsDir)
- Specified by:
setArtifactsDirectory
in interfaceBootstrapManager
-
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 interfaceBootstrapManager
-
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 interfaceBootstrapManager
- Returns:
- String representing the path to the folder. Null if not configured
-
setBuildDirectory
public void setBuildDirectory(String buildDirectory)
- Specified by:
setBuildDirectory
in interfaceBootstrapManager
-
getRepositoryLogsDirectory
public String getRepositoryLogsDirectory()
- Specified by:
getRepositoryLogsDirectory
in interfaceBootstrapManager
- Returns:
- the root directory underneath which the repositories logs directories are located.
-
setRepositoryLogsDirectory
public void setRepositoryLogsDirectory(@NotNull @NotNull String repositoryLogsDirectory)
- Specified by:
setRepositoryLogsDirectory
in interfaceBootstrapManager
-
publishConfiguration
public void publishConfiguration()
- Specified by:
publishConfiguration
in interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
- Overrides:
publishConfiguration
in classcom.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager
-
getBrokerURI
public URI getBrokerURI() throws URISyntaxException
- Specified by:
getBrokerURI
in interfaceBootstrapManager
- Throws:
URISyntaxException
-
setBrokerURI
public void setBrokerURI(URI brokerURI)
- Specified by:
setBrokerURI
in interfaceBootstrapManager
-
getBrokerClientURI
public URI getBrokerClientURI() throws URISyntaxException
- Specified by:
getBrokerClientURI
in interfaceBootstrapManager
- Throws:
URISyntaxException
-
setBrokerClientURI
public void setBrokerClientURI(URI brokerURI)
- Specified by:
setBrokerClientURI
in interfaceBootstrapManager
-
performPersistenceUpgrade
protected boolean performPersistenceUpgrade()
- Overrides:
performPersistenceUpgrade
in classcom.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager
-
postBootstrapDatabase
protected void postBootstrapDatabase() throws com.atlassian.config.bootstrap.BootstrapException
- Overrides:
postBootstrapDatabase
in classcom.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager
- Throws:
com.atlassian.config.bootstrap.BootstrapException
-
getDbUrl
protected String getDbUrl(com.atlassian.config.db.DatabaseDetails dbDetails)
- Overrides:
getDbUrl
in classcom.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager
-
getServerID
public String getServerID()
- Specified by:
getServerID
in interfaceBootstrapManager
-
setServerID
public void setServerID(String serverId)
- 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
@NotNull public @NotNull ServerFingerprint getFingerprint()
- Specified by:
getFingerprint
in interfaceBootstrapManager
- Returns:
- a unique identifier for this startup
-
getH2VersionFromConfig
public String getH2VersionFromConfig()
- Specified by:
getH2VersionFromConfig
in interfaceBootstrapManager
-
resetH2Version
public boolean resetH2Version()
- Specified by:
resetH2Version
in interfaceBootstrapManager
-
setH2Version
public void setH2Version(String h2Version) throws com.atlassian.config.ConfigurationException
- Specified by:
setH2Version
in interfaceBootstrapManager
- Throws:
com.atlassian.config.ConfigurationException
-
getLocalHomePath
public String getLocalHomePath()
Description copied from interface:BootstrapManager
Local home directory;- Specified by:
getLocalHomePath
in interfaceBootstrapManager
-
getSharedHomePath
public String getSharedHomePath()
Description copied from interface:BootstrapManager
Shared home directory;- Specified by:
getSharedHomePath
in interfaceBootstrapManager
-
getBambooSharedProperties
public BambooSharedProperties getBambooSharedProperties()
Description copied from interface:BootstrapManager
Shared home properties (bamboo-shared.cfg.xml)- Specified by:
getBambooSharedProperties
in interfaceBootstrapManager
- Returns:
- BambooSharedProperties
-
-