@Transactional public class DefaultTaskService extends Object implements TaskService
TaskService
interface. Provide service methods
for Tasks.Constructor and Description |
---|
DefaultTaskService(org.springframework.boot.autoconfigure.jdbc.DataSourceProperties dataSourceProperties,
TaskDefinitionRepository taskDefinitionRepository,
org.springframework.cloud.task.repository.TaskExplorer taskExplorer,
org.springframework.cloud.task.repository.TaskRepository taskExecutionRepository,
AppRegistryCommon registry,
org.springframework.core.io.ResourceLoader resourceLoader,
org.springframework.cloud.deployer.spi.task.TaskLauncher taskLauncher,
ApplicationConfigurationMetadataResolver metaDataResolver,
TaskConfigurationProperties taskConfigurationProperties,
DeploymentIdRepository deploymentIdRepository,
String dataflowServerUri,
CommonApplicationProperties commonApplicationProperties)
Initializes the
DefaultTaskService . |
Modifier and Type | Method and Description |
---|---|
void |
cleanupExecution(long id)
Cleanup the resources that resulted from running the task with the given execution id.
|
void |
deleteTaskDefinition(String name)
Destroy the task definition.
|
long |
executeTask(String taskName,
Map<String,String> taskDeploymentProperties,
List<String> commandLineArgs)
Execute a task with the provided task name and optional runtime properties.
|
boolean |
isComposedDefinition(String dsl)
Determines if the DSL is a composed DSL definition.
|
void |
saveTaskDefinition(String name,
String dsl)
Saves the task definition.
|
public DefaultTaskService(org.springframework.boot.autoconfigure.jdbc.DataSourceProperties dataSourceProperties, TaskDefinitionRepository taskDefinitionRepository, org.springframework.cloud.task.repository.TaskExplorer taskExplorer, org.springframework.cloud.task.repository.TaskRepository taskExecutionRepository, AppRegistryCommon registry, org.springframework.core.io.ResourceLoader resourceLoader, org.springframework.cloud.deployer.spi.task.TaskLauncher taskLauncher, ApplicationConfigurationMetadataResolver metaDataResolver, TaskConfigurationProperties taskConfigurationProperties, DeploymentIdRepository deploymentIdRepository, String dataflowServerUri, CommonApplicationProperties commonApplicationProperties)
DefaultTaskService
.dataSourceProperties
- the data source properties.taskDefinitionRepository
- the TaskDefinitionRepository
this service will
use for task CRUD operations.taskExecutionRepository
- the repository this service will use for deployment IDs.taskExplorer
- the explorer this service will use to lookup task executionsregistry
- URI registry this service will use to look up app URIs.resourceLoader
- the ResourceLoader
that will resolve URIs to
Resource
s.taskLauncher
- the launcher this service will use to launch task apps.metaDataResolver
- the metadata resolvertaskConfigurationProperties
- the properties used to define the behavior of tasksdeploymentIdRepository
- the repository that maps deployment keys to IDsdataflowServerUri
- the data flow server URIcommonApplicationProperties
- the common application propertiespublic long executeTask(String taskName, Map<String,String> taskDeploymentProperties, List<String> commandLineArgs)
TaskService
executeTask
in interface TaskService
taskName
- Name of the task. Must not be null or empty.taskDeploymentProperties
- Optional deployment properties. Must not be null.commandLineArgs
- Optional runtime commandline argumentspublic boolean isComposedDefinition(String dsl)
TaskService
isComposedDefinition
in interface TaskService
dsl
- the Task DSL to evaluatepublic void cleanupExecution(long id)
TaskService
cleanupExecution
in interface TaskService
id
- the execution id@Transactional public void saveTaskDefinition(String name, String dsl)
TaskService
saveTaskDefinition
in interface TaskService
name
- The name of the task.dsl
- The dsl that comprises the task.public void deleteTaskDefinition(String name)
TaskService
deleteTaskDefinition
in interface TaskService
name
- The name of the task.Copyright © 2018 Pivotal Software, Inc.. All rights reserved.