com.atlassian.bamboo.plan.cache
Class ImmutableJobImpl

java.lang.Object
  extended by com.atlassian.bamboo.plan.cache.AbstractImmutablePlan
      extended by com.atlassian.bamboo.plan.cache.ImmutableJobImpl
All Implemented Interfaces:
Buildable, Job, BambooIdProvider, BambooObject, Deletable, Describable, ImmutableDeletable, ImmutableJob, ImmutablePlan, Plan, PlanIdentifier, DescriptionProvider, NameProvider

public class ImmutableJobImpl
extends AbstractImmutablePlan
implements Job


Field Summary
 
Fields inherited from class com.atlassian.bamboo.plan.cache.AbstractImmutablePlan
averageBuildDuration, resultsSummaryManager
 
Fields inherited from interface com.atlassian.bamboo.plan.cache.ImmutablePlan
MAX_NUMBER_LOG_ENTRIES, MAX_PREVIOUS_BUILD_FOR_AVE, STATUS_CURRENTLY_BUILDING, STATUS_FAIL, STATUS_NO_BUILDS, STATUS_NOT_RUN, STATUS_SUCCESS
 
Constructor Summary
ImmutableJobImpl(Chain parent, ChainStage stage, Job job, ArtifactDefinitionManager artifactDefinitionManager, ArtifactSubscriptionManager artifactSubscriptionManager, BuildLoggerManager buildLoggerManager, LabelManager labelManager, VariableDefinitionManager variableDefinitionManager, TaskManager taskManager, BuildExecutionManager buildExecutionManager, ResultsSummaryManager resultsSummaryManager, BuildDefinitionManager buildDefinitionManager)
           
 
Method Summary
 void addBuildResultSummary(BuildResultsSummary buildResultsSummary)
           
 java.util.List<ArtifactDefinition> getArtifactDefinitions()
           
 java.util.List<ArtifactSubscription> getArtifactSubscriptions()
           
 java.util.List<BuildResultsSummary> getBuildResultSummaries()
           
 java.lang.String getCurrentStatus()
          Retuns a string key as to what the status is.
 RequirementSet getEffectiveRequirementSet()
          Return effective value of RequirementSet, that is value that is considered when checking which agents and elastic images can build this Buildable.
 BuildResultsSummary getFirstBuildSummary()
           
 BuildResultsSummary getLatestBuildSummary()
           
 ResultsSummary getLatestResultsSummary()
          Get the latest finished result
 Job getMaster()
          Return the master plan if one exists.
 BuildResults getNextBuildResults(int buildNumber)
           
 int getNumberOfConcurrentlyRunningBuilds()
           
 Chain getParent()
          The Chain that this Job is a member of
 BuildResults getPreviousBuildResults(int buildNumber)
           
 RequirementSet getRequirementSet()
           
 ChainStage getStage()
          The ChainStage that this Job is a member of
 boolean hasBuildResults()
           
 boolean isActive()
          Is the plan queued or building?
 boolean isBusy()
          Is the Plan "busy".
 boolean isExecuting()
          Is the build currently being executed?
 void removeBuildResultSummary(int buildNumber)
           
 void setRequirementSet(RequirementSet requirementSet)
           
 void setStage(ChainStage stage)
           
 
Methods inherited from class com.atlassian.bamboo.plan.cache.AbstractImmutablePlan
compareTo, equals, exceptionOnModification, getAverageBuildDuration, getBuildDefinition, getBuildDefinitionXml, getBuildKey, getBuildLogger, getBuildName, getDescription, getEffectiveVariables, getFirstBuildNumber, getId, getKey, getLabellings, getLabelNames, getLastBuildNumber, getName, getNextBuildNumber, getPlanKey, getPlanType, getProject, getRelatedLabellings, getType, getVariables, hashCode, hasMaster, hasTests, isMarkedForDeletion, isSuspendedFromBuilding, setBuildDefinitionXml, setBuildKey, setBuildName, setDescription, setFirstBuildNumber, setId, setKey, setLabellings, setLastBuildNumber, setMarkedForDeletion, setMaster, setName, setNextBuildNumber, setPlanKey, setProject, setSuspendedFromBuilding, validateBuild
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.bamboo.plan.Plan
getLabellings, getRelatedLabellings, setBuildDefinitionXml, setBuildKey, setBuildName, setFirstBuildNumber, setKey, setLabellings, setLastBuildNumber, setMaster, setNextBuildNumber, setPlanKey, setProject, setSuspendedFromBuilding, validateBuild
 
Methods inherited from interface com.atlassian.bamboo.Describable
setDescription, setName
 
Methods inherited from interface com.atlassian.bamboo.deletion.Deletable
setMarkedForDeletion
 
Methods inherited from interface com.atlassian.bamboo.core.BambooObject
setId
 
Methods inherited from interface com.atlassian.bamboo.plan.cache.ImmutableDeletable
isMarkedForDeletion
 
Methods inherited from interface com.atlassian.bamboo.plan.cache.ImmutablePlan
getAverageBuildDuration, getBuildDefinition, getBuildDefinitionXml, getBuildLogger, getEffectiveVariables, getFirstBuildNumber, getKey, getLabelNames, getLastBuildNumber, getNextBuildNumber, getProject, getType, getVariables, hasMaster, hasTests, isMarkedForDeletion
 
Methods inherited from interface com.atlassian.bamboo.plan.PlanIdentifier
getBuildKey, getBuildName, getId, getName, getPlanKey, getPlanType, isSuspendedFromBuilding
 
Methods inherited from interface com.atlassian.bamboo.utils.DescriptionProvider
getDescription
 

Constructor Detail

ImmutableJobImpl

public ImmutableJobImpl(Chain parent,
                        ChainStage stage,
                        Job job,
                        ArtifactDefinitionManager artifactDefinitionManager,
                        ArtifactSubscriptionManager artifactSubscriptionManager,
                        BuildLoggerManager buildLoggerManager,
                        LabelManager labelManager,
                        VariableDefinitionManager variableDefinitionManager,
                        TaskManager taskManager,
                        BuildExecutionManager buildExecutionManager,
                        ResultsSummaryManager resultsSummaryManager,
                        BuildDefinitionManager buildDefinitionManager)
Method Detail

getParent

@NotNull
public Chain getParent()
Description copied from interface: Job
The Chain that this Job is a member of

Specified by:
getParent in interface Job
Specified by:
getParent in interface ImmutableJob
Returns:
chain

getStage

@NotNull
public ChainStage getStage()
Description copied from interface: Job
The ChainStage that this Job is a member of

Specified by:
getStage in interface Job
Specified by:
getStage in interface ImmutableJob
Returns:
stage

getRequirementSet

@NotNull
public RequirementSet getRequirementSet()
Specified by:
getRequirementSet in interface Buildable
Specified by:
getRequirementSet in interface ImmutableJob

getEffectiveRequirementSet

@NotNull
public RequirementSet getEffectiveRequirementSet()
Description copied from interface: Buildable
Return effective value of RequirementSet, that is value that is considered when checking which agents and elastic images can build this Buildable.

Specified by:
getEffectiveRequirementSet in interface Buildable
Specified by:
getEffectiveRequirementSet in interface ImmutableJob
Returns:
the same as Buildable.getRequirementSet() if ImmutablePlan.hasMaster() is false, getMaster().getRequirementSet() otherwise.

getMaster

public Job getMaster()
Description copied from interface: ImmutablePlan
Return the master plan if one exists. The master is the plan which this one is derived from. Configuration is pulled from the master if one exists.

Specified by:
getMaster in interface Job
Specified by:
getMaster in interface ImmutableJob
Specified by:
getMaster in interface ImmutablePlan
Returns:
the master Plan if one exists.

isBusy

public boolean isBusy()
Description copied from interface: ImmutablePlan
Is the Plan "busy". Busy is defined by the plan having a lock held on it. This is done during change detection, dependency listner and the like

Specified by:
isBusy in interface ImmutablePlan
Returns:
busy

isActive

public boolean isActive()
Description copied from interface: ImmutablePlan
Is the plan queued or building?

Specified by:
isActive in interface ImmutablePlan
Returns:

getCurrentStatus

@NotNull
public java.lang.String getCurrentStatus()
Description copied from interface: ImmutablePlan
Retuns a string key as to what the status is. Can be "success", "failure", "current", "none" or "notRun". Mainly used for UI purposes.

Specified by:
getCurrentStatus in interface ImmutablePlan
Overrides:
getCurrentStatus in class AbstractImmutablePlan
Returns:

isExecuting

public boolean isExecuting()
Description copied from interface: ImmutablePlan
Is the build currently being executed?

Specified by:
isExecuting in interface ImmutablePlan
Returns:
true if build is being executed

getLatestResultsSummary

public ResultsSummary getLatestResultsSummary()
Description copied from interface: ImmutablePlan
Get the latest finished result

Specified by:
getLatestResultsSummary in interface ImmutablePlan
Returns:
The summary info for the last completed build. Returns null if there are no build results for this plan

getArtifactDefinitions

@NotNull
public java.util.List<ArtifactDefinition> getArtifactDefinitions()
Specified by:
getArtifactDefinitions in interface ImmutableJob
Returns:
list of produced artifacts

getArtifactSubscriptions

@NotNull
public java.util.List<ArtifactSubscription> getArtifactSubscriptions()
Specified by:
getArtifactSubscriptions in interface ImmutableJob
Returns:
list of artifact subscriptions

getBuildResultSummaries

public java.util.List<BuildResultsSummary> getBuildResultSummaries()
Specified by:
getBuildResultSummaries in interface Buildable

getLatestBuildSummary

public BuildResultsSummary getLatestBuildSummary()
Specified by:
getLatestBuildSummary in interface Buildable

getFirstBuildSummary

public BuildResultsSummary getFirstBuildSummary()
Specified by:
getFirstBuildSummary in interface Buildable

hasBuildResults

public boolean hasBuildResults()
Specified by:
hasBuildResults in interface Buildable

getPreviousBuildResults

public BuildResults getPreviousBuildResults(int buildNumber)
Specified by:
getPreviousBuildResults in interface Buildable

getNextBuildResults

public BuildResults getNextBuildResults(int buildNumber)
Specified by:
getNextBuildResults in interface Buildable

getNumberOfConcurrentlyRunningBuilds

public int getNumberOfConcurrentlyRunningBuilds()
Specified by:
getNumberOfConcurrentlyRunningBuilds in interface Buildable

addBuildResultSummary

public void addBuildResultSummary(BuildResultsSummary buildResultsSummary)
Specified by:
addBuildResultSummary in interface Buildable

removeBuildResultSummary

public void removeBuildResultSummary(int buildNumber)
Specified by:
removeBuildResultSummary in interface Buildable

setStage

public void setStage(@NotNull
                     ChainStage stage)
Specified by:
setStage in interface Job

setRequirementSet

public void setRequirementSet(RequirementSet requirementSet)
Specified by:
setRequirementSet in interface Buildable


Copyright © 2012 Atlassian. All Rights Reserved.