com.atlassian.bamboo.build
Class BuildStatusHelper

java.lang.Object
  extended by com.atlassian.bamboo.build.BuildStatusHelper

public class BuildStatusHelper
extends java.lang.Object


Constructor Summary
BuildStatusHelper(Plan plan, ResultsSummary currentBuildResult, ResultsSummaryManager resultsSummaryManager)
           
BuildStatusHelper(ResultsSummaryManager resultsSummaryManager, Buildable buildable, int buildNumber)
           
 
Method Summary
 Plan getBuild()
           
 int getCountFailingSince()
          Deprecated. since 2.7 use getPrecedingConsecutiveFailuresCount instead, note that it does not include the current result
 int getCountOfPrecedingResultsInState(int lowerBuildNumber, BuildState buildState)
          Returns count of preceding results in state buildState with range starting with build lowerBuildNumber (inclusive).
 int getCountSucceedingSince()
           
 ResultsSummary getFailingSinceBuild()
          If the currentBuildResult is set and failing then return first failed BuildResultSummary in series.
 ResultsSummary getFirstBuildInSequence()
          Poorly named method.
 ResultsSummary getFixedInBuild()
          If the currentBuildResult is set and not successful then return first successful BuildResultSummary after this one.
 ResultsSummary getFixesBuild()
          If the currentBuildResult is set and successful then return first failed BuildResultSummary in series that preceded currentBuildResult.
 int getPrecedingConsecutiveFailuresCount()
           
 ResultsSummary getPreviousSuccessfulBuild()
           
 ResultsSummary getSucceedingSinceBuild()
          If the currentBuildResult is set and successful then return first successful BuildResultSummary in series.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildStatusHelper

public BuildStatusHelper(@NotNull
                         Plan plan,
                         @NotNull
                         ResultsSummary currentBuildResult,
                         @NotNull
                         ResultsSummaryManager resultsSummaryManager)

BuildStatusHelper

public BuildStatusHelper(@NotNull
                         ResultsSummaryManager resultsSummaryManager,
                         @NotNull
                         Buildable buildable,
                         int buildNumber)
Method Detail

getFixedInBuild

@Nullable
public ResultsSummary getFixedInBuild()
If the currentBuildResult is set and not successful then return first successful BuildResultSummary after this one. Returns null if currentBuildResult is not set or currentBuildResult is set and successful or if there was no successful build after this one.

Returns:
first successful BuildResultSummary after this one

getPreviousSuccessfulBuild

@Nullable
public ResultsSummary getPreviousSuccessfulBuild()
Returns:
previous successful BuildResultSummary or null if none found

getFailingSinceBuild

@Nullable
public ResultsSummary getFailingSinceBuild()
If the currentBuildResult is set and failing then return first failed BuildResultSummary in series. Returns null if: - currentBuildResult is not set, or - currentBuildResult is set and not failing

Returns:
first failing BuildResultSummary in a series that contains currentBuildResult

getFixesBuild

@Nullable
public ResultsSummary getFixesBuild()
If the currentBuildResult is set and successful then return first failed BuildResultSummary in series that preceded currentBuildResult. Returns null if: - currentBuildResult is not set, or - currentBuildResult is set and not successful, or - previous successful BuildResultSummary is not found, or - failing build not found between previous successful BuildResultSummary and currentBuildResult

Returns:
first failed BuildResultSummary in series that preceded currentBuildResult

getPrecedingConsecutiveFailuresCount

public int getPrecedingConsecutiveFailuresCount()
Returns:
number of consecutive failures preceding the current BuildResultSummary. 0 if conditions for getFailingSinceBuild() are not met

getCountFailingSince

@Deprecated
public int getCountFailingSince()
Deprecated. since 2.7 use getPrecedingConsecutiveFailuresCount instead, note that it does not include the current result

Returns:
number of failing BuildResultSummary preceding and including currentBuildResult in a series, 0 if conditions for getFailingSinceBuild() are not met

getSucceedingSinceBuild

@Nullable
public ResultsSummary getSucceedingSinceBuild()
If the currentBuildResult is set and successful then return first successful BuildResultSummary in series. Returns null if: - currentBuildResult is not set, or - currentBuildResult is set and not successful

Returns:
first successful BuildResultSummary in a series that contains currentBuildResult

getCountSucceedingSince

public int getCountSucceedingSince()
Returns:
number of successful BuildResultSummary preceding and including currentBuildResult in a series, 0 if conditions for getSucceedingSinceBuild() are not met

getBuild

@NotNull
public Plan getBuild()

getFirstBuildInSequence

@Nullable
public ResultsSummary getFirstBuildInSequence()
Poorly named method. Returns the first BuildResultsSummary in this sequence. Essentially, it tries to find the first failing build, failing that it finds the build that this build fixes

Returns:
May return null if neither conditions are met

getCountOfPrecedingResultsInState

public int getCountOfPrecedingResultsInState(int lowerBuildNumber,
                                             BuildState buildState)
Returns count of preceding results in state buildState with range starting with build lowerBuildNumber (inclusive). The count does not include the current result.



Copyright © 2011 Atlassian. All Rights Reserved.