com.atlassian.bamboo.container
Class BambooContainer

java.lang.Object
  extended by com.atlassian.bamboo.container.BambooContainer
All Implemented Interfaces:
Bamboo

public class BambooContainer
extends Object
implements Bamboo

This class uses an IoC container to glue together the various Bamboo build server components.


Field Summary
 
Fields inherited from interface com.atlassian.bamboo.Bamboo
BAMBOO_KEY
 
Constructor Summary
BambooContainer()
           
 
Method Summary
 void addBuildListener(BuildEventListener listener)
          Register the given build start listener with system build detector
 void clearErrorMessages()
          deletes all error messages
 void deleteBuild(Build build)
          Remove the given build from the system.
 void deleteBuildResults(Build build, long buildNumber)
          Remove the build's build results
 AdministrationConfiguration getAdministrationConfiguration()
           
 Collection getAllBuildJdks()
          Get all the available JDKs.
static BambooContainer getBambooContainer()
           
 BambooSmackClient getBambooSmackClient()
           
 File getBuildDirectory()
          Where do we build builds?
 Map getBuilderLabelPathMaps()
          Returns a list of the registered build tools
 BuilderManager getBuilderManager()
           
 ErrorDetails getBuildErrorDetails(String buildName, int errorNumber)
          Obtain the errorNumber'th error for the given buildName from the internal system error log
 BuildExpiryConfiguration getBuildExpiryConfiguration()
          Obtain the system's build expiry configuration
 BuildManager getBuildManager()
           
 List getBuildQueues()
          Get the build queue
 BuildResults getBuildResults(Build build, long buildNumber)
          Obtain the specific build build results
 Build getBuildWithKey(String buildKey)
          Obtain the build with the given buildKey.
 Persister getDefaultPersister()
          Which persister is the system using?
 Collection getErrorMessages()
          What error messages have we detected to far?
 Collection getErrorMessages(String buildName)
          Obtain all of the logged error messages associated with a build
 Collection getRepositories()
          Returns a list of all the registered source code repository tools
 Map getRepositoriesMap()
           
 Repository getRepository(String repositoryName)
          Returns a specified source code repository tool
 Scheduler getScheduler()
           
 SessionManager getSessionManager()
          Which session manager is the system using?
 ShutdownHook getShutdownHook()
           
 VelocityEngine getVelocityEngine()
           
 String getVersion()
          What is the version of the application
 void initialise()
          Initialises the Bamboo give the application root
 void initialiseBuilds(Persister persister)
          Initialise the builds/build strategies so that they are intialised when the server is started.
 boolean isInitialised()
          Has the system been initialised correctly
 void killBuild(Build build, User user)
          Remove the build from the build queue.
 void removeBuildErrorFromLog(String buildName, int errorNumber)
          Remove the errorNumber'th error for the given buildName from the internal system error log
 void removeBuildFromQueues(Build build)
           
 void reportBuildConfigurationProblems(Persister persister, ErrorHandler errorHandler)
           
 void restartComponentsFollowingConfigurationChange()
          Restart the configuration dependent components
static void setBambooContainer(BambooContainer bambooContainer)
           
 void setBambooSmackClient(BambooSmackClient bambooSmackClient)
           
 void setBambooUserManager(BambooUserManager bambooUserManager)
           
 void setBuilderManager(BuilderManager builderManager)
           
 void setBuildEventNotifier(BuildEventNotifier buildEventNotifier)
           
 void setBuildExpiryConfiguration(BuildExpiryConfiguration buildExpiryConfiguration)
          Adjust the system's build expiry confguration
 void setBuildManager(BuildManager buildManager)
           
 void setErrorHandler(ErrorHandler errorHandler)
           
 void setPersister(Persister persister)
           
 void setPipelineManager(PipelineManager pipelineManager)
           
 void setPluginManager(PluginManager pluginManager)
           
 void setScheduler(Scheduler scheduler)
           
 void start()
          Start the container's compontents
protected  void startJobScheduler()
           
 void stop()
          Stop the container's components
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BambooContainer

public BambooContainer()
                throws Exception
Throws:
Exception
Method Detail

initialise

public void initialise()
                throws Exception
Initialises the Bamboo give the application root

Throws:
Exception

setPluginManager

public void setPluginManager(PluginManager pluginManager)

start

public void start()
Start the container's compontents

Specified by:
start in interface Bamboo

startJobScheduler

protected void startJobScheduler()

getShutdownHook

public ShutdownHook getShutdownHook()

initialiseBuilds

public void initialiseBuilds(Persister persister)
Initialise the builds/build strategies so that they are intialised when the server is started.


reportBuildConfigurationProblems

public void reportBuildConfigurationProblems(Persister persister,
                                             ErrorHandler errorHandler)

stop

public void stop()
Stop the container's components

Specified by:
stop in interface Bamboo

addBuildListener

public void addBuildListener(BuildEventListener listener)
Register the given build start listener with system build detector

Specified by:
addBuildListener in interface Bamboo
Parameters:
listener - The listener

restartComponentsFollowingConfigurationChange

public void restartComponentsFollowingConfigurationChange()
Restart the configuration dependent components

Specified by:
restartComponentsFollowingConfigurationChange in interface Bamboo

getBuilderLabelPathMaps

public Map getBuilderLabelPathMaps()
Returns a list of the registered build tools

Specified by:
getBuilderLabelPathMaps in interface Bamboo
Returns:
The builders

getRepositories

public Collection getRepositories()
Returns a list of all the registered source code repository tools

Specified by:
getRepositories in interface Bamboo
Returns:
The repositories

getRepositoriesMap

public Map getRepositoriesMap()

getRepository

public Repository getRepository(String repositoryName)
Returns a specified source code repository tool

Specified by:
getRepository in interface Bamboo
Parameters:
repositoryName - The name of the tool
Returns:
The tool

getAllBuildJdks

public Collection getAllBuildJdks()
Description copied from interface: Bamboo
Get all the available JDKs.

Specified by:
getAllBuildJdks in interface Bamboo
Returns:
The collection of JDKs

getBuildWithKey

public Build getBuildWithKey(String buildKey)
Obtain the build with the given buildKey.

Specified by:
getBuildWithKey in interface Bamboo
Parameters:
buildKey - the build's unique key
Returns:
The build

killBuild

public void killBuild(Build build,
                      User user)
Description copied from interface: Bamboo
Remove the build from the build queue.

Specified by:
killBuild in interface Bamboo
Parameters:
build - The build who's build we want to kill

removeBuildFromQueues

public void removeBuildFromQueues(Build build)
Specified by:
removeBuildFromQueues in interface Bamboo

getBuildQueues

public List getBuildQueues()
Get the build queue

Specified by:
getBuildQueues in interface Bamboo
Returns:
The Q

getVersion

public String getVersion()
What is the version of the application

Specified by:
getVersion in interface Bamboo
Returns:
the version

getBuildDirectory

public File getBuildDirectory()
Where do we build builds?

Specified by:
getBuildDirectory in interface Bamboo
Returns:
The system build directory

getBuildResults

public BuildResults getBuildResults(Build build,
                                    long buildNumber)
Obtain the specific build build results

Specified by:
getBuildResults in interface Bamboo
Parameters:
build - The build we are interested in
buildNumber - The build we are intrested in
Returns:
The build results, null if none found

getErrorMessages

public Collection getErrorMessages()
What error messages have we detected to far?

Specified by:
getErrorMessages in interface Bamboo
Returns:
The error messages

getErrorMessages

public Collection getErrorMessages(String buildName)
Description copied from interface: Bamboo
Obtain all of the logged error messages associated with a build

Specified by:
getErrorMessages in interface Bamboo
Returns:
the collection of ErrorMessage objects

clearErrorMessages

public void clearErrorMessages()
Description copied from interface: Bamboo
deletes all error messages

Specified by:
clearErrorMessages in interface Bamboo

removeBuildErrorFromLog

public void removeBuildErrorFromLog(String buildName,
                                    int errorNumber)
Description copied from interface: Bamboo
Remove the errorNumber'th error for the given buildName from the internal system error log

Specified by:
removeBuildErrorFromLog in interface Bamboo
Parameters:
buildName - The name of the build with the associated error
errorNumber - The error number (zero based index of error associated with build)

getBuildErrorDetails

public ErrorDetails getBuildErrorDetails(String buildName,
                                         int errorNumber)
Description copied from interface: Bamboo
Obtain the errorNumber'th error for the given buildName from the internal system error log

Specified by:
getBuildErrorDetails in interface Bamboo
Parameters:
buildName - The name of the build with the associated error
errorNumber - The error number (zero based index of error associated with build)

isInitialised

public boolean isInitialised()
Has the system been initialised correctly

Specified by:
isInitialised in interface Bamboo
Returns:
true iff its been initalised, false otherwise

deleteBuild

public void deleteBuild(Build build)
Remove the given build from the system.

Specified by:
deleteBuild in interface Bamboo
Parameters:
build - The build to delete

deleteBuildResults

public void deleteBuildResults(Build build,
                               long buildNumber)
Description copied from interface: Bamboo
Remove the build's build results

Specified by:
deleteBuildResults in interface Bamboo
Parameters:
build - The build who's build we are deleting
buildNumber - The number of the build to delete

getDefaultPersister

public Persister getDefaultPersister()
Description copied from interface: Bamboo
Which persister is the system using?

Specified by:
getDefaultPersister in interface Bamboo
Returns:
The persister

getSessionManager

public SessionManager getSessionManager()
Description copied from interface: Bamboo
Which session manager is the system using?

Specified by:
getSessionManager in interface Bamboo
Returns:
The session manager

getBuildExpiryConfiguration

public BuildExpiryConfiguration getBuildExpiryConfiguration()
Description copied from interface: Bamboo
Obtain the system's build expiry configuration

Specified by:
getBuildExpiryConfiguration in interface Bamboo
Returns:
The config

setBuildExpiryConfiguration

public void setBuildExpiryConfiguration(BuildExpiryConfiguration buildExpiryConfiguration)
Description copied from interface: Bamboo
Adjust the system's build expiry confguration

Specified by:
setBuildExpiryConfiguration in interface Bamboo

getAdministrationConfiguration

public AdministrationConfiguration getAdministrationConfiguration()
Specified by:
getAdministrationConfiguration in interface Bamboo

getBambooContainer

public static BambooContainer getBambooContainer()

setBambooContainer

public static void setBambooContainer(BambooContainer bambooContainer)

setBuilderManager

public void setBuilderManager(BuilderManager builderManager)

getBuilderManager

public BuilderManager getBuilderManager()
Specified by:
getBuilderManager in interface Bamboo

setBuildEventNotifier

public void setBuildEventNotifier(BuildEventNotifier buildEventNotifier)

setErrorHandler

public void setErrorHandler(ErrorHandler errorHandler)

setPipelineManager

public void setPipelineManager(PipelineManager pipelineManager)

setPersister

public void setPersister(Persister persister)

setBambooUserManager

public void setBambooUserManager(BambooUserManager bambooUserManager)

getBuildManager

public BuildManager getBuildManager()

setBuildManager

public void setBuildManager(BuildManager buildManager)

getScheduler

public Scheduler getScheduler()

setScheduler

public void setScheduler(Scheduler scheduler)

getVelocityEngine

public VelocityEngine getVelocityEngine()

getBambooSmackClient

public BambooSmackClient getBambooSmackClient()

setBambooSmackClient

public void setBambooSmackClient(BambooSmackClient bambooSmackClient)


Copyright © 2006 Atlassian Software Systems. All Rights Reserved.