com.atlassian.bamboo.plugins.vcs.task
Class DeploymentRepositoryBuildContext

java.lang.Object
  extended by com.atlassian.bamboo.plugins.vcs.task.DeploymentRepositoryBuildContext
All Implemented Interfaces:
BuildContext, BuildIdentifier, CommonContext, Serializable

public class DeploymentRepositoryBuildContext
extends Object
implements BuildContext

See Also:
Serialized Form

Constructor Summary
DeploymentRepositoryBuildContext(CommonContext commonContext)
           
 
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()
           
 int getBuildNumber()
          The build number being built
 CurrentBuildResult getBuildResult()
          The information about the results of a build
 String getBuildResultKey()
          Full build result key (e.g.
 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()
           
 long getPlanId()
           
 String getPlanKey()
          Full plan key (e.g.
 String getPlanName()
          The full name of the Plan
 PlanResultKey getPlanResultKey()
          Gets the PlanResultKey for the current BuildIdentifier
 String getProjectName()
           
 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()
           
 String getShortName()
          The short name of the Plan
 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 setVariableContext(VariableContext variableContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeploymentRepositoryBuildContext

public DeploymentRepositoryBuildContext(CommonContext commonContext)
Method Detail

getParentBuildContext

@Nullable
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

getBuildDefinition

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

getArtifactContext

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

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

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

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

getEntityId

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

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:

getCurrentResult

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

getErrorCollection

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

Specified by:
getErrorCollection in interface CommonContext

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

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:

getVariableContext

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

getTriggerReason

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

Specified by:
getTriggerReason in interface CommonContext
Returns:
triggerReason

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

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

getSharedCredentials

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

getParentBuildIdentifier

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

getPlanId

public long getPlanId()
Specified by:
getPlanId in interface BuildIdentifier
Returns:
Id of the plan.

getPlanKey

@NotNull
public String getPlanKey()
Description copied from interface: BuildIdentifier
Full plan key (e.g. BAM-MAIN)

Specified by:
getPlanKey in interface BuildIdentifier
Returns:
Key for the plan BAM-MAIN @NotNull

getPlanName

@NotNull
public String getPlanName()
Description copied from interface: BuildIdentifier
The full name of the Plan

Specified by:
getPlanName in interface BuildIdentifier
Returns:
DescriptionProvider.getName()

getShortName

@NotNull
public String getShortName()
Description copied from interface: BuildIdentifier
The short name of the Plan

Specified by:
getShortName in interface BuildIdentifier
Returns:
PlanIdentifier.getBuildName()

getBuildNumber

public int getBuildNumber()
Description copied from interface: BuildIdentifier
The build number being built

Specified by:
getBuildNumber in interface BuildIdentifier
Returns:
int

getBuildResultKey

@NotNull
public String getBuildResultKey()
Description copied from interface: BuildIdentifier
Full build result key (e.g. BAM-MAIN-100)

Specified by:
getBuildResultKey in interface BuildIdentifier
Returns:
Key for build result @NotNull

getPlanResultKey

@NotNull
public PlanResultKey getPlanResultKey()
Description copied from interface: BuildIdentifier
Gets the PlanResultKey for the current BuildIdentifier

Specified by:
getPlanResultKey in interface BuildIdentifier
Returns:
planResultKey

getProjectName

@NotNull
public String getProjectName()
Specified by:
getProjectName in interface BuildIdentifier

setVariableContext

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


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