Package org.opennebula.client
Class OneResponse
java.lang.Object
org.opennebula.client.OneResponse
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 -
Method Summary
Modifier and TypeMethodDescriptionboolean
Parses the string returned by getMessageReturns a string containing the error message, or null if the response isn't an error.int
Parses the string returned by getMessageReturns a string containing the response information, or null if the response was an error.boolean
isError()
Returns true if the call resulted in error.
-
Constructor Details
-
OneResponse
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
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
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:
-