@Transactional public class DefaultTaskExecutionService extends Object implements TaskExecutionService
TaskExecutionService
interface. Provide service
methods for Tasks.Modifier and Type | Field and Description |
---|---|
protected org.springframework.cloud.dataflow.audit.service.AuditRecordService |
auditRecordService |
static String |
COMMAND_LINE_ARGS |
static String |
TASK_DEFINITION_DSL_TEXT |
static String |
TASK_DEPLOYMENT_PROPERTIES |
static String |
TASK_PLATFORM_NAME |
Constructor and Description |
---|
DefaultTaskExecutionService(LauncherRepository launcherRepository,
org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService,
org.springframework.cloud.task.repository.TaskRepository taskRepository,
TaskExecutionInfoService taskExecutionInfoService,
TaskDeploymentRepository taskDeploymentRepository,
TaskExecutionCreationService taskExecutionRepositoryService,
TaskAppDeploymentRequestCreator taskAppDeploymentRequestCreator,
org.springframework.cloud.task.repository.TaskExplorer taskExplorer,
DataflowTaskExecutionDao dataflowTaskExecutionDao,
DataflowTaskExecutionMetadataDao dataflowTaskExecutionMetadataDao,
org.springframework.cloud.common.security.core.support.OAuth2TokenUtilsService oauth2TokenUtilsService,
TaskSaveService taskSaveService,
TaskConfigurationProperties taskConfigurationProperties)
Deprecated.
|
DefaultTaskExecutionService(LauncherRepository launcherRepository,
org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService,
org.springframework.cloud.task.repository.TaskRepository taskRepository,
TaskExecutionInfoService taskExecutionInfoService,
TaskDeploymentRepository taskDeploymentRepository,
TaskExecutionCreationService taskExecutionRepositoryService,
TaskAppDeploymentRequestCreator taskAppDeploymentRequestCreator,
org.springframework.cloud.task.repository.TaskExplorer taskExplorer,
DataflowTaskExecutionDao dataflowTaskExecutionDao,
DataflowTaskExecutionMetadataDao dataflowTaskExecutionMetadataDao,
org.springframework.cloud.common.security.core.support.OAuth2TokenUtilsService oauth2TokenUtilsService,
TaskSaveService taskSaveService,
TaskConfigurationProperties taskConfigurationProperties,
ComposedTaskRunnerConfigurationProperties composedTaskRunnerConfigurationProperties)
Initializes the
DefaultTaskExecutionService . |
Modifier and Type | Method and Description |
---|---|
long |
executeTask(String taskName,
Map<String,String> taskDeploymentProperties,
List<String> commandLineArgs)
Launch a task.
|
TaskManifest |
findTaskManifestById(Long id)
Retrieve the TaskManifest for the execution id provided
|
Set<Long> |
getAllTaskExecutionIds(boolean onlyCompleted,
String taskName)
Returns all the task execution IDs with the option to include only the completed task executions.
|
Integer |
getAllTaskExecutionsCount(boolean onlyCompleted,
String taskName)
Returns the count of all the task execution IDs with the option to include only the completed task executions.
|
String |
getLog(String platformName,
String taskId)
Retrieve logs for the task application.
|
void |
setAutoCreateTaskDefinitions(boolean autoCreateTaskDefinitions) |
void |
stopTaskExecution(Set<Long> ids)
Request the platform to stop the task executions for the ids provided.
|
void |
stopTaskExecution(Set<Long> ids,
String platform)
Request the platform to stop the task executions for the ids provided.
|
protected void |
updateExternalExecutionId(long executionId,
String taskLaunchId) |
public static final String TASK_DEFINITION_DSL_TEXT
public static final String TASK_DEPLOYMENT_PROPERTIES
public static final String COMMAND_LINE_ARGS
public static final String TASK_PLATFORM_NAME
protected final org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService
@Deprecated public DefaultTaskExecutionService(LauncherRepository launcherRepository, org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService, org.springframework.cloud.task.repository.TaskRepository taskRepository, TaskExecutionInfoService taskExecutionInfoService, TaskDeploymentRepository taskDeploymentRepository, TaskExecutionCreationService taskExecutionRepositoryService, TaskAppDeploymentRequestCreator taskAppDeploymentRequestCreator, org.springframework.cloud.task.repository.TaskExplorer taskExplorer, DataflowTaskExecutionDao dataflowTaskExecutionDao, DataflowTaskExecutionMetadataDao dataflowTaskExecutionMetadataDao, org.springframework.cloud.common.security.core.support.OAuth2TokenUtilsService oauth2TokenUtilsService, TaskSaveService taskSaveService, TaskConfigurationProperties taskConfigurationProperties)
DefaultTaskExecutionService
.launcherRepository
- the repository of task launcher used to launch task apps.auditRecordService
- the audit record servicetaskRepository
- the repository to use for accessing and updating task executionstaskExecutionInfoService
- the task execution info servicetaskDeploymentRepository
- the repository to track task deploymenttaskExecutionInfoService
- the service used to setup a task executiontaskExecutionRepositoryService
- the service used to create the task executiontaskAppDeploymentRequestCreator
- the task app deployment request creatortaskExplorer
- the task explorerdataflowTaskExecutionDao
- the dataflow task execution daodataflowTaskExecutionMetadataDao
- repository used to manipulate task manifestsoauth2TokenUtilsService
- the oauth2 token servertaskSaveService
- the task save servicepublic DefaultTaskExecutionService(LauncherRepository launcherRepository, org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService, org.springframework.cloud.task.repository.TaskRepository taskRepository, TaskExecutionInfoService taskExecutionInfoService, TaskDeploymentRepository taskDeploymentRepository, TaskExecutionCreationService taskExecutionRepositoryService, TaskAppDeploymentRequestCreator taskAppDeploymentRequestCreator, org.springframework.cloud.task.repository.TaskExplorer taskExplorer, DataflowTaskExecutionDao dataflowTaskExecutionDao, DataflowTaskExecutionMetadataDao dataflowTaskExecutionMetadataDao, org.springframework.cloud.common.security.core.support.OAuth2TokenUtilsService oauth2TokenUtilsService, TaskSaveService taskSaveService, TaskConfigurationProperties taskConfigurationProperties, ComposedTaskRunnerConfigurationProperties composedTaskRunnerConfigurationProperties)
DefaultTaskExecutionService
.launcherRepository
- the repository of task launcher used to launch task apps.auditRecordService
- the audit record servicetaskRepository
- the repository to use for accessing and updating task executionstaskExecutionInfoService
- the task execution info servicetaskDeploymentRepository
- the repository to track task deploymenttaskExecutionInfoService
- the service used to setup a task executiontaskExecutionRepositoryService
- the service used to create the task executiontaskAppDeploymentRequestCreator
- the task app deployment request creatortaskExplorer
- the task explorerdataflowTaskExecutionDao
- the dataflow task execution daodataflowTaskExecutionMetadataDao
- repository used to manipulate task manifestsoauth2TokenUtilsService
- the oauth2 token servertaskSaveService
- the task save servicecomposedTaskRunnerConfigurationProperties
- properties used to configure the composed task runnerpublic long executeTask(String taskName, Map<String,String> taskDeploymentProperties, List<String> commandLineArgs)
executeTask
in interface TaskExecutionService
taskName
- Name of the task definition or registered task application.
If a task definition does not exist, one will be created if `autoCreateTask-Definitions` is true. Must not be null or empty.taskDeploymentProperties
- Optional deployment properties. Must not be null.commandLineArgs
- Optional runtime commandline argumentpublic String getLog(String platformName, String taskId)
TaskExecutionService
getLog
in interface TaskExecutionService
platformName
- the name of the platformtaskId
- the ID that uniquely identifies the taskpublic void stopTaskExecution(Set<Long> ids)
TaskExecutionService
stopTaskExecution
in interface TaskExecutionService
ids
- a set of ids for the task executions to be stopped.public void stopTaskExecution(Set<Long> ids, String platform)
TaskExecutionService
stopTaskExecution
in interface TaskExecutionService
ids
- a set of ids for the task executions to be stopped.platform
- The name of the platform where the tasks are executing.public TaskManifest findTaskManifestById(Long id)
TaskExecutionService
findTaskManifestById
in interface TaskExecutionService
id
- task exectution idTaskManifest
or null if not found.public void setAutoCreateTaskDefinitions(boolean autoCreateTaskDefinitions)
protected void updateExternalExecutionId(long executionId, String taskLaunchId)
public Set<Long> getAllTaskExecutionIds(boolean onlyCompleted, String taskName)
TaskExecutionService
getAllTaskExecutionIds
in interface TaskExecutionService
onlyCompleted
- filter by completed task executionstaskName
- the task name, if null then retrieve all the taskspublic Integer getAllTaskExecutionsCount(boolean onlyCompleted, String taskName)
TaskExecutionService
getAllTaskExecutionsCount
in interface TaskExecutionService
onlyCompleted
- filter by completed task executionstaskName
- the task name, if null then retrieve all the tasksCopyright © 2022 Pivotal Software, Inc.. All rights reserved.