com.atlassian.bamboo.build
Interface BuildManager

All Known Implementing Classes:
HibernateBuildManager

public interface BuildManager

Manager to handle all build related activities


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<Build> getAllBuilds()
          Returns a collection of all Build objects
 java.util.Collection<Build> getAllBuildsForClone()
           
 java.util.Collection<Build> getAllBuildsForEdit()
           
 java.util.Collection<Build> getAllBuildsForRead()
           
 java.util.Collection<Project> 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<Build> 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 buildKey)
          Returns true if the build key already exists
 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 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)
           
 

Method Detail

removeDependencies

void removeDependencies(Build dependentBuild)
Removes a build from all dependency lists. I.e. No builds will trigger the build specified.

Parameters:
dependentBuild - - the name of the build that is triggered

getBuildByKey

@Nullable
Build getBuildByKey(java.lang.String key)
Returns the build given a key

Parameters:
key - - full key of the build. eg. BAM-MAIN null safe
Returns:
A Build if the key matches. Otherwise null

getBuildById

Build getBuildById(long id)
Returns the build given the id

Parameters:
id -
Returns:
A Build. null if not found.

getAllBuilds

java.util.Collection<Build> getAllBuilds()
Returns a collection of all Build objects

Returns:
all builds in the system, Collections.EMPTY_LIST if none exists

getAllBuildsForRead

java.util.Collection<Build> getAllBuildsForRead()

retreiveAllBuilds

java.util.Collection<Build> retreiveAllBuilds()

getAllBuildsForEdit

java.util.Collection<Build> getAllBuildsForEdit()

getAllBuildsForClone

java.util.Collection<Build> getAllBuildsForClone()

getBuildsForDeletion

java.util.Collection<Build> getBuildsForDeletion()

getBuildsByProjectForRead

java.util.Collection getBuildsByProjectForRead(Project project)
This is the manager equivalent of a project.getBuilds. However, this is permission filtered.

Parameters:
project -
Returns:

getAllProjects

java.util.Collection<Project> getAllProjects()
Returns a collection of Project objects

Returns:
all Projects in the system, Collections.EMPTY_LIST if none exists

getProjectByKey

Project getProjectByKey(java.lang.String key)
Returns the prokect given a project key

Parameters:
key - - the project key e.g. BAMBOO (not BAMBOO-TRUNK)
Returns:
A Project if the key matches. Otherwise null

getProjectById

Project getProjectById(long id)
Returns the build given the id

Parameters:
id -
Returns:
A Project. null if not found.

isExistingBuildName

boolean isExistingBuildName(java.lang.String buildName)
Returns true if the build name already exists

Parameters:
buildName - name to check
Returns:
true if the build name already exists

isExistingBuildKey

boolean isExistingBuildKey(java.lang.String buildKey)
Returns true if the build key already exists

Parameters:
buildKey - key of the build
Returns:
true if buildKey already exists

isExistingProjectName

boolean isExistingProjectName(java.lang.String projectName)
Returns true if the project name already exists

Parameters:
projectName - to check
Returns:
true if projectName already exists

isExistingProjectKey

boolean isExistingProjectKey(java.lang.String projectKey)
Returns true if the project name already exists

Parameters:
projectName - to check
Returns:
true if projectName already exists

isExistingBuildName

boolean isExistingBuildName(java.lang.String projectKey,
                            java.lang.String buildName)
Returns true if the build name already exists within the given project key

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

isExistingBuildKey

boolean isExistingBuildKey(java.lang.String projectKey,
                           java.lang.String buildKey)
Returns true if the build key already exists within the given project key

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

createBuild

void createBuild(Build build,
                 BuildConfiguration buildConfiguration,
                 HibernateAcl acl)
Save a new build object with the passed buildConfiguration

Parameters:
build - @NotNull
buildConfiguration - @NotNull

saveBuild

void saveBuild(Build build)
Perists a build

Parameters:
build - cannot be null

saveBuildAndDefinition

void saveBuildAndDefinition(Build build)

saveBuildConfig

void saveBuildConfig(Build build,
                     BuildConfiguration buildConfiguration)
Save an existing build with the given build configuration

Parameters:
build - @NotNull
buildConfiguration - @NotNull

deleteBuild

void deleteBuild(java.lang.String buildKey)
Removes the build from system

Parameters:
buildKey - String name for build

deleteProject

void deleteProject(Project project)
Removes the project from the system

Parameters:
project - project

addBuildResults

void addBuildResults(Build build,
                     BuildResults buildResults)

getBuildResults

BuildResults getBuildResults(Build build,
                             java.lang.Integer buildNumber)

retrieveNextBuildNumber

int retrieveNextBuildNumber(java.lang.String planKey)

recordLastBuildNumber

void recordLastBuildNumber(Build build,
                           BuildResultsSummary summary,
                           BuildContext buildContext)
Records the last build number built and also the vcsRevisionKey

Parameters:
build -
summary -
buildContext -

addChildBuild

void addChildBuild(Build build,
                   java.lang.String childBuildKey)

getProjectByName

Project getProjectByName(java.lang.String projectName)

getBuildByProjectAndName

Build getBuildByProjectAndName(java.lang.String projectKey,
                               java.lang.String buildName)

updateNames

void updateNames(java.lang.String projectName,
                 java.lang.String buildName,
                 Build build)

updateLatestVcsKey

void updateLatestVcsKey(@NotNull
                        java.lang.String planKey,
                        @NotNull
                        java.lang.String vcsRevisionKey)
Updates the build to the latest passed revision key

Parameters:
planKey - - Plan key
vcsRevisionKey - - revision key

isAllowBuilding

boolean isAllowBuilding(@NotNull
                        java.lang.String planKey)
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

Parameters:
planKey -
Returns:
true if the planKey is a valid build that is allowed to be built


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.