public class LightningResponse
extends java.lang.Object
implements java.io.Serializable
LightningResponse
class defines the interface for the task agreed by the client and core.
The class also contains LightningResponse.SuccessResponse
to define a successful task, which is identified by a
HTTP response code of '200' and LightningResponse.FailedResponse
to define a failed task.LightningRequest
,
LightningResponse.SuccessResponse
,
LightningResponse.FailedResponse
,
BatchReport
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
LightningResponse.FailedResponse |
static class |
LightningResponse.SuccessResponse |
Constructor and Description |
---|
LightningResponse(java.lang.String sessionId,
LightningCoreConstants.WorkStatus status) |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.Integer,LightningResponse.FailedResponse> |
getFailedResponses()
Get the list of failed response.
|
java.lang.String |
getSessionId()
Get the sessionId of the request.
|
LightningCoreConstants.WorkStatus |
getStatus()
Get the
LightningCoreConstants.WorkStatus of the request. |
int |
getSuccessCount()
Get the successful count of tasks executed.
|
java.util.Map<java.lang.Integer,LightningResponse.SuccessResponse> |
getSuccessResponses()
Get the list of successful response.
|
int |
getTotalCount()
Get the total count of tasks executed.
|
boolean |
isCompleted()
Check of the request is completed.
|
java.lang.String |
prettyPrint() |
void |
setFailedResponses(java.util.Map<java.lang.Integer,LightningResponse.FailedResponse> failedResponses)
Set the list of failed response.
|
void |
setSessionId(java.lang.String sessionId)
Set the sessionId of the request.
|
void |
setStatus(LightningCoreConstants.WorkStatus status)
Set the
LightningCoreConstants.WorkStatus of the request. |
void |
setSuccessCount(int successCount)
Set the successful count of tasks executed.
|
void |
setSuccessResponses(java.util.Map<java.lang.Integer,LightningResponse.SuccessResponse> successResponses)
Set the list of successful response.
|
void |
setTotalCount(int totalCount)
Set the total count of tasks executed.
|
java.lang.String |
toString() |
public LightningResponse(java.lang.String sessionId, LightningCoreConstants.WorkStatus status)
public java.lang.String getSessionId()
public void setSessionId(java.lang.String sessionId)
sessionId
- the sessionId to setpublic int getTotalCount()
public void setTotalCount(int totalCount)
totalCount
- the total count of tasks executedpublic int getSuccessCount()
public void setSuccessCount(int successCount)
successCount
- the successful count of tasks executedpublic LightningCoreConstants.WorkStatus getStatus()
LightningCoreConstants.WorkStatus
of the request.
The status can be one of (IN_QUEUE, RUNNING, DONE, STOPPED, CLEANED_UP)LightningCoreConstants.WorkStatus
of the requestpublic void setStatus(LightningCoreConstants.WorkStatus status)
LightningCoreConstants.WorkStatus
of the request.
The status can be one of (IN_QUEUE, RUNNING, DONE, STOPPED, CLEANED_UP)status
- the LightningCoreConstants.WorkStatus
of the requestpublic boolean isCompleted()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String prettyPrint()
public java.util.Map<java.lang.Integer,LightningResponse.FailedResponse> getFailedResponses()
public void setFailedResponses(java.util.Map<java.lang.Integer,LightningResponse.FailedResponse> failedResponses)
failedResponses
- the list of failed responsepublic java.util.Map<java.lang.Integer,LightningResponse.SuccessResponse> getSuccessResponses()
public void setSuccessResponses(java.util.Map<java.lang.Integer,LightningResponse.SuccessResponse> successResponses)
successResponses
- the list of successful response