public class Result
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Result.Status
The set of possible result status codes.
|
| Constructor and Description |
|---|
Result()
Construct an empty result.
|
Result(Result.Status status)
Construct a result with an initial status.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(java.util.List<java.lang.String> msgs)
Add a list of messages to the result.
|
void |
add(java.lang.String msg)
Add one message to the result.
|
void |
add(java.lang.Throwable t)
Add a messages for an exception to the result.
|
void |
fail(java.lang.String msg)
Add a messages to the result and also set the status to Failed.
|
void |
fail(java.lang.Throwable t)
Add a messages for an exception to the result and also
set the status to Failed.
|
java.util.List<java.lang.String> |
getMessages()
Get the result message list.
|
java.util.Map<java.lang.String,java.lang.Object> |
getObject()
This can be optionally returned by the connector
in the result stored within a Request.
|
int |
getRetryInterval()
This is the optional preferred amount of time to wait before
the request is retried.
|
Result.Status |
getStatus() |
java.lang.String |
getToken()
The token is used to identify
an internal system object that was created to process the request.
|
boolean |
isFailed() |
boolean |
isRetry() |
boolean |
isSubmitted() |
void |
setMessages(java.util.List<java.lang.String> messages)
Set the result message list.
|
void |
setObject(java.util.Map<java.lang.String,java.lang.Object> obj)
Set the result object.
|
void |
setRetryableFailure(java.lang.Throwable t)
Add a messages for an exception to the
result and also set the status to Retry.
|
void |
setRetryInterval(int seconds)
Set the retry interval.
|
void |
setStatus(Result.Status status)
Set the result status code.
|
void |
setToken(java.lang.String token)
Set the result token.
|
java.lang.String |
toJson() |
void |
toJson(JsonBuilder jb)
Render the Item as a JSON string for logging and debugging.
|
public Result()
public Result(Result.Status status)
public void setStatus(Result.Status status)
public Result.Status getStatus()
public void setToken(java.lang.String token)
public java.lang.String getToken()
public void setMessages(java.util.List<java.lang.String> messages)
public java.util.List<java.lang.String> getMessages()
public void setRetryInterval(int seconds)
public int getRetryInterval()
public void setObject(java.util.Map<java.lang.String,java.lang.Object> obj)
public java.util.Map<java.lang.String,java.lang.Object> getObject()
public void add(java.lang.String msg)
public void add(java.util.List<java.lang.String> msgs)
public void add(java.lang.Throwable t)
public void fail(java.lang.Throwable t)
public void fail(java.lang.String msg)
public void setRetryableFailure(java.lang.Throwable t)
public boolean isFailed()
public boolean isRetry()
public boolean isSubmitted()
public void toJson(JsonBuilder jb)
public java.lang.String toJson()