Class TaskTemplate
java.lang.Object
org.springframework.cloud.dataflow.rest.client.TaskTemplate
- All Implemented Interfaces:
TaskOperations
Implementation for
TaskOperations
.- Author:
- Glenn Renfro, Michael Minella, Gunnar Hillert, David Turanski, Corneil du Plessis
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanup
(long id) Cleanup any resources associated with the execution for the id specified.void
cleanup
(long id, boolean removeData) Cleanup any resources associated with the execution for the id specified.void
cleanupAllTaskExecutions
(boolean completed, String taskName) Cleanup any resources associated with the matching task executions.Create a new task definitionReturn information including the count of currently executing tasks and task execution limits.void
Destroy an existing task.void
Destroy an existing task with the flag to cleanup task resources.void
Destroy all existing tasks.executionListByTaskName
(String taskName) List task executions known to the system filtered by task name.getAllTaskExecutionsCount
(boolean completed, String taskName) Get the task executions count with the option to filter only the completed task executions.Launch an already created task.list()
void
Request the stop of a groupTaskExecution
s.void
Request the stop of a groupTaskExecution
s.taskExecutionLog
(String externalExecutionId) Return the task execution log.taskExecutionLog
(String externalExecutionId, String platform) Return the task execution log.taskExecutionStatus
(long id) Return theTaskExecutionResource
for the id specified.org.springframework.hateoas.PagedModel<TaskExecutionThinResource>
org.springframework.hateoas.PagedModel<TaskExecutionThinResource>
thinExecutionListByTaskName
(String taskName) List task executions filtered by task name.validateTaskDefinition
(String taskDefinitionName) Return the validation status for the tasks in an definition.
-
Method Details
-
list
- Specified by:
list
in interfaceTaskOperations
- Returns:
- the list tasks known to the system.
-
listPlatforms
- Specified by:
listPlatforms
in interfaceTaskOperations
- Returns:
- the list of platform accounts for tasks.
-
create
Description copied from interface:TaskOperations
Create a new task definition- Specified by:
create
in interfaceTaskOperations
- Parameters:
name
- the name of the taskdefinition
- the task definition DSLdescription
- the description of the task definition- Returns:
- the task definition
-
launch
public LaunchResponseResource launch(String name, Map<String, String> properties, List<String> arguments) Description copied from interface:TaskOperations
Launch an already created task.- Specified by:
launch
in interfaceTaskOperations
- Parameters:
name
- the name of the taskproperties
- the deployment propertiesarguments
- the command line arguments- Returns:
- long containing the TaskExecutionId
-
stop
Description copied from interface:TaskOperations
Request the stop of a groupTaskExecution
s.- Specified by:
stop
in interfaceTaskOperations
- Parameters:
ids
- comma delimited set ofTaskExecution
ids to stop.
-
stop
Description copied from interface:TaskOperations
Request the stop of a groupTaskExecution
s.- Specified by:
stop
in interfaceTaskOperations
- Parameters:
ids
- comma delimited set ofTaskExecution
ids to stop.platform
- the platform name where the task is executing.
-
destroy
Description copied from interface:TaskOperations
Destroy an existing task.- Specified by:
destroy
in interfaceTaskOperations
- Parameters:
name
- the name of the task
-
destroy
Description copied from interface:TaskOperations
Destroy an existing task with the flag to cleanup task resources.- Specified by:
destroy
in interfaceTaskOperations
- Parameters:
name
- the name of the taskcleanup
- flag indicates task execution cleanup
-
destroyAll
public void destroyAll()Description copied from interface:TaskOperations
Destroy all existing tasks.- Specified by:
destroyAll
in interfaceTaskOperations
-
executionList
- Specified by:
executionList
in interfaceTaskOperations
- Returns:
- the list task executions known to the system.
-
thinExecutionList
- Specified by:
thinExecutionList
in interfaceTaskOperations
- Returns:
- the list of thin task executions known to the system.
-
thinExecutionListByTaskName
public org.springframework.hateoas.PagedModel<TaskExecutionThinResource> thinExecutionListByTaskName(String taskName) Description copied from interface:TaskOperations
List task executions filtered by task name.- Specified by:
thinExecutionListByTaskName
in interfaceTaskOperations
- Returns:
- the page of task executions for the given task name.
-
executionListByTaskName
Description copied from interface:TaskOperations
List task executions known to the system filtered by task name.- Specified by:
executionListByTaskName
in interfaceTaskOperations
- Parameters:
taskName
- of the executions.- Returns:
- the paged list of task executions for the given task name
-
taskExecutionStatus
Description copied from interface:TaskOperations
Return theTaskExecutionResource
for the id specified.- Specified by:
taskExecutionStatus
in interfaceTaskOperations
- Parameters:
id
- identifier of the task execution- Returns:
TaskExecutionResource
-
taskExecutionLog
Description copied from interface:TaskOperations
Return the task execution log. The platform from which to retrieve the log will be set todefault
.- Specified by:
taskExecutionLog
in interfaceTaskOperations
- Parameters:
externalExecutionId
- the external execution identifier of the task execution.- Returns:
String
containing the log.
-
taskExecutionLog
Description copied from interface:TaskOperations
Return the task execution log.- Specified by:
taskExecutionLog
in interfaceTaskOperations
- Parameters:
externalExecutionId
- the external execution identifier of the task execution.platform
- the platform from which to obtain the log.- Returns:
String
containing the log.
-
currentTaskExecutions
Description copied from interface:TaskOperations
Return information including the count of currently executing tasks and task execution limits.- Specified by:
currentTaskExecutions
in interfaceTaskOperations
- Returns:
- Collection of
CurrentTaskExecutionsResource
-
cleanup
public void cleanup(long id) Description copied from interface:TaskOperations
Cleanup any resources associated with the execution for the id specified.- Specified by:
cleanup
in interfaceTaskOperations
- Parameters:
id
- identifier of the task execution
-
cleanup
public void cleanup(long id, boolean removeData) Description copied from interface:TaskOperations
Cleanup any resources associated with the execution for the id specified.- Specified by:
cleanup
in interfaceTaskOperations
- Parameters:
id
- identifier of the task executionremoveData
- delete the history of the execution
-
cleanupAllTaskExecutions
Description copied from interface:TaskOperations
Cleanup any resources associated with the matching task executions.- Specified by:
cleanupAllTaskExecutions
in interfaceTaskOperations
- Parameters:
completed
- cleanup only completed task executionstaskName
- the name of the task to cleanup, if null then all the tasks are considered.
-
getAllTaskExecutionsCount
Description copied from interface:TaskOperations
Get the task executions count with the option to filter only the completed task executions.- Specified by:
getAllTaskExecutionsCount
in interfaceTaskOperations
- Parameters:
completed
- cleanup only completed task executionstaskName
- the name of the task to cleanup, if null then all the tasks are considered.- Returns:
- the number of task executions.
-
validateTaskDefinition
public TaskAppStatusResource validateTaskDefinition(String taskDefinitionName) throws OperationNotSupportedException Description copied from interface:TaskOperations
Return the validation status for the tasks in an definition.- Specified by:
validateTaskDefinition
in interfaceTaskOperations
- Parameters:
taskDefinitionName
- The name of the task definition to be validated.- Returns:
TaskAppStatusResource
containing the task app statuses.- Throws:
OperationNotSupportedException
- if the server does not support task validation
-