Package org.openstack4j.model.common
Class ActionResponse
- java.lang.Object
-
- org.openstack4j.model.common.ActionResponse
-
- All Implemented Interfaces:
Serializable
public class ActionResponse extends Object implements Serializable
A response that is returned when an Action is performed against the server. IfisSuccess()is true then the fault will always be null. The fault will indicate why the action has failed. Any other transport/communication errors will be thrown as with any other API calls.- Author:
- Jeremy Unruh
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ActionResponseactionFailed(String message, int code)static ActionResponseactionSuccess()static ActionResponseactionSuccess(int code)intgetCode()Returns the underlying error code (status code)StringgetFault()booleanisSuccess()StringtoString()
-
-
-
Method Detail
-
actionSuccess
public static ActionResponse actionSuccess(int code)
-
actionSuccess
public static ActionResponse actionSuccess()
-
actionFailed
public static ActionResponse actionFailed(String message, int code)
-
getCode
public int getCode()
Returns the underlying error code (status code)- Returns:
- the error code
-
isSuccess
public boolean isSuccess()
- Returns:
- true if the action was successful
-
getFault
public String getFault()
- Returns:
- the fault if the action was unsuccessful otherwise null
-
-