public class DefaultSchedulerService extends Object implements SchedulerService
SchedulerService interface. Provide service methods
for Scheduling tasks.| Constructor and Description |
|---|
DefaultSchedulerService(CommonApplicationProperties commonApplicationProperties,
TaskPlatform taskPlatform,
TaskDefinitionRepository taskDefinitionRepository,
AppRegistryService registry,
org.springframework.core.io.ResourceLoader resourceLoader,
TaskConfigurationProperties taskConfigurationProperties,
org.springframework.boot.autoconfigure.jdbc.DataSourceProperties dataSourceProperties,
String dataflowServerUri,
ApplicationConfigurationMetadataResolver metaDataResolver,
SchedulerServiceProperties schedulerServiceProperties,
org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService) |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.cloud.scheduler.spi.core.ScheduleInfo |
getSchedule(String scheduleName)
Retrieves the
ScheduleInfo for the specified ScheduleName. |
protected org.springframework.core.io.Resource |
getTaskResource(String taskDefinitionName) |
List<org.springframework.cloud.scheduler.spi.core.ScheduleInfo> |
list()
List all of the schedules registered with the system up to the
established maximum as specified
SchedulerServiceProperties.maxSchedulesReturned. |
org.springframework.data.domain.Page<org.springframework.cloud.scheduler.spi.core.ScheduleInfo> |
list(org.springframework.data.domain.Pageable pageable)
List all of the schedules registered with the system.
|
List<org.springframework.cloud.scheduler.spi.core.ScheduleInfo> |
list(org.springframework.data.domain.Pageable pageable,
String taskDefinitionName)
List all of the Schedules associated with the provided TaskDefinition.
|
List<org.springframework.cloud.scheduler.spi.core.ScheduleInfo> |
list(String taskDefinitionName)
List all of the Schedules associated with the provided TaskDefinition up to the
established maximum as specified
SchedulerServiceProperties.maxSchedulesReturned. |
void |
schedule(String scheduleName,
String taskDefinitionName,
Map<String,String> taskDeploymentProperties,
List<String> commandLineArgs)
Schedules the task specified with the taskDefinitionName with the
platform specific scheduler.
|
void |
unschedule(String scheduleName)
Unschedule a schedule that has been created.
|
public DefaultSchedulerService(CommonApplicationProperties commonApplicationProperties, TaskPlatform taskPlatform, TaskDefinitionRepository taskDefinitionRepository, AppRegistryService registry, org.springframework.core.io.ResourceLoader resourceLoader, TaskConfigurationProperties taskConfigurationProperties, org.springframework.boot.autoconfigure.jdbc.DataSourceProperties dataSourceProperties, String dataflowServerUri, ApplicationConfigurationMetadataResolver metaDataResolver, SchedulerServiceProperties schedulerServiceProperties, org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService)
public void schedule(String scheduleName, String taskDefinitionName, Map<String,String> taskDeploymentProperties, List<String> commandLineArgs)
SchedulerServiceschedule in interface SchedulerServicescheduleName - A name to be associated with the schedule.taskDefinitionName - the name of the
TaskDefinition to be scheduled.taskDeploymentProperties - properties required for scheduling or launching a task.commandLineArgs - the command line args to be used when launching the task.public void unschedule(String scheduleName)
SchedulerServiceunschedule in interface SchedulerServicescheduleName - the name of the schedule to be removed.public List<org.springframework.cloud.scheduler.spi.core.ScheduleInfo> list(org.springframework.data.domain.Pageable pageable, String taskDefinitionName)
SchedulerServicelist in interface SchedulerServicepageable - Establish the pagination setup for the result set.taskDefinitionName - to retrieve Schedules for a specified taskDefinitionName.public org.springframework.data.domain.Page<org.springframework.cloud.scheduler.spi.core.ScheduleInfo> list(org.springframework.data.domain.Pageable pageable)
SchedulerServicelist in interface SchedulerServicepageable - Establish the pagination setup for the result set.public List<org.springframework.cloud.scheduler.spi.core.ScheduleInfo> list(String taskDefinitionName)
SchedulerServiceSchedulerServiceProperties.maxSchedulesReturned.list in interface SchedulerServicetaskDefinitionName - to retrieve Schedules for a specified taskDefinitionName.public List<org.springframework.cloud.scheduler.spi.core.ScheduleInfo> list()
SchedulerServiceSchedulerServiceProperties.maxSchedulesReturned.list in interface SchedulerServicepublic org.springframework.cloud.scheduler.spi.core.ScheduleInfo getSchedule(String scheduleName)
SchedulerServiceScheduleInfo for the specified ScheduleName.getSchedule in interface SchedulerServicescheduleName - the name of schedule to retrieve.ScheduleInfo for the scheduleName passed in.protected org.springframework.core.io.Resource getTaskResource(String taskDefinitionName)
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.