com.atlassian.bamboo.v2.build
Class BuildContextImpl

java.lang.Object
  extended by com.atlassian.bamboo.v2.build.BuildIdentifierImpl
      extended by com.atlassian.bamboo.v2.build.BuildContextImpl
All Implemented Interfaces:
BuildContext, BuildIdentifier, CommonContext, Serializable

public class BuildContextImpl
extends BuildIdentifierImpl
implements BuildContext

See Also:
Serialized Form

Constructor Summary
BuildContextImpl(BuildIdentifier identifier, TriggerReason triggerReason, BuildDefinition buildDefinition, BuildChanges buildChanges, BuildContext parentBuildContext, ArtifactContext artifactContext, VariableContext variableContext, Map<String,String> customBuildData, Map<Long,RepositoryDefinition> repositoryDefinitionMap, Set<Long> relevantRepositoryIds, Map<Long,String> checkoutLocation, boolean isBranch, boolean isOnceOff, boolean isCustomBuild, BambooBandanaContext bandanaContext, Iterable<CredentialsData> relevantSharedCredentials)
          Using this constructor directly is not recommended.
 
Method Summary
 ArtifactContext getArtifactContext()
           
 BambooBandanaContext getBandanaContext()
          BandanaContext of the plan.
 BuildChanges getBuildChanges()
          Returns the build changes, if any, that represents the changes that triggered this build.
 BuildDefinition getBuildDefinition()
           
 CurrentBuildResult getBuildResult()
          The information about the results of a build
 Map<Long,String> getCheckoutLocation()
          Map holds final checkout where repository was checked out by VcsCheckoutTask Elements are kept in order of checkout
 CurrentResult getCurrentResult()
           
 String getDisplayName()
          A human friendly description of what is being built.
 long getEntityId()
           
 Key getEntityKey()
           
 ErrorCollection getErrorCollection()
          Any errors associated with the build
 BuildContext getParentBuildContext()
           
 BuildIdentifier getParentBuildIdentifier()
           
 Set<Long> getRelevantRepositoryIds()
           
 Map<Long,RepositoryDefinition> getRepositoryDefinitionMap()
           
 List<RepositoryDefinition> getRepositoryDefinitions()
           
 ResultKey getResultKey()
           
 RuntimeTaskContext getRuntimeTaskContext()
          Runtime context for the tasks executed for given build context This context is set by pluggable RuntimeTaskDataProvider.populateRuntimeTaskData(TaskDefinition, CommonContext)
 List<RuntimeTaskDefinition> getRuntimeTaskDefinitions()
          All tasks defined for this build.
 Iterable<CredentialsData> getSharedCredentials()
           
 List<TaskDefinition> getTaskDefinitions()
          All tasks defined for this build.
 TriggerReason getTriggerReason()
          The reason this build was triggered
 VariableContext getVariableContext()
           
 boolean isBranch()
          Provides information if context refers to the branch of the Chain
 boolean isCustomBuild()
          Provides information if context refers to the build that had some variables overwritten
 boolean isOnceOff()
          Provides information if context refers to the "once-off" build - a build that have been run with customized revision
 void setBuildChanges(BuildChanges buildChanges)
           
 void setRelevantRepositories(Set<RepositoryDefinition> relevantRepositories)
           
 void setVariableContext(VariableContext variableContext)
           
 
Methods inherited from class com.atlassian.bamboo.v2.build.BuildIdentifierImpl
equals, getBuildNumber, getBuildResultKey, getPlanId, getPlanKey, getPlanName, getPlanResultKey, getProjectName, getShortName, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.bamboo.v2.build.BuildIdentifier
getBuildNumber, getBuildResultKey, getPlanId, getPlanKey, getPlanName, getPlanResultKey, getProjectName, getShortName
 

Constructor Detail

BuildContextImpl

public BuildContextImpl(BuildIdentifier identifier,
                        TriggerReason triggerReason,
                        BuildDefinition buildDefinition,
                        @Nullable
                        BuildChanges buildChanges,
                        BuildContext parentBuildContext,
                        @Nullable
                        ArtifactContext artifactContext,
                        VariableContext variableContext,
                        @Nullable
                        Map<String,String> customBuildData,
                        Map<Long,RepositoryDefinition> repositoryDefinitionMap,
                        Set<Long> relevantRepositoryIds,
                        Map<Long,String> checkoutLocation,
                        boolean isBranch,
                        boolean isOnceOff,
                        boolean isCustomBuild,
                        BambooBandanaContext bandanaContext,
                        @NotNull
                        Iterable<CredentialsData> relevantSharedCredentials)
Using this constructor directly is not recommended. Use BuildContextBuilder instead.

Method Detail

getParentBuildIdentifier

public BuildIdentifier getParentBuildIdentifier()
Specified by:
getParentBuildIdentifier in interface BuildIdentifier
Overrides:
getParentBuildIdentifier in class BuildIdentifierImpl
Returns:
the BuildContext of the parent Plan execution. Should return null if the current BuildContext is for a TopLevelPlan

getParentBuildContext

public BuildContext getParentBuildContext()
Specified by:
getParentBuildContext in interface BuildContext
Returns:
the BuildContext of the parent Plan execution. Should return null if the current BuildContext is for a TopLevelPlan

getTriggerReason

@NotNull
public TriggerReason getTriggerReason()
Description copied from interface: CommonContext
The reason this build was triggered

Specified by:
getTriggerReason in interface CommonContext
Returns:
triggerReason

getBuildDefinition

@NotNull
public BuildDefinition getBuildDefinition()
Specified by:
getBuildDefinition in interface BuildContext
Returns:
BuildDefinition associated with Plan this context relates to

getBuildChanges

@NotNull
public BuildChanges getBuildChanges()
Description copied from interface: BuildContext
Returns the build changes, if any, that represents the changes that triggered this build.

Specified by:
getBuildChanges in interface BuildContext
Returns:
Never null. WIll return a build changes object with the appropriate list of changes, the list will be null if no changes were found.

setBuildChanges

public void setBuildChanges(BuildChanges buildChanges)
Specified by:
setBuildChanges in interface BuildContext

getBuildResult

@NotNull
public CurrentBuildResult getBuildResult()
Description copied from interface: BuildContext
The information about the results of a build

Specified by:
getBuildResult in interface BuildContext
Returns:
CurrentBuildResult

getCurrentResult

@NotNull
public CurrentResult getCurrentResult()
Specified by:
getCurrentResult in interface CommonContext

getArtifactContext

@NotNull
public ArtifactContext getArtifactContext()
Specified by:
getArtifactContext in interface BuildContext
Returns:
Artifact data associated with Plan

getVariableContext

@NotNull
public VariableContext getVariableContext()
Specified by:
getVariableContext in interface CommonContext

getRepositoryDefinitionMap

@NotNull
public Map<Long,RepositoryDefinition> getRepositoryDefinitionMap()
Specified by:
getRepositoryDefinitionMap in interface CommonContext

getRepositoryDefinitions

@NotNull
public List<RepositoryDefinition> getRepositoryDefinitions()
Specified by:
getRepositoryDefinitions in interface CommonContext

getCheckoutLocation

@NotNull
public Map<Long,String> getCheckoutLocation()
Description copied from interface: BuildContext
Map holds final checkout where repository was checked out by VcsCheckoutTask Elements are kept in order of checkout

Specified by:
getCheckoutLocation in interface BuildContext
Returns:
map of repositoryId as Long and checkout location as String

isBranch

public boolean isBranch()
Description copied from interface: BuildContext
Provides information if context refers to the branch of the Chain

Specified by:
isBranch in interface BuildContext
Returns:
true if context refers to the chain branch

isOnceOff

public boolean isOnceOff()
Description copied from interface: BuildContext
Provides information if context refers to the "once-off" build - a build that have been run with customized revision

Specified by:
isOnceOff in interface BuildContext
Returns:
true if context refers to the chain branch

isCustomBuild

public boolean isCustomBuild()
Description copied from interface: BuildContext
Provides information if context refers to the build that had some variables overwritten

Specified by:
isCustomBuild in interface BuildContext
Returns:
true if context refers to the build with overwritten variables

getRuntimeTaskContext

@NotNull
public RuntimeTaskContext getRuntimeTaskContext()
Description copied from interface: BuildContext
Runtime context for the tasks executed for given build context This context is set by pluggable RuntimeTaskDataProvider.populateRuntimeTaskData(TaskDefinition, CommonContext)

Specified by:
getRuntimeTaskContext in interface BuildContext
Specified by:
getRuntimeTaskContext in interface CommonContext
Returns:

getBandanaContext

@NotNull
public BambooBandanaContext getBandanaContext()
Description copied from interface: BuildContext
BandanaContext of the plan.

Specified by:
getBandanaContext in interface BuildContext
Returns:
BandanaContext of the plan

getErrorCollection

@NotNull
public ErrorCollection getErrorCollection()
Description copied from interface: CommonContext
Any errors associated with the build

Specified by:
getErrorCollection in interface CommonContext

setRelevantRepositories

public void setRelevantRepositories(@NotNull
                                    Set<RepositoryDefinition> relevantRepositories)

getRelevantRepositoryIds

@NotNull
public Set<Long> getRelevantRepositoryIds()
Specified by:
getRelevantRepositoryIds in interface BuildContext
Returns:
a set of repository id's that are relevant to this particular job, i.e. these jobs do checkout of that repository

getEntityKey

public Key getEntityKey()
Specified by:
getEntityKey in interface CommonContext

getResultKey

public ResultKey getResultKey()
Specified by:
getResultKey in interface CommonContext

getDisplayName

public String getDisplayName()
Description copied from interface: CommonContext
A human friendly description of what is being built.

Specified by:
getDisplayName in interface CommonContext
Returns:

getTaskDefinitions

@NotNull
public List<TaskDefinition> getTaskDefinitions()
Description copied from interface: CommonContext
All tasks defined for this build. Contains both regular tasks and finalising tasks.

Specified by:
getTaskDefinitions in interface CommonContext
Returns:
A List of TaskDefinitions

getRuntimeTaskDefinitions

@NotNull
public List<RuntimeTaskDefinition> getRuntimeTaskDefinitions()
Description copied from interface: CommonContext
All tasks defined for this build. Contains both regular tasks and finalising tasks.

Specified by:
getRuntimeTaskDefinitions in interface CommonContext
Returns:
A List of RuntimeTaskDefinitions

getEntityId

public long getEntityId()
Specified by:
getEntityId in interface CommonContext

getSharedCredentials

@NotNull
public Iterable<CredentialsData> getSharedCredentials()
Specified by:
getSharedCredentials in interface CommonContext

setVariableContext

public void setVariableContext(VariableContext variableContext)
Specified by:
setVariableContext in interface BuildContext


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