Interface SchedulerOperations
- All Known Implementing Classes:
SchedulerTemplate
public interface SchedulerOperations
Interface defining operations available against schedules.
- Author:
- Glenn Renfro
-
Method Summary
Modifier and TypeMethodDescriptiongetSchedule
(String scheduleName) Retrieves theScheduleInfo
for the specified ScheduleName for the default platform.getSchedule
(String scheduleName, String platform) Retrieves theScheduleInfo
for the specified ScheduleName.org.springframework.hateoas.PagedModel<ScheduleInfoResource>
list()
List all of the Schedules for the default platform.org.springframework.hateoas.PagedModel<ScheduleInfoResource>
List all of the Schedules associated with the provided TaskDefinition for the default platform.org.springframework.hateoas.PagedModel<ScheduleInfoResource>
List all of the Schedules associated with the provided TaskDefinition.org.springframework.hateoas.PagedModel<ScheduleInfoResource>
listByPlatform
(String platform) List all of the schedules registered with the system.void
schedule
(String scheduleName, String taskDefinitionName, Map<String, String> taskProperties, List<String> commandLineArgs) Schedules the task specified with the taskDefinitionName with the default platform scheduler.void
schedule
(String scheduleName, String taskDefinitionName, Map<String, String> taskProperties, List<String> commandLineArgs, String platform) Schedules the task specified with the taskDefinitionName with the platform specific scheduler.void
unschedule
(String scheduleName) Unschedule a schedule that has been created on the default platform.void
unschedule
(String scheduleName, String platform) Unschedule a schedule that has been created.
-
Method Details
-
schedule
void schedule(String scheduleName, String taskDefinitionName, Map<String, String> taskProperties, List<String> commandLineArgs, String platform) Schedules the task specified with the taskDefinitionName with the platform specific scheduler. To setup the task with the scheduler set the properties required to process the schedule within the taskProperties map. Each scheduler property should be prefixed with "spring.cloud.scheduler.". The schedule expression (cron for example) are specified within the task properties using the "spring.cloud.scheduler.cron.expression" as the key and the associated value would be the cron expression to be used.- Parameters:
scheduleName
- A name to be associated with the schedule.taskDefinitionName
- the name of theTaskDefinition
to be scheduled.taskProperties
- properties required for scheduling or launching a task.commandLineArgs
- the command line args to be used when launching the task.platform
- the name of the platform where the schedule should be created. If left null or empty the default platform will be used.
-
schedule
void schedule(String scheduleName, String taskDefinitionName, Map<String, String> taskProperties, List<String> commandLineArgs) Schedules the task specified with the taskDefinitionName with the default platform scheduler. To setup the task with the scheduler set the properties required to process the schedule within the taskProperties map. Each scheduler property should be prefixed with "spring.cloud.scheduler.". The schedule expression (cron for example) are specified within the task properties using the "spring.cloud.scheduler.cron.expression" as the key and the associated value would be the cron expression to be used.- Parameters:
scheduleName
- A name to be associated with the schedule.taskDefinitionName
- the name of theTaskDefinition
to be scheduled.taskProperties
- properties required for scheduling or launching a task.commandLineArgs
- the command line args to be used when launching the task.
-
unschedule
Unschedule a schedule that has been created.- Parameters:
scheduleName
- the name of the schedule to be removed.platform
- the name of the platform where the schedule should be created. If left null or empty the default platform will be used.
-
unschedule
Unschedule a schedule that has been created on the default platform.- Parameters:
scheduleName
- the name of the schedule to be removed. If left null or empty and there is only one platform it will be used.
-
list
org.springframework.hateoas.PagedModel<ScheduleInfoResource> list(String taskDefinitionName, String platform) List all of the Schedules associated with the provided TaskDefinition.- Parameters:
taskDefinitionName
- to retrieve Schedules for a specified taskDefinitionName.platform
- the name of the platform where the schedule should be created. If left null or empty the default platform will be used.- Returns:
- A List of Schedules configured for the provided taskDefinitionName.
-
list
List all of the Schedules associated with the provided TaskDefinition for the default platform.- Parameters:
taskDefinitionName
- to retrieve Schedules for a specified taskDefinitionName.- Returns:
- A List of Schedules configured for the provided taskDefinitionName.
-
list
org.springframework.hateoas.PagedModel<ScheduleInfoResource> list()List all of the Schedules for the default platform.- Returns:
- A List of Schedules configured for the provided taskDefinitionName.
-
listByPlatform
List all of the schedules registered with the system.- Parameters:
platform
- the name of the platform where the schedule should be created. If left null or empty the default platform will be used.- Returns:
- A List of Schedules for the given system.
-
getSchedule
Retrieves theScheduleInfo
for the specified ScheduleName.- Parameters:
scheduleName
- the name of schedule to retrieve.platform
- the name of the platform where the schedule should be created. If left null or empty the default platform will be used.- Returns:
ScheduleInfo
for the scheduleName passed in.
-
getSchedule
Retrieves theScheduleInfo
for the specified ScheduleName for the default platform.- Parameters:
scheduleName
- the name of schedule to retrieve. If left null or empty and there is only one platform it will be used.- Returns:
ScheduleInfo
for the scheduleName passed in.
-