Class OneResponse

java.lang.Object
org.opennebula.client.OneResponse

public class OneResponse extends Object
This class encapsulates OpenNebula's XML-RPC responses. Each response carries a boolean indicating if it is an error. It can also contain a success message, or an error message.
  • Constructor Details

    • OneResponse

      public OneResponse(boolean success, String message)
      Creates a new response.
      Parameters:
      success - Indicates if the call was successful, and if the message is an error or an information string.
      message - String containing the response message, or the error message.
  • Method Details

    • isError

      public boolean isError()
      Returns true if the call resulted in error.
      Returns:
      True if the call resulted in error.
    • getErrorMessage

      public String getErrorMessage()
      Returns a string containing the error message, or null if the response isn't an error.
      Returns:
      A string containing the error message, or null if the response isn't an error.
    • getMessage

      public String getMessage()
      Returns a string containing the response information, or null if the response was an error. Note that the success message could be also null.
      Returns:
      A string containing the response information, or null if the response was an error. Note that the success message could be also null.
    • getIntMessage

      public int getIntMessage()
      Parses the string returned by getMessage
      Returns:
      The parsed int, or Integer.MIN_VALUE in case of error
      See Also:
    • getBooleanMessage

      public boolean getBooleanMessage()
      Parses the string returned by getMessage
      Returns:
      The parsed boolean. False in case of error
      See Also: