|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.jnrpe.ReturnValue
public final class ReturnValue
This class is just a container for the plugin result.
Nested Class Summary | |
---|---|
static class |
ReturnValue.UnitOfMeasure
An enumeration defining all supported unit of measures. |
Constructor Summary | |
---|---|
ReturnValue()
Initializes an empty return value. |
|
ReturnValue(int returnCode,
String message)
Deprecated. Use ReturnValue(Status, String) instead |
|
ReturnValue(Status status,
String message)
Initializes the return value object with the given state and the given message. |
|
ReturnValue(String message)
Initializes the return value object with the given message and with the Status.OK state. |
Method Summary | |
---|---|
String |
getMessage()
Returns the message. |
int |
getReturnCode()
Deprecated. Use getStatus() instead. |
Status |
getStatus()
Returns the status. |
ReturnValue |
withMessage(String message)
Sets the message and returns 'this' so that the calls can be cascaded. |
ReturnValue |
withPerformanceData(String label,
BigDecimal value,
ReturnValue.UnitOfMeasure uom,
String warningRange,
String criticalRange,
BigDecimal minimumValue,
BigDecimal maximumValue)
Adds performance data to the plugin result. |
ReturnValue |
withPerformanceData(String label,
BigDecimal value,
String unit,
String warningRange,
String criticalRange,
BigDecimal minimumValue,
BigDecimal maximumValue)
Adds performance data to the plugin result. |
ReturnValue |
withPerformanceData(String label,
Long value,
ReturnValue.UnitOfMeasure uom,
String warningRange,
String criticalRange,
Long minimumValue,
Long maximumValue)
Adds performance data to the plugin result. |
ReturnValue |
withReturnCode(int returnCode)
Deprecated. Use withStatus(Status) instead. |
ReturnValue |
withStatus(Status status)
Sets the return code and returns 'this' so that the calls can be cascaded. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReturnValue()
public ReturnValue(String message)
Status.OK
state.
message
- The message@Deprecated public ReturnValue(int returnCode, String message)
ReturnValue(Status, String)
instead
returnCode
- The statemessage
- The messagepublic ReturnValue(Status status, String message)
status
- The status to be returnedmessage
- The message to be returnedMethod Detail |
---|
@Deprecated public ReturnValue withReturnCode(int returnCode)
withStatus(Status)
instead.
returnCode
- The return code
public ReturnValue withStatus(Status status)
status
- The status to be returned to Nagios
public ReturnValue withMessage(String message)
message
- The message to be returned
@Deprecated public int getReturnCode()
getStatus()
instead.
public Status getStatus()
public String getMessage()
public ReturnValue withPerformanceData(String label, Long value, ReturnValue.UnitOfMeasure uom, String warningRange, String criticalRange, Long minimumValue, Long maximumValue)
label
- The label of the performance data we are addingvalue
- The performance data valueuom
- The Unit Of MeasurewarningRange
- The warning threshold used to check this metric (can be null)criticalRange
- The critical threshold used to check this value (can be null)minimumValue
- The minimum value for this metric (can be null if not
applicable)maximumValue
- The maximum value for this metric (can be null if not
applicable)
public ReturnValue withPerformanceData(String label, BigDecimal value, ReturnValue.UnitOfMeasure uom, String warningRange, String criticalRange, BigDecimal minimumValue, BigDecimal maximumValue)
label
- The label of the performance data we are addingvalue
- The performance data valueuom
- The Unit Of MeasurewarningRange
- The warning threshold used to check this metric (can be null)criticalRange
- The critical threshold used to check this value (can be null)minimumValue
- The minimum value for this metric (can be null if not
applicable)maximumValue
- The maximum value for this metric (can be null if not
applicable)
public ReturnValue withPerformanceData(String label, BigDecimal value, String unit, String warningRange, String criticalRange, BigDecimal minimumValue, BigDecimal maximumValue)
label
- The label of the performance data we are addingvalue
- The performance data valueunit
- The Unit Of MeasurewarningRange
- The warning threshold used to check this metric (can be null)criticalRange
- The critical threshold used to check this value (can be null)minimumValue
- The minimum value for this metric (can be null if not
applicable)maximumValue
- The maximum value for this metric (can be null if not
applicable)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |