Package com.atlassian.bamboo.chains
Class ChainStageResultImpl
- java.lang.Object
-
- com.atlassian.core.bean.EntityObject
-
- com.atlassian.bamboo.core.BambooEntityObject
-
- com.atlassian.bamboo.chains.ChainStageResultImpl
-
- All Implemented Interfaces:
ChainStageResult
,BambooIdProvider
,BambooObject
,Describable
,DescriptionProvider
,NameProvider
,Cloneable
@Entity public class ChainStageResultImpl extends BambooEntityObject implements ChainStageResult
-
-
Constructor Summary
Constructors Constructor Description ChainStageResultImpl()
ChainStageResultImpl(String name, String description, boolean manual, boolean finalStage, ChainResultsSummary chainResult)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addBuildResult(@NotNull BuildResultsSummary buildResult)
Adds aBuildResultsSummary
and sets the relationship to theChainResultsSummary
void
addManualVariable(@NotNull StageVariableContext stageVariableContext)
@NotNull Set<BuildResultsSummary>
getBuildResults()
Returns all theBuildResultsSummary
with this Stage result@NotNull ChainResultsSummary
getChainResult()
Returns theChainResultsSummary
associated with this Stage result@Nullable String
getDescription()
@NotNull Collection<BuildResultsSummary>
getFailedBuildResults()
Returns all the failedBuildResultsSummary
with this Stage resultLifeCycleState
getLifeCycleState()
@NotNull List<StageVariableContext>
getManualVariables()
Get manual variables that were set before this stage started.List<StageVariableContext>
getManualVariablesEncrypted()
Since 7.0.@NotNull String
getName()
long
getProcessingDuration()
Processing duration of stage (time of longest job in stage execution)@NotNull List<BuildResultsSummary>
getSortedBuildResults()
Returns all theBuildResultsSummary
with this Stage result ordered by build name.BuildState
getState()
@NotNull Collection<BuildResultsSummary>
getSuccessfulBuildResults()
Returns all the successfulBuildResultsSummary
with this Stage resultboolean
isAllJobsExist()
boolean
isAllNotSuccessfulJobsExist()
boolean
isCompleted()
boolean
isFailed()
boolean
isFinal()
boolean
isFinished()
boolean
isManual()
Checks if result as manual (at the time of result creation) Manual means stage execution is hold and waits for user interactionboolean
isNotBuilt()
Checks if the stage has unbuilt jobs inside itboolean
isPending()
boolean
isRestartable()
Checks if plan nas been failed and could be restarted on the stage where failedboolean
isRunnable()
Checks if current stage if first manual stage waiting for execution (chain is completed on previous stage and waiting for this stage to execute)boolean
isSuccessful()
boolean
removeBuildResult(@NotNull BuildResultsSummary buildResult)
Removes aBuildResultsSummary
void
setBuildResults(@NotNull Set<BuildResultsSummary> buildResults)
void
setChainResult(@NotNull ChainResultsSummary chainResult)
Sets theChainResultsSummary
associated with this Stage resultvoid
setDescription(@Nullable String description)
void
setFinal(boolean finalStage)
void
setManual(boolean manual)
Marks result as optional (at the time of result creation) Manual means stage execution is hold and waits for user interactionvoid
setName(@NotNull String name)
void
setProcessingDuration(long processingDuration)
-
Methods inherited from class com.atlassian.core.bean.EntityObject
clone, equals, getCreationDate, getCurrentDate, getId, getLastModificationDate, hashCode, setClock, setCreationDate, setId, setLastModificationDate
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.bamboo.core.BambooIdProvider
getId
-
Methods inherited from interface com.atlassian.bamboo.core.BambooObject
setId
-
-
-
-
Constructor Detail
-
ChainStageResultImpl
public ChainStageResultImpl(String name, String description, boolean manual, boolean finalStage, ChainResultsSummary chainResult)
-
ChainStageResultImpl
public ChainStageResultImpl()
-
-
Method Detail
-
getName
@NotNull public @NotNull String getName()
- Specified by:
getName
in interfaceDescriptionProvider
- Specified by:
getName
in interfaceNameProvider
-
setName
public void setName(@NotNull @NotNull String name)
- Specified by:
setName
in interfaceDescribable
-
getDescription
@Nullable public @Nullable String getDescription()
- Specified by:
getDescription
in interfaceDescriptionProvider
-
setDescription
public void setDescription(@Nullable @Nullable String description)
- Specified by:
setDescription
in interfaceDescribable
-
isManual
public boolean isManual()
Description copied from interface:ChainStageResult
Checks if result as manual (at the time of result creation) Manual means stage execution is hold and waits for user interaction- Specified by:
isManual
in interfaceChainStageResult
- Returns:
- true if manual
-
setManual
public void setManual(boolean manual)
Description copied from interface:ChainStageResult
Marks result as optional (at the time of result creation) Manual means stage execution is hold and waits for user interaction- Specified by:
setManual
in interfaceChainStageResult
-
isFinal
public boolean isFinal()
- Specified by:
isFinal
in interfaceChainStageResult
-
setFinal
public void setFinal(boolean finalStage)
- Specified by:
setFinal
in interfaceChainStageResult
-
getProcessingDuration
public long getProcessingDuration()
Description copied from interface:ChainStageResult
Processing duration of stage (time of longest job in stage execution)- Specified by:
getProcessingDuration
in interfaceChainStageResult
- Returns:
-
setProcessingDuration
public void setProcessingDuration(long processingDuration)
- Specified by:
setProcessingDuration
in interfaceChainStageResult
-
getChainResult
@NotNull public @NotNull ChainResultsSummary getChainResult()
Description copied from interface:ChainStageResult
Returns theChainResultsSummary
associated with this Stage result- Specified by:
getChainResult
in interfaceChainStageResult
- Returns:
- chainResult
-
setChainResult
public void setChainResult(@NotNull @NotNull ChainResultsSummary chainResult)
Description copied from interface:ChainStageResult
Sets theChainResultsSummary
associated with this Stage result- Specified by:
setChainResult
in interfaceChainStageResult
-
getBuildResults
@NotNull public @NotNull Set<BuildResultsSummary> getBuildResults()
Description copied from interface:ChainStageResult
Returns all theBuildResultsSummary
with this Stage result- Specified by:
getBuildResults
in interfaceChainStageResult
- Returns:
- results
-
getSortedBuildResults
@NotNull public @NotNull List<BuildResultsSummary> getSortedBuildResults()
Description copied from interface:ChainStageResult
Returns all theBuildResultsSummary
with this Stage result ordered by build name. WARNING: Dont use in performance critical situations.- Specified by:
getSortedBuildResults
in interfaceChainStageResult
- Returns:
- results
-
getFailedBuildResults
@NotNull public @NotNull Collection<BuildResultsSummary> getFailedBuildResults()
Description copied from interface:ChainStageResult
Returns all the failedBuildResultsSummary
with this Stage result- Specified by:
getFailedBuildResults
in interfaceChainStageResult
- Returns:
- results
-
getSuccessfulBuildResults
@NotNull public @NotNull Collection<BuildResultsSummary> getSuccessfulBuildResults()
Description copied from interface:ChainStageResult
Returns all the successfulBuildResultsSummary
with this Stage result- Specified by:
getSuccessfulBuildResults
in interfaceChainStageResult
- Returns:
- results
-
setBuildResults
public void setBuildResults(@NotNull @NotNull Set<BuildResultsSummary> buildResults)
-
addBuildResult
public boolean addBuildResult(@NotNull @NotNull BuildResultsSummary buildResult)
Description copied from interface:ChainStageResult
Adds aBuildResultsSummary
and sets the relationship to theChainResultsSummary
- Specified by:
addBuildResult
in interfaceChainStageResult
- Returns:
- success
-
removeBuildResult
public boolean removeBuildResult(@NotNull @NotNull BuildResultsSummary buildResult)
Description copied from interface:ChainStageResult
Removes aBuildResultsSummary
- Specified by:
removeBuildResult
in interfaceChainStageResult
- Returns:
- success
-
isPending
public boolean isPending()
- Specified by:
isPending
in interfaceChainStageResult
-
isNotBuilt
public boolean isNotBuilt()
Description copied from interface:ChainStageResult
Checks if the stage has unbuilt jobs inside it- Specified by:
isNotBuilt
in interfaceChainStageResult
- Returns:
-
isCompleted
public boolean isCompleted()
- Specified by:
isCompleted
in interfaceChainStageResult
-
isFinished
public boolean isFinished()
- Specified by:
isFinished
in interfaceChainStageResult
-
isAllJobsExist
public boolean isAllJobsExist()
- Specified by:
isAllJobsExist
in interfaceChainStageResult
- Returns:
- true iff all the jobs in this stage result still exist
-
isAllNotSuccessfulJobsExist
public boolean isAllNotSuccessfulJobsExist()
- Specified by:
isAllNotSuccessfulJobsExist
in interfaceChainStageResult
- Returns:
- true iff all the jobs in this stage result that are not finished successfully still exist
-
isSuccessful
public boolean isSuccessful()
- Specified by:
isSuccessful
in interfaceChainStageResult
-
isFailed
public boolean isFailed()
- Specified by:
isFailed
in interfaceChainStageResult
-
isRunnable
public boolean isRunnable()
Description copied from interface:ChainStageResult
Checks if current stage if first manual stage waiting for execution (chain is completed on previous stage and waiting for this stage to execute)- Specified by:
isRunnable
in interfaceChainStageResult
- Returns:
- true if stage is ready and allowed for manual execution
-
isRestartable
public boolean isRestartable()
Description copied from interface:ChainStageResult
Checks if plan nas been failed and could be restarted on the stage where failed- Specified by:
isRestartable
in interfaceChainStageResult
-
getState
public BuildState getState()
- Specified by:
getState
in interfaceChainStageResult
-
getLifeCycleState
public LifeCycleState getLifeCycleState()
- Specified by:
getLifeCycleState
in interfaceChainStageResult
-
getManualVariablesEncrypted
public List<StageVariableContext> getManualVariablesEncrypted()
Description copied from interface:ChainStageResult
Since 7.0. For internal use only. UseChainStageResult.getManualVariables()
orChainStageResult.addManualVariable(StageVariableContext)
instead.- Specified by:
getManualVariablesEncrypted
in interfaceChainStageResult
-
getManualVariables
@NotNull public @NotNull List<StageVariableContext> getManualVariables()
Description copied from interface:ChainStageResult
Get manual variables that were set before this stage started. This contains only the variables that changed compared to the previous stage.- Specified by:
getManualVariables
in interfaceChainStageResult
-
addManualVariable
public void addManualVariable(@NotNull @NotNull StageVariableContext stageVariableContext)
- Specified by:
addManualVariable
in interfaceChainStageResult
-
-