|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.jnrpe.utils.thresholds.ReturnValueBuilder
public final class ReturnValueBuilder
This object takes the responsability to build and configure the return value object and the performance data. The plugin has only the responsability to gain the metrics and pass them to the builder: both status and performance data will be generated.
Method Summary | |
---|---|
ReturnValue |
create()
Builds the configured ReturnValue object. |
static ReturnValueBuilder |
forPlugin(String name)
Constructs the object with an empty threshold evaluator. |
static ReturnValueBuilder |
forPlugin(String name,
ThresholdsEvaluator thr)
Constructs the object with the given threshold evaluator. |
ReturnValueBuilder |
withForcedMessage(String message)
Force the message to return to Nagios. |
ReturnValueBuilder |
withStatus(Status forceStatus)
Use this method if you want to force the status to be returned. |
ReturnValueBuilder |
withValue(Metric pluginMetric)
Configure the ReturnValue we are building with the specified
value. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ReturnValueBuilder forPlugin(String name)
name
- The name of the plugin that is creating this result
public static ReturnValueBuilder forPlugin(String name, ThresholdsEvaluator thr)
name
- The name of the plugin that is creating this resultthr
- The threshold evaluator.
public ReturnValueBuilder withValue(Metric pluginMetric)
ReturnValue
we are building with the specified
value.
pluginMetric
- The metric for wich we want to compute the result Status.
public ReturnValueBuilder withForcedMessage(String message)
Metric
object received in the
withValue(Metric)
methods, this value will be returned.
message
- The message to return.
public ReturnValueBuilder withStatus(Status forceStatus)
forceStatus
- The status to be forced
public ReturnValue create()
ReturnValue
object.
ReturnValue
object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |