Class OneResponse


  • public class OneResponse
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      OneResponse​(boolean success, java.lang.String message)
      Creates a new response.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean getBooleanMessage()
      Parses the string returned by getMessage
      java.lang.String getErrorMessage()
      Returns a string containing the error message, or null if the response isn't an error.
      int getIntMessage()
      Parses the string returned by getMessage
      java.lang.String getMessage()
      Returns a string containing the response information, or null if the response was an error.
      boolean isError()
      Returns true if the call resulted in error.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OneResponse

        public OneResponse​(boolean success,
                           java.lang.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 Detail

      • isError

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

        public java.lang.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 java.lang.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:
        getMessage()
      • getBooleanMessage

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