|
||||||||||
| 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
|
| Constructor Summary | |
|---|---|
ReturnValue()
Initializes an empty return value. |
|
ReturnValue(int iReturnCode,
String sMessage)
Deprecated. Use ReturnValue(Status, String) instead |
|
ReturnValue(Status status,
String sMessage)
Initializes the return value object with the given state and the given message. |
|
ReturnValue(String sMessage)
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 sMessage)
Sets the message and returns 'this' so that the calls can be cascaded. |
ReturnValue |
withPerformanceData(String sLabel,
BigDecimal value,
ReturnValue.UnitOfMeasure uom,
String sWarningRange,
String sCriticalRange,
BigDecimal minimumValue,
BigDecimal maximumValue)
Adds performance data to the plugin result. |
ReturnValue |
withPerformanceData(String sLabel,
Long value,
ReturnValue.UnitOfMeasure uom,
String sWarningRange,
String sCriticalRange,
Long minimumValue,
Long maximumValue)
Adds performance data to the plugin result. |
ReturnValue |
withReturnCode(int iReturnCode)
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 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReturnValue()
public ReturnValue(String sMessage)
Status.OK state.
sMessage - The message
public ReturnValue(int iReturnCode,
String sMessage)
ReturnValue(Status, String) instead
iReturnCode - The statesMessage - The message
public ReturnValue(Status status,
String sMessage)
status - The status to be returnedsMessage - The message to be returned| Method Detail |
|---|
public ReturnValue withReturnCode(int iReturnCode)
withStatus(Status) instead.
iReturnCode - The return code
public ReturnValue withStatus(Status status)
status - The status to be returned to Nagios
public ReturnValue withMessage(String sMessage)
sMessage - The message to be returned
public int getReturnCode()
getStatus() instead.
public Status getStatus()
public String getMessage()
public ReturnValue withPerformanceData(String sLabel,
Long value,
ReturnValue.UnitOfMeasure uom,
String sWarningRange,
String sCriticalRange,
Long minimumValue,
Long maximumValue)
sLabel - The label of the performance data we are addingvalue - The performance data valueuom - The Unit Of MeasuresWarningRange - The warning threshold used to check this metric (can be null)sCriticalRange - 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 sLabel,
BigDecimal value,
ReturnValue.UnitOfMeasure uom,
String sWarningRange,
String sCriticalRange,
BigDecimal minimumValue,
BigDecimal maximumValue)
sLabel - The label of the performance data we are addingvalue - The performance data valueuom - The Unit Of MeasuresWarningRange - The warning threshold used to check this metric (can be null)sCriticalRange - 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 | |||||||||