com.atlassian.bamboo.build
Class DefaultBuildDefinition

java.lang.Object
  extended by com.atlassian.bamboo.build.DefaultBuildDefinition
All Implemented Interfaces:
BuildDefinition, PartialBuildDefinition
Direct Known Subclasses:
PartialBuildDefinitionImpl

public class DefaultBuildDefinition
extends Object
implements BuildDefinition


Field Summary
protected  BranchIntegrationConfiguration branchIntegrationConfiguration
           
protected  BranchMonitoringConfiguration branchMonitoringConfiguration
           
protected  BranchSpecificConfiguration branchSpecificConfiguration
           
protected  Boolean cleanWorkingDirectory
           
protected  Map<String,Object> configObjects
           
protected  Map<String,String> customConfiguration
           
protected  Long repositoryDefiningWorkingDir
           
protected  List<TaskDefinition> taskDefinitions
           
protected  com.google.common.collect.ImmutableList<TriggerDefinition> triggerDefinitions
           
protected  String workingDirectory
           
protected  String xmlData
           
 
Constructor Summary
DefaultBuildDefinition(boolean merged)
           
 
Method Summary
 BranchIntegrationConfiguration getBranchIntegrationConfiguration()
          Returns ChainBranch integration strategy settings, including the branch to merge with, and...
 BranchMonitoringConfiguration getBranchMonitoringConfiguration()
          Returns the current branch monitoring configuration of a build plan.
 BranchSpecificConfiguration getBranchSpecificConfiguration()
          Returns any configuration that is specific to a branch plan, and not so relevant for a normal plan.
 List<BuildStrategy> getBuildStrategies()
          Returns triggers defined for this object as BuildStrategies.
 Map<String,Object> getConfigObjects()
          Returns a map of objects generated by the plugins.
 Map<String,String> getCustomConfiguration()
          /**
 Long getRepositoryIdDefiningWorkingDir()
           
 List<TaskDefinition> getTaskDefinitions()
          All tasks defined for this build.
 com.google.common.collect.ImmutableList<TriggerDefinition> getTriggerDefinitions()
          Definitions of all automatic build triggers defined for this build.
 Boolean isCleanWorkingDirectory()
          Should the working directory be cleaned after build.
 boolean isMerged()
           
 boolean isValidValue(Object validValue)
          Whether or not a given object is a valid value for this BuildDefinition.
 void setBranchIntegrationConfiguration(BranchIntegrationConfiguration branchIntegrationConfiguration)
           
 void setBranchMonitoringConfiguration(BranchMonitoringConfiguration branchMonitoringConfiguration)
           
 void setBranchSpecificConfiguration(BranchSpecificConfiguration branchSpecificConfiguration)
           
 void setBuildStrategies(List<BuildStrategy> buildStrategies)
          Replace existing list of triggers with a new one.
 void setCleanWorkingDirectory(boolean cleanWorkingDirectory)
          Set the working directory be cleaned or not cleaned after build
 void setConfigObjects(Map<String,Object> configObjects)
           
 void setCustomConfiguration(Map<String,String> customConfiguration)
          A map of String key and String value pairs, representing custom
 void setMerged(boolean value)
          Set whether or not this BuildDefinition has been merged from multiple sources.
 void setRepositoryIdDefiningWorkingDir(long repositoryDefiningWorkingDir)
           
 void setTaskDefinitions(List<TaskDefinition> taskConfigs)
           
 void setTriggerDefinitions(List<TriggerDefinition> triggerDefinitions)
          Replace existing list of triggers with a new one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cleanWorkingDirectory

protected Boolean cleanWorkingDirectory

branchMonitoringConfiguration

protected BranchMonitoringConfiguration branchMonitoringConfiguration

branchIntegrationConfiguration

protected BranchIntegrationConfiguration branchIntegrationConfiguration

branchSpecificConfiguration

protected BranchSpecificConfiguration branchSpecificConfiguration

xmlData

protected String xmlData

workingDirectory

protected String workingDirectory

customConfiguration

protected Map<String,String> customConfiguration

configObjects

protected transient Map<String,Object> configObjects

taskDefinitions

protected transient List<TaskDefinition> taskDefinitions

triggerDefinitions

protected com.google.common.collect.ImmutableList<TriggerDefinition> triggerDefinitions

repositoryDefiningWorkingDir

protected Long repositoryDefiningWorkingDir
Constructor Detail

DefaultBuildDefinition

public DefaultBuildDefinition(boolean merged)
Method Detail

getBuildStrategies

@Contract(value=" -> !null")
public List<BuildStrategy> getBuildStrategies()
Description copied from interface: BuildDefinition
Returns triggers defined for this object as BuildStrategies. The result of this function is produced by calling BuildDefinition.getTriggerDefinitions() and converting its results. Note that this conversion can be lossy, as not all trigger types are convertible to BuildStrategies. Items that cannot be converted are skipped.

Specified by:
getBuildStrategies in interface BuildDefinition
Specified by:
getBuildStrategies in interface PartialBuildDefinition
Returns:
triggers defined for this object.

setBuildStrategies

public void setBuildStrategies(@Nullable
                               List<BuildStrategy> buildStrategies)
Description copied from interface: BuildDefinition
Replace existing list of triggers with a new one. Setting null indicates that buildStrategies should be inherited from master chain.

Specified by:
setBuildStrategies in interface BuildDefinition
Parameters:
buildStrategies - List of BuildStrategy

getTriggerDefinitions

@Contract(value=" -> !null")
public com.google.common.collect.ImmutableList<TriggerDefinition> getTriggerDefinitions()
Description copied from interface: BuildDefinition
Definitions of all automatic build triggers defined for this build. If this list is empty, Plan is only triggered manually or through dependencies.

Specified by:
getTriggerDefinitions in interface BuildDefinition
Specified by:
getTriggerDefinitions in interface PartialBuildDefinition
Returns:
immutable list of defined triggers

setTriggerDefinitions

public void setTriggerDefinitions(@Nullable
                                  List<TriggerDefinition> triggerDefinitions)
Description copied from interface: BuildDefinition
Replace existing list of triggers with a new one. Setting null indicates that triggerDefinitions should be inherited from master chain.

Specified by:
setTriggerDefinitions in interface BuildDefinition
Parameters:
triggerDefinitions - List of TriggerDefinition

getBranchMonitoringConfiguration

@Contract(value=" -> !null")
public BranchMonitoringConfiguration getBranchMonitoringConfiguration()
Description copied from interface: BuildDefinition
Returns the current branch monitoring configuration of a build plan. This configuration includes all plan branches settings, as if plan branch creation and plan branch cleanup are enabled, for instance.

Specified by:
getBranchMonitoringConfiguration in interface BuildDefinition
Specified by:
getBranchMonitoringConfiguration in interface PartialBuildDefinition
Returns:
BranchMonitoringConfiguration

setBranchMonitoringConfiguration

public void setBranchMonitoringConfiguration(@Nullable
                                             BranchMonitoringConfiguration branchMonitoringConfiguration)
Specified by:
setBranchMonitoringConfiguration in interface BuildDefinition

getBranchIntegrationConfiguration

@Contract(value=" -> !null")
public BranchIntegrationConfiguration getBranchIntegrationConfiguration()
Description copied from interface: BuildDefinition
Returns ChainBranch integration strategy settings, including the branch to merge with, and... //todo

Specified by:
getBranchIntegrationConfiguration in interface BuildDefinition
Specified by:
getBranchIntegrationConfiguration in interface PartialBuildDefinition
Returns:
current BranchIntegrationConfiguration

setBranchIntegrationConfiguration

public void setBranchIntegrationConfiguration(@Nullable
                                              BranchIntegrationConfiguration branchIntegrationConfiguration)
Specified by:
setBranchIntegrationConfiguration in interface BuildDefinition

getCustomConfiguration

@Contract(value=" -> !null")
public Map<String,String> getCustomConfiguration()
Description copied from interface: BuildDefinition
/**

Specified by:
getCustomConfiguration in interface BuildDefinition
Specified by:
getCustomConfiguration in interface PartialBuildDefinition
Returns:
a map consisting of String key and String value pairs. This is where fields which start with "custom" (eg. custom.test.id) go to

setCustomConfiguration

public void setCustomConfiguration(@NotNull
                                   Map<String,String> customConfiguration)
Description copied from interface: BuildDefinition
A map of String key and String value pairs, representing custom

Specified by:
setCustomConfiguration in interface BuildDefinition
Parameters:
customConfiguration - - can be null

getConfigObjects

@Contract(value=" -> !null")
public Map<String,Object> getConfigObjects()
Description copied from interface: BuildDefinition
Returns a map of objects generated by the plugins. Each plugin is responsible for populating this list, so there's no final guarantee that a key is unique.

Specified by:
getConfigObjects in interface BuildDefinition
Specified by:
getConfigObjects in interface PartialBuildDefinition
Returns:
A Map with a String as a key and an arbitrary objects as the value.

setConfigObjects

public void setConfigObjects(@NotNull
                             Map<String,Object> configObjects)
Specified by:
setConfigObjects in interface BuildDefinition

getTaskDefinitions

@Contract(value=" -> !null")
public List<TaskDefinition> getTaskDefinitions()
Description copied from interface: BuildDefinition
All tasks defined for this build. Contains both regular tasks and finalising tasks.

Specified by:
getTaskDefinitions in interface BuildDefinition
Specified by:
getTaskDefinitions in interface PartialBuildDefinition
Returns:
A List of TaskDefinitions

setTaskDefinitions

public void setTaskDefinitions(@NotNull
                               List<TaskDefinition> taskConfigs)
Specified by:
setTaskDefinitions in interface BuildDefinition

isCleanWorkingDirectory

@Contract(value=" -> !null")
public Boolean isCleanWorkingDirectory()
Description copied from interface: BuildDefinition
Should the working directory be cleaned after build.

Specified by:
isCleanWorkingDirectory in interface BuildDefinition
Specified by:
isCleanWorkingDirectory in interface PartialBuildDefinition
Returns:
cleanWorkingDirectory

setCleanWorkingDirectory

public void setCleanWorkingDirectory(boolean cleanWorkingDirectory)
Description copied from interface: BuildDefinition
Set the working directory be cleaned or not cleaned after build

Specified by:
setCleanWorkingDirectory in interface BuildDefinition

getRepositoryIdDefiningWorkingDir

@Contract(value=" -> !null")
public Long getRepositoryIdDefiningWorkingDir()
Specified by:
getRepositoryIdDefiningWorkingDir in interface BuildDefinition
Specified by:
getRepositoryIdDefiningWorkingDir in interface PartialBuildDefinition

setRepositoryIdDefiningWorkingDir

public void setRepositoryIdDefiningWorkingDir(long repositoryDefiningWorkingDir)
Specified by:
setRepositoryIdDefiningWorkingDir in interface BuildDefinition

getBranchSpecificConfiguration

@Contract(value=" -> !null")
public BranchSpecificConfiguration getBranchSpecificConfiguration()
Description copied from interface: BuildDefinition
Returns any configuration that is specific to a branch plan, and not so relevant for a normal plan.

Specified by:
getBranchSpecificConfiguration in interface BuildDefinition
Specified by:
getBranchSpecificConfiguration in interface PartialBuildDefinition
Returns:

setBranchSpecificConfiguration

public void setBranchSpecificConfiguration(BranchSpecificConfiguration branchSpecificConfiguration)
Specified by:
setBranchSpecificConfiguration in interface BuildDefinition

isMerged

public boolean isMerged()
Specified by:
isMerged in interface PartialBuildDefinition
Returns:
true if the configuration has been merged from multiple sources. Such configurations cannot be saved.

setMerged

public void setMerged(boolean value)
Description copied from interface: BuildDefinition
Set whether or not this BuildDefinition has been merged from multiple sources. Merged definitions will not be persisted.

Specified by:
setMerged in interface BuildDefinition
Parameters:
value - true if merged

isValidValue

public boolean isValidValue(@Nullable
                            Object validValue)
Description copied from interface: BuildDefinition
Whether or not a given object is a valid value for this BuildDefinition. For example, PartialBuildDefintions accept nulls.

Specified by:
isValidValue in interface BuildDefinition
Returns:


Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.