it.jnrpe.utils.thresholds
Class ThresholdsEvaluatorBuilder

java.lang.Object
  extended by it.jnrpe.utils.thresholds.ThresholdsEvaluatorBuilder

public class ThresholdsEvaluatorBuilder
extends Object

Builds a ThresholdsEvaluator object.

Author:
Massimiliano Ziccardi

Constructor Summary
ThresholdsEvaluatorBuilder()
          Default constructor.
 
Method Summary
 ThresholdsEvaluator create()
           
 ThresholdsEvaluatorBuilder withLegacyThreshold(String metric, String okRange, String warnRange, String critRange)
          This method allows to specify thresholds using the old format.
 ThresholdsEvaluatorBuilder withThreshold(String threshold)
          Adds a threshold to the threshold evaluator object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThresholdsEvaluatorBuilder

public ThresholdsEvaluatorBuilder()
Default constructor.

Method Detail

withThreshold

public final ThresholdsEvaluatorBuilder withThreshold(String threshold)
                                               throws BadThresholdException
Adds a threshold to the threshold evaluator object.

Parameters:
threshold - The threhsold text
Returns:
this
Throws:
BadThresholdException - -

withLegacyThreshold

public final ThresholdsEvaluatorBuilder withLegacyThreshold(String metric,
                                                            String okRange,
                                                            String warnRange,
                                                            String critRange)
                                                     throws BadThresholdException
This method allows to specify thresholds using the old format.

Parameters:
metric - The metric for which this threshold must be configured
okRange - The ok range (can be null)
warnRange - The warning range (can be null)
critRange - The critical range (can be null).
Returns:
this
Throws:
BadThresholdException - If the threshold can't be parsed.

create

public final ThresholdsEvaluator create()
Returns:
the threshold evaluator.


Copyright © 2014. All Rights Reserved.