hudson.plugins.pmd.util
Class HealthAwarePublisher

java.lang.Object
  extended by hudson.tasks.BuildStepCompatibilityLayer
      extended by hudson.tasks.Publisher
          extended by hudson.plugins.pmd.util.HealthAwarePublisher
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.tasks.Publisher>, hudson.tasks.BuildStep
Direct Known Subclasses:
PmdPublisher

public abstract class HealthAwarePublisher
extends hudson.tasks.Publisher

A base class for publishers with the following two characteristics:


Nested Class Summary
 
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(java.lang.String pattern, java.lang.String threshold, java.lang.String healthy, java.lang.String unHealthy)
          Creates a new instance of HealthAwarePublisher.
 
Method Summary
protected  HealthReportBuilder createHealthReporter(java.lang.String reportSingleCount, java.lang.String reportMultipleCount)
          Creates a new instance of HealthReportBuilder.
 java.lang.String getHealthy()
          Returns the healthy threshold, i.e. when health is reported as 100%.
 int getHealthyAnnotations()
          Returns the healthy threshold for annotations, i.e. when health is reported as 100%.
 int getMinimumAnnotations()
          Returns the threshold to be reached if a build should be considered as unstable.
 java.lang.String getPattern()
          Returns the Ant file-set pattern of files to work with.
 java.lang.String getThreshold()
          Returns the annotation threshold to be reached if a build should be considered as unstable.
 java.lang.String getUnHealthy()
          Returns the unhealthy threshold, i.e. when health is reported as 0%.
 int getUnHealthyAnnotations()
          Returns the unhealthy threshold of annotations, i.e. when health is reported as 0%.
 boolean isHealthyReportEnabled()
          Returns the isHealthyReportEnabled.
 boolean isThresholdEnabled()
          Determines whether a threshold has been defined.
 
Methods inherited from class hudson.tasks.Publisher
getProjectAction, needsToRunAfterFinalized, prebuild
 
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, perform, 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.tasks.BuildStep
getProjectAction, perform, prebuild
 
Methods inherited from interface hudson.model.Describable
getDescriptor
 

Constructor Detail

HealthAwarePublisher

public HealthAwarePublisher(java.lang.String pattern,
                            java.lang.String threshold,
                            java.lang.String healthy,
                            java.lang.String unHealthy)
Creates a new instance of HealthAwarePublisher.

Parameters:
pattern - Ant file-set pattern of files to scan for open tasks in
threshold - Tasks threshold to be reached if a build should be considered as unstable.
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
Method Detail

createHealthReporter

protected HealthReportBuilder createHealthReporter(java.lang.String reportSingleCount,
                                                   java.lang.String reportMultipleCount)
Creates a new instance of HealthReportBuilder.

Parameters:
reportSingleCount - message to be shown if there is exactly one item found
reportMultipleCount - message to be shown if there are zero or more than one items found
Returns:
the new health report builder

isThresholdEnabled

public boolean isThresholdEnabled()
Determines whether a threshold has been defined.

Returns:
true if a threshold has been defined

getThreshold

public java.lang.String getThreshold()
Returns the annotation threshold to be reached if a build should be considered as unstable.

Returns:
the annotation threshold to be reached if a build should be considered as unstable.

getMinimumAnnotations

public int getMinimumAnnotations()
Returns the threshold to be reached if a build should be considered as unstable.

Returns:
the threshold to be reached if a build should be considered as unstable

isHealthyReportEnabled

public boolean isHealthyReportEnabled()
Returns the isHealthyReportEnabled.

Returns:
the isHealthyReportEnabled

getHealthy

public java.lang.String getHealthy()
Returns the healthy threshold, i.e. when health is reported as 100%.

Returns:
the 100% healthiness

getHealthyAnnotations

public int getHealthyAnnotations()
Returns the healthy threshold for annotations, i.e. when health is reported as 100%.

Returns:
the 100% healthiness

getUnHealthy

public java.lang.String getUnHealthy()
Returns the unhealthy threshold, i.e. when health is reported as 0%.

Returns:
the 0% unhealthiness

getUnHealthyAnnotations

public int getUnHealthyAnnotations()
Returns the unhealthy threshold of annotations, i.e. when health is reported as 0%.

Returns:
the 0% unhealthiness

getPattern

public java.lang.String getPattern()
Returns the Ant file-set pattern of files to work with.

Returns:
Ant file-set pattern of files to work with


Copyright © 2008. All Rights Reserved.