public interface TaskExecutionDao
Modifier and Type | Method and Description |
---|---|
void |
completeTaskExecution(long executionId,
Integer exitCode,
Date endTime,
String exitMessage)
Update and existing
TaskExecution . |
void |
completeTaskExecution(long executionId,
Integer exitCode,
Date endTime,
String exitMessage,
String errorMessage)
Update and existing
TaskExecution to mark it as completed. |
TaskExecution |
createTaskExecution(String taskName,
Date startTime,
List<String> arguments,
String externalExecutionId)
Save a new
TaskExecution . |
TaskExecution |
createTaskExecution(String taskName,
Date startTime,
List<String> arguments,
String externalExecutionId,
Long parentExecutionId)
Save a new
TaskExecution . |
org.springframework.data.domain.Page<TaskExecution> |
findAll(org.springframework.data.domain.Pageable pageable)
Retrieves all the task executions within the pageable constraints.
|
org.springframework.data.domain.Page<TaskExecution> |
findRunningTaskExecutions(String taskName,
org.springframework.data.domain.Pageable pageable)
Retrieves a set of task executions that are running for a taskName.
|
org.springframework.data.domain.Page<TaskExecution> |
findTaskExecutionsByName(String taskName,
org.springframework.data.domain.Pageable pageable)
Retrieves a subset of task executions by task name, start location and size.
|
Set<Long> |
getJobExecutionIdsByTaskExecutionId(long taskExecutionId)
Returns the job execution ids associated with a task execution id.
|
TaskExecution |
getLatestTaskExecutionForTaskName(String taskName)
Returns the latest task execution for a given task name.
|
List<TaskExecution> |
getLatestTaskExecutionsByTaskNames(String... taskNames)
Returns a
List of the latest TaskExecution for 1 or more task
names. |
long |
getNextExecutionId()
Retrieves the next available execution id for a task execution.
|
long |
getRunningTaskExecutionCount()
Retrieves current number of task executions with an endTime of null.
|
long |
getRunningTaskExecutionCountByTaskName(String taskName)
Retrieves current number of task executions for a taskName and with an endTime of
null.
|
TaskExecution |
getTaskExecution(long executionId)
Retrieves a task execution from the task repository.
|
long |
getTaskExecutionCount()
Retrieves current number of task executions.
|
long |
getTaskExecutionCountByTaskName(String taskName)
Retrieves current number of task executions for a taskName.
|
Long |
getTaskExecutionIdByJobExecutionId(long jobExecutionId)
Returns the id of the TaskExecution that the requested Spring Batch job execution
was executed within the context of.
|
List<String> |
getTaskNames()
Retrieves a sorted list of distinct task names for the task executions.
|
TaskExecution |
startTaskExecution(long executionId,
String taskName,
Date startTime,
List<String> arguments,
String externalExecutionId)
Update and existing
TaskExecution to mark it as started. |
TaskExecution |
startTaskExecution(long executionId,
String taskName,
Date startTime,
List<String> arguments,
String externalExecutionId,
Long parentExecutionId)
Update and existing
TaskExecution to mark it as started. |
void |
updateExternalExecutionId(long taskExecutionId,
String externalExecutionId)
Updates the externalExecutionId for the execution id specified.
|
TaskExecution createTaskExecution(String taskName, Date startTime, List<String> arguments, String externalExecutionId)
TaskExecution
.taskName
- the name that associated with the task execution.startTime
- the time task began.arguments
- list of key/value pairs that configure the task.externalExecutionId
- id assigned to the task by the platformTaskExecution
instance.TaskExecution createTaskExecution(String taskName, Date startTime, List<String> arguments, String externalExecutionId, Long parentExecutionId)
TaskExecution
.taskName
- the name that associated with the task execution.startTime
- the time task began.arguments
- list of key/value pairs that configure the task.externalExecutionId
- id assigned to the task by the platformparentExecutionId
- the parent task execution id.TaskExecution
instance.TaskExecution startTaskExecution(long executionId, String taskName, Date startTime, List<String> arguments, String externalExecutionId)
TaskExecution
to mark it as started.executionId
- the id of the taskExecution to be updated.taskName
- the name that associated with the task execution.startTime
- the time task began.arguments
- list of key/value pairs that configure the task.externalExecutionId
- id assigned to the task by the platformTaskExecution startTaskExecution(long executionId, String taskName, Date startTime, List<String> arguments, String externalExecutionId, Long parentExecutionId)
TaskExecution
to mark it as started.executionId
- the id of the taskExecution to be updated.taskName
- the name that associated with the task execution.startTime
- the time task began.arguments
- list of key/value pairs that configure the task.externalExecutionId
- id assigned to the task by the platformparentExecutionId
- the parent task execution id.void completeTaskExecution(long executionId, Integer exitCode, Date endTime, String exitMessage, String errorMessage)
TaskExecution
to mark it as completed.executionId
- the id of the taskExecution to be updated.exitCode
- the status of the task upon completion.endTime
- the time the task completed.exitMessage
- the message assigned to the task upon completion.errorMessage
- error information available upon failure of a task.void completeTaskExecution(long executionId, Integer exitCode, Date endTime, String exitMessage)
TaskExecution
.executionId
- the id of the taskExecution to be updated.exitCode
- the status of the task upon completion.endTime
- the time the task completed.exitMessage
- the message assigned to the task upon completion.TaskExecution getTaskExecution(long executionId)
executionId
- the id associated with the task execution.long getTaskExecutionCountByTaskName(String taskName)
taskName
- the name of the task to search for in the repository.long getRunningTaskExecutionCountByTaskName(String taskName)
taskName
- the name of the task to search for in the repository.long getRunningTaskExecutionCount()
long getTaskExecutionCount()
org.springframework.data.domain.Page<TaskExecution> findRunningTaskExecutions(String taskName, org.springframework.data.domain.Pageable pageable)
taskName
- the name of the task to search for in the repository.pageable
- the constraints for the search.org.springframework.data.domain.Page<TaskExecution> findTaskExecutionsByName(String taskName, org.springframework.data.domain.Pageable pageable)
taskName
- the name of the task to search for in the repository.pageable
- the constraints for the search.List<String> getTaskNames()
org.springframework.data.domain.Page<TaskExecution> findAll(org.springframework.data.domain.Pageable pageable)
pageable
- the constraints for the searchlong getNextExecutionId()
Long getTaskExecutionIdByJobExecutionId(long jobExecutionId)
jobExecutionId
- the id of the JobExecutionTaskExecution
Set<Long> getJobExecutionIdsByTaskExecutionId(long taskExecutionId)
taskExecutionId
- id of the TaskExecution
Set
of the ids of the job executions executed within the
task.void updateExternalExecutionId(long taskExecutionId, String externalExecutionId)
taskExecutionId
- the execution id for the task to be updated.externalExecutionId
- the new externalExecutionId.List<TaskExecution> getLatestTaskExecutionsByTaskNames(String... taskNames)
List
of the latest TaskExecution
for 1 or more task
names.
Latest is defined by the most recent start time. A TaskExecution
does not
have to be finished (The results may including pending TaskExecution
s).
It is theoretically possible that a TaskExecution
with the same name to
have more than 1 TaskExecution
for the exact same start time. In that case
the TaskExecution
with the highest Task Execution ID is returned.
This method will not consider end times in its calculations. Thus, when a task
execution A
starts after task execution B
but finishes BEFORE task
execution A
, then task execution B
is being returned.taskNames
- At least 1 task name must be providedTaskExecution getLatestTaskExecutionForTaskName(String taskName)
getLatestTaskExecutionsByTaskNames(String...)
but will only return a single result.taskName
- Must not be null or emptygetLatestTaskExecutionsByTaskNames(String...)
Copyright © 2021 Pivotal Software, Inc.. All rights reserved.