it.jnrpe.utils
Class ThresholdUtil

java.lang.Object
  extended by it.jnrpe.utils.ThresholdUtil

public final class ThresholdUtil
extends Object

Utility class for evaluating threshold This class conforms to the nagios plugin guidelines (http://nagiosplug.sourceforge.net/developer-guidelines.html #THRESHOLDFORMAT). The generalised range format is: [@]start:end Values are interpreted this way:

start and ":" is not required if start=0.

Author:
Massimiliano Ziccardi

Method Summary
static boolean isValueInRange(String sRange, BigDecimal value)
          Returns true if the value dalue falls into the range sRange.
static boolean isValueInRange(String sRange, int iValue)
          Returns true if the value iValue falls into the range sRange.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isValueInRange

public static boolean isValueInRange(String sRange,
                                     int iValue)
                              throws BadThresholdException
Returns true if the value iValue falls into the range sRange.

Parameters:
sRange - The range
iValue - The value
Returns:
true if the value iValue falls into the
Throws:
BadThresholdException

isValueInRange

public static boolean isValueInRange(String sRange,
                                     BigDecimal value)
                              throws BadThresholdException
Returns true if the value dalue falls into the range sRange.

Parameters:
sRange - The range
value - The value given range
Throws:
BadThresholdException


Copyright © 2013. All Rights Reserved.