public class TaskClient extends ClientBase
client, conductorClientConfiguration, objectMapper, payloadStorage, root
Constructor and Description |
---|
TaskClient()
Creates a default task client
|
TaskClient(com.sun.jersey.api.client.config.ClientConfig config) |
TaskClient(com.sun.jersey.api.client.config.ClientConfig config,
com.sun.jersey.api.client.ClientHandler handler) |
TaskClient(com.sun.jersey.api.client.config.ClientConfig config,
com.sun.jersey.api.client.ClientHandler handler,
com.sun.jersey.api.client.filter.ClientFilter... filters) |
TaskClient(com.sun.jersey.api.client.config.ClientConfig config,
ConductorClientConfiguration clientConfiguration,
com.sun.jersey.api.client.ClientHandler handler,
com.sun.jersey.api.client.filter.ClientFilter... filters) |
Modifier and Type | Method and Description |
---|---|
java.lang.Boolean |
ack(java.lang.String taskId,
java.lang.String workerId)
Ack for the task poll.
|
java.util.List<com.netflix.conductor.common.metadata.tasks.Task> |
batchPollTasksByTaskType(java.lang.String taskType,
java.lang.String workerId,
int count,
int timeoutInMillisecond)
Perform a batch poll for tasks by task type.
|
java.util.List<com.netflix.conductor.common.metadata.tasks.Task> |
batchPollTasksInDomain(java.lang.String taskType,
java.lang.String domain,
java.lang.String workerId,
int count,
int timeoutInMillisecond)
Batch poll for tasks in a domain.
|
void |
evaluateAndUploadLargePayload(com.netflix.conductor.common.metadata.tasks.TaskResult taskResult,
java.lang.String taskType) |
java.util.List<com.netflix.conductor.common.metadata.tasks.PollData> |
getAllPollData()
Get the last poll data for all task types
|
com.netflix.conductor.common.metadata.tasks.Task |
getPendingTaskForWorkflow(java.lang.String workflowId,
java.lang.String taskReferenceName)
Retrieve pending task identified by reference name for a workflow
|
java.util.List<com.netflix.conductor.common.metadata.tasks.Task> |
getPendingTasksByType(java.lang.String taskType,
java.lang.String startKey,
java.lang.Integer count)
Retrieve pending tasks by type
|
java.util.List<com.netflix.conductor.common.metadata.tasks.PollData> |
getPollData(java.lang.String taskType)
Get last poll data for a given task type
|
int |
getQueueSizeForTask(java.lang.String taskType) |
com.netflix.conductor.common.metadata.tasks.Task |
getTaskDetails(java.lang.String taskId)
Retrieve information about the task
|
java.util.List<com.netflix.conductor.common.metadata.tasks.TaskExecLog> |
getTaskLogs(java.lang.String taskId)
Fetch execution logs for a task.
|
void |
logMessageForTask(java.lang.String taskId,
java.lang.String logMessage)
Log execution messages for a task.
|
com.netflix.conductor.common.metadata.tasks.Task |
pollTask(java.lang.String taskType,
java.lang.String workerId,
java.lang.String domain)
Perform a poll for a task of a specific task type.
|
void |
removeTaskFromQueue(java.lang.String taskType,
java.lang.String taskId)
Removes a task from a taskType queue
|
java.lang.String |
requeueAllPendingTasks()
Requeue pending tasks for all running workflows
|
java.lang.String |
requeuePendingTasksByTaskType(java.lang.String taskType)
Requeue pending tasks of a specific task type
|
com.netflix.conductor.common.run.SearchResult<com.netflix.conductor.common.run.TaskSummary> |
search(java.lang.Integer start,
java.lang.Integer size,
java.lang.String sort,
java.lang.String freeText,
java.lang.String query)
Paginated search for tasks based on payload
|
com.netflix.conductor.common.run.SearchResult<com.netflix.conductor.common.run.TaskSummary> |
search(java.lang.String query)
Search for tasks based on payload
|
void |
updateTask(com.netflix.conductor.common.metadata.tasks.TaskResult taskResult)
Updates the result of a task execution.
|
delete, delete, downloadFromExternalStorage, getForEntity, getForEntity, postForEntity, postForEntity, postForEntityWithRequestOnly, postForEntityWithUriVariablesOnly, put, setRootURI, uploadToExternalPayloadStorage
public TaskClient()
public TaskClient(com.sun.jersey.api.client.config.ClientConfig config)
config
- REST Client configurationpublic TaskClient(com.sun.jersey.api.client.config.ClientConfig config, com.sun.jersey.api.client.ClientHandler handler)
config
- REST Client configurationhandler
- Jersey client handler. Useful when plugging in various http client interaction modules (e.g. ribbon)public TaskClient(com.sun.jersey.api.client.config.ClientConfig config, com.sun.jersey.api.client.ClientHandler handler, com.sun.jersey.api.client.filter.ClientFilter... filters)
config
- REST Client configurationhandler
- Jersey client handler. Useful when plugging in various http client interaction modules (e.g. ribbon)filters
- Chain of client side filters to be applied per requestpublic TaskClient(com.sun.jersey.api.client.config.ClientConfig config, ConductorClientConfiguration clientConfiguration, com.sun.jersey.api.client.ClientHandler handler, com.sun.jersey.api.client.filter.ClientFilter... filters)
config
- REST Client configurationclientConfiguration
- Specific properties configured for the client, see ConductorClientConfiguration
handler
- Jersey client handler. Useful when plugging in various http client interaction modules (e.g. ribbon)filters
- Chain of client side filters to be applied per requestpublic com.netflix.conductor.common.metadata.tasks.Task pollTask(java.lang.String taskType, java.lang.String workerId, java.lang.String domain)
taskType
- The taskType to poll fordomain
- The domain of the task typeworkerId
- Name of the client worker. Used for logging.public java.util.List<com.netflix.conductor.common.metadata.tasks.Task> batchPollTasksByTaskType(java.lang.String taskType, java.lang.String workerId, int count, int timeoutInMillisecond)
taskType
- Type of task to poll forworkerId
- Name of the client worker. Used for logging.count
- Maximum number of tasks to be returned. Actual number of tasks returned can be less than this number.timeoutInMillisecond
- Long poll wait timeout.public java.util.List<com.netflix.conductor.common.metadata.tasks.Task> batchPollTasksInDomain(java.lang.String taskType, java.lang.String domain, java.lang.String workerId, int count, int timeoutInMillisecond)
taskType
- Type of task to poll fordomain
- The domain of the task typeworkerId
- Name of the client worker. Used for logging.count
- Maximum number of tasks to be returned. Actual number of tasks returned can be less than this number.timeoutInMillisecond
- Long poll wait timeout.public java.util.List<com.netflix.conductor.common.metadata.tasks.Task> getPendingTasksByType(java.lang.String taskType, java.lang.String startKey, java.lang.Integer count)
taskType
- Type of taskstartKey
- id of the task from where to return the results. NULL to start from the beginning.count
- number of tasks to retrievepublic com.netflix.conductor.common.metadata.tasks.Task getPendingTaskForWorkflow(java.lang.String workflowId, java.lang.String taskReferenceName)
workflowId
- Workflow instance idtaskReferenceName
- reference name of the taskpublic void updateTask(com.netflix.conductor.common.metadata.tasks.TaskResult taskResult)
ConductorClientConfiguration.getTaskOutputPayloadThresholdKB()
,
it is uploaded to ExternalPayloadStorage
, if enabled, else the task is marked as FAILED_WITH_TERMINAL_ERROR.taskResult
- the TaskResult
of the executed task to be updated.public void evaluateAndUploadLargePayload(com.netflix.conductor.common.metadata.tasks.TaskResult taskResult, java.lang.String taskType)
public java.lang.Boolean ack(java.lang.String taskId, java.lang.String workerId)
taskId
- Id of the task to be polledworkerId
- user identified worker.public void logMessageForTask(java.lang.String taskId, java.lang.String logMessage)
taskId
- id of the tasklogMessage
- the message to be loggedpublic java.util.List<com.netflix.conductor.common.metadata.tasks.TaskExecLog> getTaskLogs(java.lang.String taskId)
taskId
- id of the task.public com.netflix.conductor.common.metadata.tasks.Task getTaskDetails(java.lang.String taskId)
taskId
- ID of the taskpublic void removeTaskFromQueue(java.lang.String taskType, java.lang.String taskId)
taskType
- the taskType to identify the queuetaskId
- the id of the task to be removedpublic int getQueueSizeForTask(java.lang.String taskType)
public java.util.List<com.netflix.conductor.common.metadata.tasks.PollData> getPollData(java.lang.String taskType)
taskType
- the task type for which poll data is to be fetchedpublic java.util.List<com.netflix.conductor.common.metadata.tasks.PollData> getAllPollData()
public java.lang.String requeueAllPendingTasks()
public java.lang.String requeuePendingTasksByTaskType(java.lang.String taskType)
public com.netflix.conductor.common.run.SearchResult<com.netflix.conductor.common.run.TaskSummary> search(java.lang.String query)
query
- the search stringSearchResult
containing the TaskSummary
matching the querypublic com.netflix.conductor.common.run.SearchResult<com.netflix.conductor.common.run.TaskSummary> search(java.lang.Integer start, java.lang.Integer size, java.lang.String sort, java.lang.String freeText, java.lang.String query)
start
- start value of pagesize
- number of tasks to be returnedsort
- sort orderfreeText
- additional free text queryquery
- the search querySearchResult
containing the TaskSummary
that match the query