it.jnrpe
Class ReturnValue

java.lang.Object
  extended by it.jnrpe.ReturnValue

public final class ReturnValue
extends Object

This class is just a container for the plugin result.

Author:
Massimiliano Ziccardi

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 IJNRPEConstants.STATE_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 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

ReturnValue

public ReturnValue()
Initializes an empty return value.


ReturnValue

public ReturnValue(String sMessage)
Initializes the return value object with the given message and with the IJNRPEConstants.STATE_OK state.

Parameters:
sMessage - The message

ReturnValue

public ReturnValue(int iReturnCode,
                   String sMessage)
Deprecated. Use ReturnValue(Status, String) instead

Initializes the return value object with the given state and the given message.

Parameters:
iReturnCode - The state
sMessage - The message

ReturnValue

public ReturnValue(Status status,
                   String sMessage)
Initializes the return value object with the given state and the given message.

Parameters:
status - The status to be returned
sMessage - The message to be returned
Method Detail

withReturnCode

public ReturnValue withReturnCode(int iReturnCode)
Deprecated. Use withStatus(Status) instead.

Sets the return code and returns 'this' so that the calls can be cascaded.

Parameters:
iReturnCode - The return code
Returns:
this

withStatus

public ReturnValue withStatus(Status status)
Sets the return code and returns 'this' so that the calls can be cascaded.

Parameters:
status - The status to be returned to Nagios
Returns:
this

withMessage

public ReturnValue withMessage(String sMessage)
Sets the message and returns 'this' so that the calls can be cascaded.

Parameters:
sMessage - The message to be returned
Returns:
this

getReturnCode

public int getReturnCode()
Deprecated. Use getStatus() instead.

Returns the status.

Returns:
The state

getStatus

public Status getStatus()
Returns the status.

Returns:
The status

getMessage

public String getMessage()
Returns the message.

Returns:
The message


Copyright © 2013. All Rights Reserved.