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, java.io.Serializable

public class BuildContextImpl
extends BuildIdentifierImpl
implements BuildContext

See Also:
Serialized Form

Nested Class Summary
static class BuildContextImpl.BuildContextImplBuilder
           
 
Constructor Summary
BuildContextImpl(BuildIdentifier identifier, TriggerReason triggerReason, BuildDefinition buildDefinition, BuildChanges buildChanges, BuildContext parentBuildContext, ArtifactContext artifactContext, VariableContext variableContext, java.util.Map<java.lang.String,java.lang.String> customBuildData, java.util.Map<java.lang.Long,RepositoryDefinition> repositoryDefinitionMap, java.util.Set<java.lang.Long> relevantRepositoryIds, java.util.Map<java.lang.Long,java.lang.String> checkoutLocation, boolean isBranch, boolean isOnceOff, boolean isCustomBuild, BambooBandanaContext bandanaContext)
           
BuildContextImpl(ImmutablePlan buildPlan, int buildNumber, TriggerReason triggerReason, BuildDefinition buildDefinition, BuildChanges buildChanges)
           
BuildContextImpl(ImmutablePlan plan, int buildNumber, TriggerReason triggerReason, BuildDefinition buildDefinition, BuildChanges buildChanges, BuildContext parentBuildContext, ArtifactContext artifactContext, VariableContext variableContext, java.util.Map<java.lang.String,java.lang.String> customBuildData)
           
BuildContextImpl(ImmutablePlan plan, int buildNumber, TriggerReason triggerReason, BuildDefinition buildDefinition, BuildChanges buildChanges, BuildContext parentBuildContext, ArtifactContext artifactContext, VariableContext variableContext, java.util.Map<java.lang.String,java.lang.String> customBuildData, java.util.Map<java.lang.Long,RepositoryDefinition> repositoryDefinitionMap)
           
BuildContextImpl(ImmutablePlan plan, int buildNumber, TriggerReason triggerReason, BuildDefinition buildDefinition, BuildChanges buildChanges, BuildContext parentBuildContext, ArtifactContext artifactContext, VariableContext variableContext, java.util.Map<java.lang.String,java.lang.String> customBuildData, java.util.Map<java.lang.Long,RepositoryDefinition> repositoryDefinitionMap, boolean isOnceOff, boolean isCustomBuild)
           
BuildContextImpl(ImmutablePlan buildPlan, int buildNumber, TriggerReason triggerReason, BuildDefinition buildDefinition, BuildChanges buildChanges, ImmutablePlanCacheService immutablePlanCacheService)
          Deprecated. since 4.2 use BuildContextImpl(ImmutablePlan, int, TriggerReason, BuildDefinition, BuildChanges)
BuildContextImpl(ImmutablePlan buildPlan, int buildNumber, TriggerReason triggerReason, BuildDefinition buildDefinition, BuildChanges buildChanges, VariableContext variableContext)
           
BuildContextImpl(ImmutablePlan buildPlan, int buildNumber, TriggerReason triggerReason, BuildDefinition buildDefinition, BuildChanges buildChanges, VariableContext variableContext, boolean isOnceOff, boolean isCustomBuild)
           
BuildContextImpl(ImmutablePlan buildPlan, int buildNumber, TriggerReason triggerReason, BuildDefinition buildDefinition, BuildChanges buildChanges, VariableContext variableContext, ImmutablePlanCacheService immutablePlanCacheService)
          Deprecated. since 4.2 use BuildContextImpl(ImmutablePlan, int, TriggerReason, BuildDefinition, BuildChanges, VariableContext)
 
Method Summary
static BuildContextImpl.BuildContextImplBuilder builder()
           
 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
 java.util.Map<java.lang.Long,java.lang.String> getCheckoutLocation()
          Map holds final checkout where repository was checked out by VcsCheckoutTask Elements are kept in order of checkout
 CurrentResult getCurrentResult()
           
 java.lang.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()
           
 java.util.Set<java.lang.Long> getRelevantRepositoryIds()
           
 java.util.Map<java.lang.Long,RepositoryDefinition> getRepositoryDefinitionMap()
           
 java.util.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, BuildContext)
 java.util.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(java.util.Set<RepositoryDefinition> relevantRepositories)
           
 
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(ImmutablePlan plan,
                        int buildNumber,
                        TriggerReason triggerReason,
                        BuildDefinition buildDefinition,
                        @Nullable
                        BuildChanges buildChanges,
                        @Nullable
                        BuildContext parentBuildContext,
                        @Nullable
                        ArtifactContext artifactContext,
                        VariableContext variableContext,
                        @NotNull
                        java.util.Map<java.lang.String,java.lang.String> customBuildData)

BuildContextImpl

public BuildContextImpl(ImmutablePlan plan,
                        int buildNumber,
                        TriggerReason triggerReason,
                        BuildDefinition buildDefinition,
                        @Nullable
                        BuildChanges buildChanges,
                        @Nullable
                        BuildContext parentBuildContext,
                        @Nullable
                        ArtifactContext artifactContext,
                        VariableContext variableContext,
                        @NotNull
                        java.util.Map<java.lang.String,java.lang.String> customBuildData,
                        java.util.Map<java.lang.Long,RepositoryDefinition> repositoryDefinitionMap,
                        boolean isOnceOff,
                        boolean isCustomBuild)

BuildContextImpl

public BuildContextImpl(ImmutablePlan plan,
                        int buildNumber,
                        TriggerReason triggerReason,
                        BuildDefinition buildDefinition,
                        @Nullable
                        BuildChanges buildChanges,
                        @Nullable
                        BuildContext parentBuildContext,
                        @Nullable
                        ArtifactContext artifactContext,
                        VariableContext variableContext,
                        @NotNull
                        java.util.Map<java.lang.String,java.lang.String> customBuildData,
                        java.util.Map<java.lang.Long,RepositoryDefinition> repositoryDefinitionMap)

BuildContextImpl

@Deprecated
public BuildContextImpl(ImmutablePlan buildPlan,
                                   int buildNumber,
                                   TriggerReason triggerReason,
                                   BuildDefinition buildDefinition,
                                   @Nullable
                                   BuildChanges buildChanges,
                                   ImmutablePlanCacheService immutablePlanCacheService)
Deprecated. since 4.2 use BuildContextImpl(ImmutablePlan, int, TriggerReason, BuildDefinition, BuildChanges)


BuildContextImpl

public BuildContextImpl(ImmutablePlan buildPlan,
                        int buildNumber,
                        TriggerReason triggerReason,
                        BuildDefinition buildDefinition,
                        @Nullable
                        BuildChanges buildChanges)

BuildContextImpl

@Deprecated
public BuildContextImpl(ImmutablePlan buildPlan,
                                   int buildNumber,
                                   TriggerReason triggerReason,
                                   BuildDefinition buildDefinition,
                                   @Nullable
                                   BuildChanges buildChanges,
                                   @NotNull
                                   VariableContext variableContext,
                                   ImmutablePlanCacheService immutablePlanCacheService)
Deprecated. since 4.2 use BuildContextImpl(ImmutablePlan, int, TriggerReason, BuildDefinition, BuildChanges, VariableContext)


BuildContextImpl

public BuildContextImpl(ImmutablePlan buildPlan,
                        int buildNumber,
                        TriggerReason triggerReason,
                        BuildDefinition buildDefinition,
                        @Nullable
                        BuildChanges buildChanges,
                        @NotNull
                        VariableContext variableContext)

BuildContextImpl

public BuildContextImpl(ImmutablePlan buildPlan,
                        int buildNumber,
                        TriggerReason triggerReason,
                        BuildDefinition buildDefinition,
                        @Nullable
                        BuildChanges buildChanges,
                        @NotNull
                        VariableContext variableContext,
                        boolean isOnceOff,
                        boolean isCustomBuild)

BuildContextImpl

public BuildContextImpl(BuildIdentifier identifier,
                        TriggerReason triggerReason,
                        BuildDefinition buildDefinition,
                        @Nullable
                        BuildChanges buildChanges,
                        BuildContext parentBuildContext,
                        @NotNull
                        ArtifactContext artifactContext,
                        VariableContext variableContext,
                        @Nullable
                        java.util.Map<java.lang.String,java.lang.String> customBuildData,
                        java.util.Map<java.lang.Long,RepositoryDefinition> repositoryDefinitionMap,
                        java.util.Set<java.lang.Long> relevantRepositoryIds,
                        java.util.Map<java.lang.Long,java.lang.String> checkoutLocation,
                        boolean isBranch,
                        boolean isOnceOff,
                        boolean isCustomBuild,
                        BambooBandanaContext bandanaContext)
Method Detail

builder

public static BuildContextImpl.BuildContextImplBuilder builder()

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 java.util.Map<java.lang.Long,RepositoryDefinition> getRepositoryDefinitionMap()
Specified by:
getRepositoryDefinitionMap in interface CommonContext

getRepositoryDefinitions

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

getCheckoutLocation

@NotNull
public java.util.Map<java.lang.Long,java.lang.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, BuildContext)

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
                                    java.util.Set<RepositoryDefinition> relevantRepositories)

getRelevantRepositoryIds

@NotNull
public java.util.Set<java.lang.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 java.lang.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 java.util.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

getEntityId

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


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.