hudson.plugins.dry.util
Class AbstractHealthDescriptor

java.lang.Object
  extended by hudson.plugins.dry.util.AbstractHealthDescriptor
All Implemented Interfaces:
HealthDescriptor, java.io.Serializable
Direct Known Subclasses:
DryHealthDescriptor, NullHealthDescriptor

public abstract class AbstractHealthDescriptor
extends java.lang.Object
implements HealthDescriptor

A base class for serializable health descriptors. Instances of this class are immutable.

Author:
Ulli Hafner
See Also:
Serialized Form

Constructor Summary
AbstractHealthDescriptor()
          Creates a new instance of AbstractHealthDescriptor.
AbstractHealthDescriptor(HealthDescriptor healthDescriptor)
          Creates a new instance of AbstractHealthDescriptor based on the values of the specified descriptor.
 
Method Summary
protected abstract  org.jvnet.localizer.Localizable createDescription(AnnotationProvider result)
          Returns a localized description of the build health.
 int getHealthyAnnotations()
          Returns the healthy threshold for annotations, i.e.
 int getMinimumAnnotations()
          Returns the threshold to be reached if a build should be considered as unstable.
 Priority getMinimumPriority()
          Returns the minimum priority that should be considered when computing build health and stability.
 int getUnHealthyAnnotations()
          Returns the unhealthy threshold of annotations, i.e.
 boolean isHealthyReportEnabled()
          Determines whether a health report should be created.
 boolean isThresholdEnabled()
          Determines whether a threshold has been defined.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractHealthDescriptor

public AbstractHealthDescriptor(HealthDescriptor healthDescriptor)
Creates a new instance of AbstractHealthDescriptor based on the values of the specified descriptor.

Parameters:
healthDescriptor - the descriptor to copy the values from

AbstractHealthDescriptor

public AbstractHealthDescriptor()
Creates a new instance of AbstractHealthDescriptor.

Method Detail

getHealthyAnnotations

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

Specified by:
getHealthyAnnotations in interface HealthDescriptor
Returns:
the 100% healthiness

getMinimumAnnotations

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

Specified by:
getMinimumAnnotations in interface HealthDescriptor
Returns:
the threshold to be reached if a build should be considered as unstable

getUnHealthyAnnotations

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

Specified by:
getUnHealthyAnnotations in interface HealthDescriptor
Returns:
the 0% unhealthiness

isHealthyReportEnabled

public boolean isHealthyReportEnabled()
Determines whether a health report should be created.

Specified by:
isHealthyReportEnabled in interface HealthDescriptor
Returns:
true if a health report should be created

isThresholdEnabled

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

Specified by:
isThresholdEnabled in interface HealthDescriptor
Returns:
true if a threshold has been defined

getMinimumPriority

public Priority getMinimumPriority()
Returns the minimum priority that should be considered when computing build health and stability. E.g., if Priority.NORMAL is returned, then annotations with priority Priority.LOW are ignored.

Specified by:
getMinimumPriority in interface HealthDescriptor
Returns:
the minimum priority to consider

createDescription

protected abstract org.jvnet.localizer.Localizable createDescription(AnnotationProvider result)
Returns a localized description of the build health.

Parameters:
result - the result of the build
Returns:
a localized description of the build health


Copyright © 2009. All Rights Reserved.