Package com.github.workerframework.api
Interface WorkerTaskData
- All Known Subinterfaces:
WorkerTask
public interface WorkerTaskData
Represents a task to be completed by the CAF Worker.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addResponse
(WorkerResponse response, boolean includeTaskContext) Used when a task needs to return multiple responses.Retrieves an indicator of the type of the taskbyte[]
Retrieves any task specific context associated with the taskRetrieves task specific correlationIdbyte[]
getData()
Retrieves the actual task data in a serialised formRetrieves information relating to the source of the taskRetrieves the task statusgetTo()
Retrieves the destination pipe to which the sender intends the task to be sent.Retrieves tracking information associated with the taskint
Retrieves the version of the task message usedvoid
Used when a task message needs to be published on the messaging queue.
-
Method Details
-
getClassifier
String getClassifier()Retrieves an indicator of the type of the task -
getVersion
int getVersion()Retrieves the version of the task message used -
getStatus
TaskStatus getStatus()Retrieves the task status -
getData
byte[] getData()Retrieves the actual task data in a serialised form -
getContext
byte[] getContext()Retrieves any task specific context associated with the task -
getCorrelationId
String getCorrelationId()Retrieves task specific correlationId -
getTrackingInfo
TrackingInfo getTrackingInfo()Retrieves tracking information associated with the task -
getTo
String getTo()Retrieves the destination pipe to which the sender intends the task to be sent. -
getSourceInfo
TaskSourceInfo getSourceInfo()Retrieves information relating to the source of the task -
addResponse
Used when a task needs to return multiple responses. This method can be called to return responses prior to the final response.- Parameters:
response
- the response to be sentincludeTaskContext
- whether or not the calling task context should be sent with the response
-
sendMessage
Used when a task message needs to be published on the messaging queue.- Parameters:
tm
- the task message to be sent
-