hudson.plugins.analysis.core
Class HealthAwarePublisher

java.lang.Object
  extended by hudson.tasks.BuildStepCompatibilityLayer
      extended by hudson.tasks.Publisher
          extended by hudson.tasks.Recorder
              extended by hudson.plugins.analysis.core.HealthAwareRecorder
                  extended by hudson.plugins.analysis.core.HealthAwarePublisher
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.matrix.MatrixAggregatable, hudson.model.Describable<hudson.tasks.Publisher>, HealthDescriptor, hudson.tasks.BuildStep, Serializable

public abstract class HealthAwarePublisher
extends HealthAwareRecorder

A base class for publishers with the following two characteristics:

Author:
Ulli Hafner
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class hudson.tasks.Publisher
hudson.tasks.Publisher.DescriptorExtensionListImpl
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
hudson.tasks.BuildStep.PublisherList
 
Field Summary
 
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
 
Constructor Summary
HealthAwarePublisher(String healthy, String unHealthy, String thresholdLimit, String defaultEncoding, boolean useDeltaValues, String unstableTotalAll, String unstableTotalHigh, String unstableTotalNormal, String unstableTotalLow, String unstableNewAll, String unstableNewHigh, String unstableNewNormal, String unstableNewLow, String failedTotalAll, String failedTotalHigh, String failedTotalNormal, String failedTotalLow, String failedNewAll, String failedNewHigh, String failedNewNormal, String failedNewLow, boolean canRunOnFailed, boolean shouldDetectModules, boolean canComputeNew, boolean canResolveRelativePaths, String pluginName)
          Creates a new instance of HealthAwarePublisher.
HealthAwarePublisher(String healthy, String unHealthy, String thresholdLimit, String defaultEncoding, boolean useDeltaValues, String unstableTotalAll, String unstableTotalHigh, String unstableTotalNormal, String unstableTotalLow, String unstableNewAll, String unstableNewHigh, String unstableNewNormal, String unstableNewLow, String failedTotalAll, String failedTotalHigh, String failedTotalNormal, String failedTotalLow, String failedNewAll, String failedNewHigh, String failedNewNormal, String failedNewLow, boolean canRunOnFailed, boolean shouldDetectModules, boolean canComputeNew, String pluginName)
          Creates a new instance of HealthAwarePublisher.
HealthAwarePublisher(String healthy, String unHealthy, String thresholdLimit, String defaultEncoding, boolean useDeltaValues, String unstableTotalAll, String unstableTotalHigh, String unstableTotalNormal, String unstableTotalLow, String unstableNewAll, String unstableNewHigh, String unstableNewNormal, String unstableNewLow, String failedTotalAll, String failedTotalHigh, String failedTotalNormal, String failedTotalLow, String failedNewAll, String failedNewHigh, String failedNewNormal, String failedNewLow, boolean canRunOnFailed, boolean shouldDetectModules, String pluginName)
          Deprecated. 
HealthAwarePublisher(String healthy, String unHealthy, String thresholdLimit, String defaultEncoding, boolean useDeltaValues, String unstableTotalAll, String unstableTotalHigh, String unstableTotalNormal, String unstableTotalLow, String unstableNewAll, String unstableNewHigh, String unstableNewNormal, String unstableNewLow, String failedTotalAll, String failedTotalHigh, String failedTotalNormal, String failedTotalLow, String failedNewAll, String failedNewHigh, String failedNewNormal, String failedNewLow, boolean canRunOnFailed, String pluginName)
          Deprecated. 
HealthAwarePublisher(String threshold, String newThreshold, String failureThreshold, String newFailureThreshold, String healthy, String unHealthy, String thresholdLimit, String defaultEncoding, boolean useDeltaValues, boolean canRunOnFailed, String pluginName)
          Deprecated. 
 
Method Summary
protected  boolean perform(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, PluginLogger logger)
          Callback method that is invoked after the build where this recorder can collect the results.
protected abstract  BuildResult perform(hudson.model.AbstractBuild<?,?> build, PluginLogger logger)
          Performs the publishing of the results of this plug-in.
protected  void updateBuildResult(BuildResult result, PluginLogger logger)
          Will be invoked after the build result has been evaluated.
 
Methods inherited from class hudson.plugins.analysis.core.HealthAwareRecorder
canComputeNew, canContinue, canResolveRelativePaths, copyFilesWithAnnotationsToBuildFolder, getCanComputeNew, getCanResolveRelativePaths, getCanRunOnFailed, getDefaultEncoding, getDescriptor, getHealthy, getMinimumPriority, getRequiredMonitorService, getShouldDetectModules, getThresholdLimit, getThresholds, getUnHealthy, getUseDeltaValues, isAntBuild, isMavenBuild, isThresholdEnabled, perform, readResolve, shouldDetectModules
 
Methods inherited from class hudson.tasks.Publisher
all, getProjectAction, needsToRun, needsToRunAfterFinalized, prebuild
 
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectActions, perform, prebuild
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hudson.matrix.MatrixAggregatable
createAggregator
 
Methods inherited from interface hudson.tasks.BuildStep
getProjectAction, getProjectActions, prebuild
 

Constructor Detail

HealthAwarePublisher

public HealthAwarePublisher(String healthy,
                            String unHealthy,
                            String thresholdLimit,
                            String defaultEncoding,
                            boolean useDeltaValues,
                            String unstableTotalAll,
                            String unstableTotalHigh,
                            String unstableTotalNormal,
                            String unstableTotalLow,
                            String unstableNewAll,
                            String unstableNewHigh,
                            String unstableNewNormal,
                            String unstableNewLow,
                            String failedTotalAll,
                            String failedTotalHigh,
                            String failedTotalNormal,
                            String failedTotalLow,
                            String failedNewAll,
                            String failedNewHigh,
                            String failedNewNormal,
                            String failedNewLow,
                            boolean canRunOnFailed,
                            boolean shouldDetectModules,
                            boolean canComputeNew,
                            boolean canResolveRelativePaths,
                            String pluginName)
Creates a new instance of HealthAwarePublisher.

Parameters:
healthy - Report health as 100% when the number of open tasks is less than this value
unHealthy - Report health as 0% when the number of open tasks is greater than this value
thresholdLimit - determines which warning priorities should be considered when evaluating the build stability and health
defaultEncoding - the default encoding to be used when reading and parsing files
useDeltaValues - determines whether the absolute annotations delta or the actual annotations set difference should be used to evaluate the build stability
unstableTotalAll - annotation threshold
unstableTotalHigh - annotation threshold
unstableTotalNormal - annotation threshold
unstableTotalLow - annotation threshold
unstableNewAll - annotation threshold
unstableNewHigh - annotation threshold
unstableNewNormal - annotation threshold
unstableNewLow - annotation threshold
failedTotalAll - annotation threshold
failedTotalHigh - annotation threshold
failedTotalNormal - annotation threshold
failedTotalLow - annotation threshold
failedNewAll - annotation threshold
failedNewHigh - annotation threshold
failedNewNormal - annotation threshold
failedNewLow - annotation threshold
canRunOnFailed - determines whether the plug-in can run for failed builds, too
shouldDetectModules - determines whether module names should be derived from Maven POM or Ant build files
canComputeNew - determines whether new warnings should be computed (with respect to baseline)
canResolveRelativePaths - determines whether relative paths in warnings should be resolved using a time expensive operation that scans the whole workspace for matching files.
pluginName - the name of the plug-in

HealthAwarePublisher

public HealthAwarePublisher(String healthy,
                            String unHealthy,
                            String thresholdLimit,
                            String defaultEncoding,
                            boolean useDeltaValues,
                            String unstableTotalAll,
                            String unstableTotalHigh,
                            String unstableTotalNormal,
                            String unstableTotalLow,
                            String unstableNewAll,
                            String unstableNewHigh,
                            String unstableNewNormal,
                            String unstableNewLow,
                            String failedTotalAll,
                            String failedTotalHigh,
                            String failedTotalNormal,
                            String failedTotalLow,
                            String failedNewAll,
                            String failedNewHigh,
                            String failedNewNormal,
                            String failedNewLow,
                            boolean canRunOnFailed,
                            boolean shouldDetectModules,
                            boolean canComputeNew,
                            String pluginName)
Creates a new instance of HealthAwarePublisher.

Parameters:
healthy - Report health as 100% when the number of open tasks is less than this value
unHealthy - Report health as 0% when the number of open tasks is greater than this value
thresholdLimit - determines which warning priorities should be considered when evaluating the build stability and health
defaultEncoding - the default encoding to be used when reading and parsing files
useDeltaValues - determines whether the absolute annotations delta or the actual annotations set difference should be used to evaluate the build stability
unstableTotalAll - annotation threshold
unstableTotalHigh - annotation threshold
unstableTotalNormal - annotation threshold
unstableTotalLow - annotation threshold
unstableNewAll - annotation threshold
unstableNewHigh - annotation threshold
unstableNewNormal - annotation threshold
unstableNewLow - annotation threshold
failedTotalAll - annotation threshold
failedTotalHigh - annotation threshold
failedTotalNormal - annotation threshold
failedTotalLow - annotation threshold
failedNewAll - annotation threshold
failedNewHigh - annotation threshold
failedNewNormal - annotation threshold
failedNewLow - annotation threshold
canRunOnFailed - determines whether the plug-in can run for failed builds, too
shouldDetectModules - determines whether module names should be derived from Maven POM or Ant build files
canComputeNew - determines whether new warnings should be computed (with respect to baseline)
pluginName - the name of the plug-in

HealthAwarePublisher

@Deprecated
public HealthAwarePublisher(String healthy,
                                       String unHealthy,
                                       String thresholdLimit,
                                       String defaultEncoding,
                                       boolean useDeltaValues,
                                       String unstableTotalAll,
                                       String unstableTotalHigh,
                                       String unstableTotalNormal,
                                       String unstableTotalLow,
                                       String unstableNewAll,
                                       String unstableNewHigh,
                                       String unstableNewNormal,
                                       String unstableNewLow,
                                       String failedTotalAll,
                                       String failedTotalHigh,
                                       String failedTotalNormal,
                                       String failedTotalLow,
                                       String failedNewAll,
                                       String failedNewHigh,
                                       String failedNewNormal,
                                       String failedNewLow,
                                       boolean canRunOnFailed,
                                       boolean shouldDetectModules,
                                       String pluginName)
Deprecated. 


HealthAwarePublisher

@Deprecated
public HealthAwarePublisher(String healthy,
                                       String unHealthy,
                                       String thresholdLimit,
                                       String defaultEncoding,
                                       boolean useDeltaValues,
                                       String unstableTotalAll,
                                       String unstableTotalHigh,
                                       String unstableTotalNormal,
                                       String unstableTotalLow,
                                       String unstableNewAll,
                                       String unstableNewHigh,
                                       String unstableNewNormal,
                                       String unstableNewLow,
                                       String failedTotalAll,
                                       String failedTotalHigh,
                                       String failedTotalNormal,
                                       String failedTotalLow,
                                       String failedNewAll,
                                       String failedNewHigh,
                                       String failedNewNormal,
                                       String failedNewLow,
                                       boolean canRunOnFailed,
                                       String pluginName)
Deprecated. 


HealthAwarePublisher

@Deprecated
public HealthAwarePublisher(String threshold,
                                       String newThreshold,
                                       String failureThreshold,
                                       String newFailureThreshold,
                                       String healthy,
                                       String unHealthy,
                                       String thresholdLimit,
                                       String defaultEncoding,
                                       boolean useDeltaValues,
                                       boolean canRunOnFailed,
                                       String pluginName)
Deprecated. 

Method Detail

perform

protected boolean perform(hudson.model.AbstractBuild<?,?> build,
                          hudson.Launcher launcher,
                          PluginLogger logger)
                   throws IOException,
                          InterruptedException
Callback method that is invoked after the build where this recorder can collect the results. This default implementation provides a template method that updates the build status based on the results and copies all files with warnings to the build folder on the master.

Specified by:
perform in class HealthAwareRecorder
Parameters:
build - current build
launcher - the launcher for this build
logger - the logger
Returns:
true if the build can continue, false otherwise
Throws:
IOException - in case of problems during file copying
InterruptedException - if the user canceled the build

updateBuildResult

protected void updateBuildResult(BuildResult result,
                                 PluginLogger logger)
Will be invoked after the build result has been evaluated.

Parameters:
result - the evaluated build result
logger - the logger

perform

protected abstract BuildResult perform(hudson.model.AbstractBuild<?,?> build,
                                       PluginLogger logger)
                                throws InterruptedException,
                                       IOException
Performs the publishing of the results of this plug-in.

Parameters:
build - the build
logger - the logger to report the progress to
Returns:
the java project containing the found annotations
Throws:
InterruptedException - If the build is interrupted by the user (in an attempt to abort the build.) Normally the BuildStep implementations may simply forward the exception it got from its lower-level functions.
IOException - If the implementation wants to abort the processing when an IOException happens, it can simply propagate the exception to the caller. This will cause the build to fail, with the default error message. Implementations are encouraged to catch IOException on its own to provide a better error message, if it can do so, so that users have better understanding on why it failed.


Copyright © 2004-2012 Hudson. All Rights Reserved.