@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(PropertyResolver propertyResolver,
LauncherRepository launcherRepository,
org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService,
org.springframework.cloud.dataflow.aggregate.task.TaskRepositoryContainer taskRepositoryContainer,
TaskExecutionInfoService taskExecutionInfoService,
TaskDeploymentRepository taskDeploymentRepository,
TaskDefinitionRepository taskDefinitionRepository,
org.springframework.cloud.dataflow.aggregate.task.TaskDefinitionReader taskDefinitionReader,
TaskExecutionCreationService taskExecutionRepositoryService,
TaskAppDeploymentRequestCreator taskAppDeploymentRequestCreator,
org.springframework.cloud.dataflow.aggregate.task.AggregateTaskExplorer taskExplorer,
DataflowTaskExecutionDaoContainer dataflowTaskExecutionDaoContainer,
DataflowTaskExecutionMetadataDaoContainer dataflowTaskExecutionMetadataDaoContainer,
org.springframework.cloud.dataflow.aggregate.task.DataflowTaskExecutionQueryDao dataflowTaskExecutionQueryDao,
org.springframework.cloud.common.security.core.support.OAuth2TokenUtilsService oauth2TokenUtilsService,
TaskSaveService taskSaveService,
TaskConfigurationProperties taskConfigurationProperties,
org.springframework.cloud.dataflow.aggregate.task.AggregateExecutionSupport aggregateExecutionSupport)
Deprecated.
|
DefaultTaskExecutionService(PropertyResolver propertyResolver,
LauncherRepository launcherRepository,
org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService,
org.springframework.cloud.dataflow.aggregate.task.TaskRepositoryContainer taskRepositoryContainer,
TaskExecutionInfoService taskExecutionInfoService,
TaskDeploymentRepository taskDeploymentRepository,
TaskDefinitionRepository taskDefinitionRepository,
org.springframework.cloud.dataflow.aggregate.task.TaskDefinitionReader taskDefinitionReader,
TaskExecutionCreationService taskExecutionRepositoryService,
TaskAppDeploymentRequestCreator taskAppDeploymentRequestCreator,
org.springframework.cloud.dataflow.aggregate.task.AggregateTaskExplorer taskExplorer,
DataflowTaskExecutionDaoContainer dataflowTaskExecutionDaoContainer,
DataflowTaskExecutionMetadataDaoContainer dataflowTaskExecutionMetadataDaoContainer,
org.springframework.cloud.dataflow.aggregate.task.DataflowTaskExecutionQueryDao dataflowTaskExecutionQueryDao,
org.springframework.cloud.common.security.core.support.OAuth2TokenUtilsService oauth2TokenUtilsService,
TaskSaveService taskSaveService,
TaskConfigurationProperties taskConfigurationProperties,
org.springframework.cloud.dataflow.aggregate.task.AggregateExecutionSupport aggregateExecutionSupport,
ComposedTaskRunnerConfigurationProperties composedTaskRunnerConfigurationProperties)
Initializes the
DefaultTaskExecutionService . |
Modifier and Type | Method and Description |
---|---|
LaunchResponse |
executeTask(String taskName,
Map<String,String> taskDeploymentProperties,
List<String> commandLineArgs)
Launch a task.
|
TaskManifest |
findTaskManifestById(Long id,
String schemaTarget)
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.
|
Integer |
getAllTaskExecutionsCount(boolean onlyCompleted,
String taskName,
Integer days)
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,
String schemaTarget)
Return the log content of the task execution identified by the given task deployment ID (external execution ID).
|
void |
setAutoCreateTaskDefinitions(boolean autoCreateTaskDefinitions) |
void |
stopTaskExecution(Set<Long> ids,
String schemaTarget)
Request the platform to stop the task executions for the ids provided.
|
void |
stopTaskExecution(Set<Long> ids,
String schemaTarget,
String platform)
Request the platform to stop the task executions for the ids provided.
|
protected void |
updateExternalExecutionId(long executionId,
String taskLaunchId,
String schemaTarget) |
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(PropertyResolver propertyResolver, LauncherRepository launcherRepository, org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService, org.springframework.cloud.dataflow.aggregate.task.TaskRepositoryContainer taskRepositoryContainer, TaskExecutionInfoService taskExecutionInfoService, TaskDeploymentRepository taskDeploymentRepository, TaskDefinitionRepository taskDefinitionRepository, org.springframework.cloud.dataflow.aggregate.task.TaskDefinitionReader taskDefinitionReader, TaskExecutionCreationService taskExecutionRepositoryService, TaskAppDeploymentRequestCreator taskAppDeploymentRequestCreator, org.springframework.cloud.dataflow.aggregate.task.AggregateTaskExplorer taskExplorer, DataflowTaskExecutionDaoContainer dataflowTaskExecutionDaoContainer, DataflowTaskExecutionMetadataDaoContainer dataflowTaskExecutionMetadataDaoContainer, org.springframework.cloud.dataflow.aggregate.task.DataflowTaskExecutionQueryDao dataflowTaskExecutionQueryDao, org.springframework.cloud.common.security.core.support.OAuth2TokenUtilsService oauth2TokenUtilsService, TaskSaveService taskSaveService, TaskConfigurationProperties taskConfigurationProperties, org.springframework.cloud.dataflow.aggregate.task.AggregateExecutionSupport aggregateExecutionSupport)
DefaultTaskExecutionService
.propertyResolver
- the spring application contextlauncherRepository
- the repository of task launcher used to launch task apps.auditRecordService
- the audit record servicetaskRepositoryContainer
- the container of repositories to use for accessing and updating task executionstaskExecutionInfoService
- the service used to setup a task executiontaskDeploymentRepository
- the repository to track task deploymenttaskDefinitionRepository
- the repository to query the task definitiontaskDefinitionReader
- use task definition repository to retrieve definitiontaskExecutionRepositoryService
- the service used to create the task executiontaskAppDeploymentRequestCreator
- the task app deployment request creatortaskExplorer
- the task explorerdataflowTaskExecutionDaoContainer
- the dataflow task execution daodataflowTaskExecutionMetadataDaoContainer
- repository used to manipulate task manifestsdataflowTaskExecutionQueryDao
- repository to query aggregate TaskExecution dataoauth2TokenUtilsService
- the oauth2 token servertaskSaveService
- the task save servicetaskConfigurationProperties
- task configuration properties.aggregateExecutionSupport
- support for selecting SchemaVersionTargetpublic DefaultTaskExecutionService(PropertyResolver propertyResolver, LauncherRepository launcherRepository, org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService, org.springframework.cloud.dataflow.aggregate.task.TaskRepositoryContainer taskRepositoryContainer, TaskExecutionInfoService taskExecutionInfoService, TaskDeploymentRepository taskDeploymentRepository, TaskDefinitionRepository taskDefinitionRepository, org.springframework.cloud.dataflow.aggregate.task.TaskDefinitionReader taskDefinitionReader, TaskExecutionCreationService taskExecutionRepositoryService, TaskAppDeploymentRequestCreator taskAppDeploymentRequestCreator, org.springframework.cloud.dataflow.aggregate.task.AggregateTaskExplorer taskExplorer, DataflowTaskExecutionDaoContainer dataflowTaskExecutionDaoContainer, DataflowTaskExecutionMetadataDaoContainer dataflowTaskExecutionMetadataDaoContainer, org.springframework.cloud.dataflow.aggregate.task.DataflowTaskExecutionQueryDao dataflowTaskExecutionQueryDao, org.springframework.cloud.common.security.core.support.OAuth2TokenUtilsService oauth2TokenUtilsService, TaskSaveService taskSaveService, TaskConfigurationProperties taskConfigurationProperties, org.springframework.cloud.dataflow.aggregate.task.AggregateExecutionSupport aggregateExecutionSupport, ComposedTaskRunnerConfigurationProperties composedTaskRunnerConfigurationProperties)
DefaultTaskExecutionService
.propertyResolver
- the spring application contextlauncherRepository
- the repository of task launcher used to launch task apps.auditRecordService
- the audit record servicetaskRepositoryContainer
- the container of repositories to use for accessing and updating task executionstaskExecutionInfoService
- the task execution info servicetaskDeploymentRepository
- the repository to track task deploymenttaskDefinitionRepository
- the repository to query the task definitiontaskDefinitionReader
- uses task definition repository to retrieve definitiontaskExecutionRepositoryService
- the service used to create the task executiontaskAppDeploymentRequestCreator
- the task app deployment request creatortaskExplorer
- the task explorerdataflowTaskExecutionDaoContainer
- the dataflow task execution daodataflowTaskExecutionMetadataDaoContainer
- repository used to manipulate task manifestsdataflowTaskExecutionQueryDao
- repository to query aggregate task execution data.oauth2TokenUtilsService
- the oauth2 token servertaskSaveService
- the task save servicetaskConfigurationProperties
- task configuration propertiesaggregateExecutionSupport
- support for selecting SchemaVersionTarget.composedTaskRunnerConfigurationProperties
- properties used to configure the composed task runnerpublic LaunchResponse 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, String schemaTarget)
getLog
in interface TaskExecutionService
platformName
- the platformtaskId
- the deploymentID (externalExecutionId) associated with the task execution.public void stopTaskExecution(Set<Long> ids, String schemaTarget)
TaskExecutionService
stopTaskExecution
in interface TaskExecutionService
ids
- a set of ids for the task executions to be stopped.public void stopTaskExecution(Set<Long> ids, String schemaTarget, String platform)
TaskExecutionService
stopTaskExecution
in interface TaskExecutionService
ids
- a set of ids for the task executions to be stopped.schemaTarget
- the schema target of the task execution.platform
- The name of the platform where the tasks are executing.public TaskManifest findTaskManifestById(Long id, String schemaTarget)
TaskExecutionService
findTaskManifestById
in interface TaskExecutionService
id
- task exectution idschemaTarget
- the schema target of the task execution.TaskManifest
or null if not found.public void setAutoCreateTaskDefinitions(boolean autoCreateTaskDefinitions)
protected void updateExternalExecutionId(long executionId, String taskLaunchId, String schemaTarget)
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
- whether to include only completed task executionstaskName
- the task name, if null then retrieve all the taskspublic Integer getAllTaskExecutionsCount(boolean onlyCompleted, String taskName, Integer days)
TaskExecutionService
getAllTaskExecutionsCount
in interface TaskExecutionService
onlyCompleted
- whether to include only completed task executions (ignored when includeTasksEndedMinDaysAgo
is specified)taskName
- the task name, if null then retrieve all the tasksdays
- only include tasks that have ended at least this many days agoCopyright © 2024 Pivotal Software, Inc.. All rights reserved.