com.atlassian.bamboo.build
Class HibernateBuildManager

java.lang.Object
  extended by com.atlassian.bamboo.build.HibernateBuildManager
All Implemented Interfaces:
BuildManager

public class HibernateBuildManager
extends java.lang.Object
implements BuildManager

A pisspoor build manager. It currently delegates all its methods to the BambooContainer


Constructor Summary
HibernateBuildManager()
           
 
Method Summary
 void addBuildResults(Build build, BuildResults buildResults)
           
 void addChildBuild(Build build, java.lang.String childBuildKey)
           
 void createBuild(Build build, BuildConfiguration buildConfiguration, HibernateAcl acl)
          Save a new build object with the passed buildConfiguration
 void deleteBuild(java.lang.String buildKey)
          Removes the build from system
 void deleteProject(Project project)
          Removes the project from the system
 java.util.Collection getAllBuilds()
          Returns a collection of all Build objects
 java.util.Collection getAllBuildsForClone()
           
 java.util.Collection getAllBuildsForEdit()
           
 java.util.Collection<Build> getAllBuildsForRead()
           
 java.util.Collection getAllProjects()
          Returns a collection of Project objects
 Build getBuildById(long id)
          Returns the build given the id
 Build getBuildByKey(java.lang.String key)
          Returns the build given a key
 Build getBuildByProjectAndName(java.lang.String projectKey, java.lang.String buildName)
           
 BuildResults getBuildResults(Build build, java.lang.Integer buildNumber)
           
 java.util.Collection getBuildsByProjectForRead(Project project)
          This is the manager equivalent of a project.getBuilds.
 java.util.Collection getBuildsForDeletion()
           
 Project getProjectById(long id)
          Returns the build given the id
 Project getProjectByKey(java.lang.String key)
          Returns the prokect given a project key
 Project getProjectByName(java.lang.String projectName)
           
 boolean isAllowBuilding(java.lang.String planKey)
          Checks if a particular build is allowed to be built.
 boolean isExistingBuildKey(java.lang.String givenKey)
          Is there an existing build with the same key?
 boolean isExistingBuildKey(java.lang.String projectKey, java.lang.String buildKey)
          Returns true if the build key already exists within the given project key
 boolean isExistingBuildName(java.lang.String buildName)
          Returns true if the build name already exists
 boolean isExistingBuildName(java.lang.String projectKey, java.lang.String buildName)
          Returns true if the build name already exists within the given project key
 boolean isExistingProjectKey(java.lang.String projectKey)
          Returns true if the project name already exists
 boolean isExistingProjectName(java.lang.String projectName)
          Returns true if the project name already exists
 void recordLastBuildNumber(Build build, BuildResultsSummary summary, BuildContext buildContext)
          Records the last build number built and also the vcsRevisionKey
 void removeDependencies(Build dependentBuild)
          Removes a build from all dependency lists.
 java.util.Collection<Build> retreiveAllBuilds()
           
 int retrieveNextBuildNumber(java.lang.String planKey)
           
 void saveBuild(Build build)
          Perists a build
 void saveBuildAndDefinition(Build build)
           
 void saveBuildConfig(Build build, BuildConfiguration buildConfiguration)
          Save an existing build with the given build configuration
 void setAclService(org.acegisecurity.acls.MutableAclService aclService)
           
 void setBuildDao(BuildDao buildDao)
           
 void setBuildDefinitionConverter(BuildDefinitionConverter buildDefinitionConverter)
           
 void setBuildDefinitionManager(BuildDefinitionManager buildDefinitionManager)
           
 void setBuildResultsSummaryManager(BuildResultsSummaryManager buildResultsSummaryManager)
           
 void setEventManager(com.atlassian.event.EventManager eventManager)
           
 void setProjectDao(ProjectDao projectDao)
           
 void updateLatestVcsKey(java.lang.String planKey, java.lang.String vcsRevisionKey)
          Updates the build to the latest passed revision key
 void updateNames(java.lang.String projectName, java.lang.String buildName, Build build)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateBuildManager

public HibernateBuildManager()
Method Detail

removeDependencies

public void removeDependencies(Build dependentBuild)
Description copied from interface: BuildManager
Removes a build from all dependency lists. I.e. No builds will trigger the build specified.

Specified by:
removeDependencies in interface BuildManager
Parameters:
dependentBuild - - the name of the build that is triggered

getBuildByKey

@Nullable
public Build getBuildByKey(java.lang.String key)
Description copied from interface: BuildManager
Returns the build given a key

Specified by:
getBuildByKey in interface BuildManager
Parameters:
key - - full key of the build. eg. BAM-MAIN null safe
Returns:
A Build if the key matches. Otherwise null

getBuildById

public Build getBuildById(long id)
Description copied from interface: BuildManager
Returns the build given the id

Specified by:
getBuildById in interface BuildManager
Returns:
A Build. null if not found.

getAllBuilds

public java.util.Collection getAllBuilds()
Description copied from interface: BuildManager
Returns a collection of all Build objects

Specified by:
getAllBuilds in interface BuildManager
Returns:
all builds in the system, Collections.EMPTY_LIST if none exists

getAllBuildsForRead

public java.util.Collection<Build> getAllBuildsForRead()
Specified by:
getAllBuildsForRead in interface BuildManager

retreiveAllBuilds

public java.util.Collection<Build> retreiveAllBuilds()
Specified by:
retreiveAllBuilds in interface BuildManager

getAllBuildsForEdit

public java.util.Collection getAllBuildsForEdit()
Specified by:
getAllBuildsForEdit in interface BuildManager

getAllBuildsForClone

public java.util.Collection getAllBuildsForClone()
Specified by:
getAllBuildsForClone in interface BuildManager

getBuildsForDeletion

public java.util.Collection getBuildsForDeletion()
Specified by:
getBuildsForDeletion in interface BuildManager

getBuildsByProjectForRead

public java.util.Collection getBuildsByProjectForRead(Project project)
Description copied from interface: BuildManager
This is the manager equivalent of a project.getBuilds. However, this is permission filtered.

Specified by:
getBuildsByProjectForRead in interface BuildManager
Returns:

getProjectById

public Project getProjectById(long id)
Description copied from interface: BuildManager
Returns the build given the id

Specified by:
getProjectById in interface BuildManager
Returns:
A Project. null if not found.

isExistingBuildName

public boolean isExistingBuildName(java.lang.String buildName)
Description copied from interface: BuildManager
Returns true if the build name already exists

Specified by:
isExistingBuildName in interface BuildManager
Parameters:
buildName - name to check
Returns:
true if the build name already exists

isExistingBuildKey

public boolean isExistingBuildKey(java.lang.String givenKey)
Is there an existing build with the same key?

Specified by:
isExistingBuildKey in interface BuildManager
Parameters:
givenKey -
Returns:
true if another build exists with the givenKey

isExistingProjectName

public boolean isExistingProjectName(java.lang.String projectName)
Description copied from interface: BuildManager
Returns true if the project name already exists

Specified by:
isExistingProjectName in interface BuildManager
Parameters:
projectName - to check
Returns:
true if projectName already exists

isExistingProjectKey

public boolean isExistingProjectKey(java.lang.String projectKey)
Description copied from interface: BuildManager
Returns true if the project name already exists

Specified by:
isExistingProjectKey in interface BuildManager
Returns:
true if projectName already exists

isExistingBuildName

public boolean isExistingBuildName(java.lang.String projectKey,
                                   java.lang.String buildName)
Description copied from interface: BuildManager
Returns true if the build name already exists within the given project key

Specified by:
isExistingBuildName in interface BuildManager
Parameters:
projectKey - (doesn't have to exist for this check)
buildName - to check
Returns:
true if build name already exists in that project

isExistingBuildKey

public boolean isExistingBuildKey(java.lang.String projectKey,
                                  java.lang.String buildKey)
Description copied from interface: BuildManager
Returns true if the build key already exists within the given project key

Specified by:
isExistingBuildKey in interface BuildManager
Parameters:
projectKey - (doesn't have to exist for this check)
buildKey - to check
Returns:
true if build name already exists in that project

createBuild

public void createBuild(Build build,
                        BuildConfiguration buildConfiguration,
                        HibernateAcl acl)
Description copied from interface: BuildManager
Save a new build object with the passed buildConfiguration

Specified by:
createBuild in interface BuildManager
Parameters:
build - @NotNull
buildConfiguration - @NotNull

saveBuild

public void saveBuild(Build build)
Description copied from interface: BuildManager
Perists a build

Specified by:
saveBuild in interface BuildManager
Parameters:
build - cannot be null

saveBuildConfig

public void saveBuildConfig(Build build,
                            BuildConfiguration buildConfiguration)
Description copied from interface: BuildManager
Save an existing build with the given build configuration

Specified by:
saveBuildConfig in interface BuildManager
Parameters:
build - @NotNull
buildConfiguration - @NotNull

saveBuildAndDefinition

public void saveBuildAndDefinition(Build build)
Specified by:
saveBuildAndDefinition in interface BuildManager

retrieveNextBuildNumber

public int retrieveNextBuildNumber(java.lang.String planKey)
Specified by:
retrieveNextBuildNumber in interface BuildManager

recordLastBuildNumber

public void recordLastBuildNumber(Build build,
                                  BuildResultsSummary summary,
                                  BuildContext buildContext)
Description copied from interface: BuildManager
Records the last build number built and also the vcsRevisionKey

Specified by:
recordLastBuildNumber in interface BuildManager

addChildBuild

public void addChildBuild(Build build,
                          java.lang.String childBuildKey)
Specified by:
addChildBuild in interface BuildManager

getProjectByName

public Project getProjectByName(java.lang.String projectName)
Specified by:
getProjectByName in interface BuildManager

getBuildByProjectAndName

public Build getBuildByProjectAndName(java.lang.String projectKey,
                                      java.lang.String buildName)
Specified by:
getBuildByProjectAndName in interface BuildManager

updateNames

public void updateNames(java.lang.String projectName,
                        java.lang.String buildName,
                        Build build)
Specified by:
updateNames in interface BuildManager

updateLatestVcsKey

public void updateLatestVcsKey(@NotNull
                               java.lang.String planKey,
                               @NotNull
                               java.lang.String vcsRevisionKey)
Description copied from interface: BuildManager
Updates the build to the latest passed revision key

Specified by:
updateLatestVcsKey in interface BuildManager
Parameters:
planKey - - Plan key
vcsRevisionKey - - revision key

isAllowBuilding

public boolean isAllowBuilding(@NotNull
                               java.lang.String planKey)
Description copied from interface: BuildManager
Checks if a particular build is allowed to be built. It checks if it exists, not suspened, and that there is no global flag that has stopped building

Specified by:
isAllowBuilding in interface BuildManager
Returns:
true if the planKey is a valid build that is allowed to be built

getAllProjects

public java.util.Collection getAllProjects()
Description copied from interface: BuildManager
Returns a collection of Project objects

Specified by:
getAllProjects in interface BuildManager
Returns:
all Projects in the system, Collections.EMPTY_LIST if none exists

getProjectByKey

public Project getProjectByKey(java.lang.String key)
Description copied from interface: BuildManager
Returns the prokect given a project key

Specified by:
getProjectByKey in interface BuildManager
Parameters:
key - - the project key e.g. BAMBOO (not BAMBOO-TRUNK)
Returns:
A Project if the key matches. Otherwise null

deleteBuild

public void deleteBuild(java.lang.String buildKey)
Description copied from interface: BuildManager
Removes the build from system

Specified by:
deleteBuild in interface BuildManager
Parameters:
buildKey - String name for build

deleteProject

public void deleteProject(Project project)
Description copied from interface: BuildManager
Removes the project from the system

Specified by:
deleteProject in interface BuildManager
Parameters:
project - project

addBuildResults

public void addBuildResults(Build build,
                            BuildResults buildResults)
Specified by:
addBuildResults in interface BuildManager

getBuildResults

public BuildResults getBuildResults(Build build,
                                    java.lang.Integer buildNumber)
Specified by:
getBuildResults in interface BuildManager

setBuildDefinitionConverter

public void setBuildDefinitionConverter(BuildDefinitionConverter buildDefinitionConverter)

setBuildDao

public void setBuildDao(BuildDao buildDao)

setProjectDao

public void setProjectDao(ProjectDao projectDao)

setBuildDefinitionManager

public void setBuildDefinitionManager(BuildDefinitionManager buildDefinitionManager)

setBuildResultsSummaryManager

public void setBuildResultsSummaryManager(BuildResultsSummaryManager buildResultsSummaryManager)

setAclService

public void setAclService(org.acegisecurity.acls.MutableAclService aclService)

setEventManager

public void setEventManager(com.atlassian.event.EventManager eventManager)


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.