public class Result extends Object
Result
class contains the response sent by the server, i.e. the status (either ok or failed),
an error code and message if failed and the xml response sent by the server.Modifier and Type | Class and Description |
---|---|
static class |
Result.Status |
Modifier and Type | Field and Description |
---|---|
protected int |
errorCode |
protected String |
errorMessage |
protected int |
httpErrorCode |
protected Document |
resultDocument |
protected Result.Status |
status |
Modifier | Constructor and Description |
---|---|
protected |
Result(Document resultDocument) |
protected |
Result(String errorMessage) |
Modifier and Type | Method and Description |
---|---|
(package private) static Result |
createHttpErrorResult(int httpErrorCode,
String errorMessage) |
(package private) static Result |
createOkResult(Document resultDocument) |
(package private) static Result |
createRestErrorResult(int errorCode,
String errorMessage) |
DomElement |
getContentElement() |
int |
getErrorCode() |
String |
getErrorMessage() |
int |
getHttpErrorCode() |
Document |
getResultDocument() |
Result.Status |
getStatus() |
boolean |
isSuccessful()
Returns if the operation was successful.
|
String |
toString() |
protected Result.Status status
protected String errorMessage
protected int errorCode
protected int httpErrorCode
protected Document resultDocument
static Result createOkResult(Document resultDocument)
static Result createHttpErrorResult(int httpErrorCode, String errorMessage)
static Result createRestErrorResult(int errorCode, String errorMessage)
public boolean isSuccessful()
getStatus() == Status.OK
.true
if the operation was successfulpublic int getErrorCode()
public int getHttpErrorCode()
public Result.Status getStatus()
public Document getResultDocument()
public String getErrorMessage()
public DomElement getContentElement()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses