org.springframework.cloud.dataflow.server.service.impl

## Class DefaultSchedulerService

- java.lang.Object
- - org.springframework.cloud.dataflow.server.service.impl.DefaultSchedulerService

- All Implemented Interfaces:
    SchedulerService

      public class DefaultSchedulerService
      extends Object
      implements SchedulerService

  Default implementation of the `SchedulerService` interface. Provide service methods for Scheduling tasks.
  Author:
    Glenn Renfro, Chris Schaefer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultSchedulerService(CommonApplicationProperties commonApplicationProperties, List<TaskPlatform> taskPlatforms, 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)` Deprecated.
    `DefaultSchedulerService(CommonApplicationProperties commonApplicationProperties, List<TaskPlatform> taskPlatforms, 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, ComposedTaskRunnerConfigurationProperties composedTaskRunnerConfigurationProperties)` Constructor for DefaultSchedulerService

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo` | `getSchedule(String scheduleName)` Retrieves the `ScheduleInfo` for the specified ScheduleName from the default platform.
    `org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo` | `getSchedule(String scheduleName, String platformName)` Retrieves the `ScheduleInfo` for the specified ScheduleName.
    `protected org.springframework.core.io.Resource` | `getTaskResource(String taskDefinitionName)`
    `List<org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo>` | `list()` List all of the schedules registered with the default platform up to the established maximum as specified `SchedulerServiceProperties.maxSchedulesReturned`.
    `org.springframework.data.domain.Page<org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo>` | `list(org.springframework.data.domain.Pageable pageable)` List all of the schedules registered with the default platform.
    `org.springframework.data.domain.Page<org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo>` | `list(org.springframework.data.domain.Pageable pageable, String platformName)` List all of the schedules registered with the system.
    `List<org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo>` | `list(org.springframework.data.domain.Pageable pageable, String taskDefinitionName, String platformName)` List all of the Schedules associated with the provided TaskDefinition.
    `List<org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo>` | `list(String taskDefinitionName)` List all of the Schedules associated with the provided TaskDefinition for the default platform up to the established maximum as specified `SchedulerServiceProperties.maxSchedulesReturned`.
    `List<org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo>` | `list(String taskDefinitionName, String platformName)` List all of the Schedules associated with the provided TaskDefinition up to the established maximum as specified `SchedulerServiceProperties.maxSchedulesReturned`.
    `List<org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo>` | `listForPlatform(String platformName)` List all of the schedules registered with the system 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 default platform specific scheduler.
    `void` | `schedule(String scheduleName, String taskDefinitionName, Map<String,String> taskDeploymentProperties, List<String> commandLineArgs, String platformName)` Schedules the task specified with the taskDefinitionName with the platform specific scheduler.
    `void` | `unschedule(String scheduleName)` Unschedule a schedule that has been created for the default platform.
    `void` | `unschedule(String scheduleName, String platformName)` Unschedule a schedule that has been created.
    `void` | `unscheduleForTaskDefinition(String taskDefinitionName)` Unschedule all schedules that have been created for this task definition name.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultSchedulerService

          @Deprecated
          public DefaultSchedulerService(CommonApplicationProperties commonApplicationProperties,
                                                     List<TaskPlatform> taskPlatforms,
                                                     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)

      Deprecated.
      Constructor for DefaultSchedulerService
      Parameters:
        `commonApplicationProperties` - common properties for applications deployed via Spring Cloud Data Flow.
        `taskPlatforms` - the `TaskPlatform`s for this service.
        `taskDefinitionRepository` - the `TaskDefinitionRepository` for this service.
        `registry` - the `AppRegistryService` for this service.
        `resourceLoader` - the `ResourceLoader` for this service.
        `taskConfigurationProperties` - the `TaskConfigurationProperties` for this service.
        `dataSourceProperties` - the `DataSourceProperties` for this service.
        `dataflowServerUri` - the Spring Cloud Data Flow uri for this service.
        `metaDataResolver` - the `ApplicationConfigurationMetadataResolver` for this service.
        `schedulerServiceProperties` - the `SchedulerServiceProperties` for this service.
        `auditRecordService` - the `AuditRecordService` for this service.

    - #### DefaultSchedulerService

          public DefaultSchedulerService(CommonApplicationProperties commonApplicationProperties,
                                         List<TaskPlatform> taskPlatforms,
                                         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,
                                         ComposedTaskRunnerConfigurationProperties composedTaskRunnerConfigurationProperties)

      Constructor for DefaultSchedulerService
      Parameters:
        `commonApplicationProperties` - common properties for applications deployed via Spring Cloud Data Flow.
        `taskPlatforms` - the `TaskPlatform`s for this service.
        `taskDefinitionRepository` - the `TaskDefinitionRepository` for this service.
        `registry` - the `AppRegistryService` for this service.
        `resourceLoader` - the `ResourceLoader` for this service.
        `taskConfigurationProperties` - the `TaskConfigurationProperties` for this service.
        `dataSourceProperties` - the `DataSourceProperties` for this service.
        `dataflowServerUri` - the Spring Cloud Data Flow uri for this service.
        `metaDataResolver` - the `ApplicationConfigurationMetadataResolver` for this service.
        `schedulerServiceProperties` - the `SchedulerServiceProperties` for this service.
        `auditRecordService` - the `AuditRecordService` for this service.
        `composedTaskRunnerConfigurationProperties` - the `ComposedTaskRunnerConfigurationProperties` for this service

  - ### Method Detail

    - #### schedule

          public void schedule(String scheduleName,
                               String taskDefinitionName,
                               Map<String,String> taskDeploymentProperties,
                               List<String> commandLineArgs)

      Description copied from interface: `SchedulerService`
      Schedules the task specified with the taskDefinitionName with the default 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.
      Specified by:
        `schedule` in interface `SchedulerService`
      Parameters:
        `scheduleName` - 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.

    - #### schedule

          public void schedule(String scheduleName,
                               String taskDefinitionName,
                               Map<String,String> taskDeploymentProperties,
                               List<String> commandLineArgs,
                               String platformName)

      Description copied from interface: `SchedulerService`
      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.
      Specified by:
        `schedule` in interface `SchedulerService`
      Parameters:
        `scheduleName` - 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.
        `platformName` - the name of the platform where the schedule should be created.

    - #### unschedule

          public void unschedule(String scheduleName,
                                 String platformName)

      Description copied from interface: `SchedulerService`
      Unschedule a schedule that has been created.
      Specified by:
        `unschedule` in interface `SchedulerService`
      Parameters:
        `scheduleName` - the name of the schedule to be removed.
        `platformName` - the name of the platform from where the schedule will be destroyed.

    - #### unschedule

          public void unschedule(String scheduleName)

      Description copied from interface: `SchedulerService`
      Unschedule a schedule that has been created for the default platform.
      Specified by:
        `unschedule` in interface `SchedulerService`
      Parameters:
        `scheduleName` - the name of the schedule to be removed.

    - #### unscheduleForTaskDefinition

          public void unscheduleForTaskDefinition(String taskDefinitionName)

      Description copied from interface: `SchedulerService`
      Unschedule all schedules that have been created for this task definition name.
      Specified by:
        `unscheduleForTaskDefinition` in interface `SchedulerService`
      Parameters:
        `taskDefinitionName` - the name of the task definition.

    - #### list

          public List<org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo> list(org.springframework.data.domain.Pageable pageable,
                                                                                          String taskDefinitionName,
                                                                                          String platformName)

      Description copied from interface: `SchedulerService`
      List all of the Schedules associated with the provided TaskDefinition.
      Specified by:
        `list` in interface `SchedulerService`
      Parameters:
        `pageable` - Establish the pagination setup for the result set.
        `taskDefinitionName` - to retrieve Schedules for a specified taskDefinitionName.
        `platformName` - name of platform from which the schedules will be retrieved.
      Returns:
        A List of Schedules configured for the provided taskDefinitionName.

    - #### list

          public org.springframework.data.domain.Page<org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo> list(org.springframework.data.domain.Pageable pageable,
                                                                                                                          String platformName)

      Description copied from interface: `SchedulerService`
      List all of the schedules registered with the system.
      Specified by:
        `list` in interface `SchedulerService`
      Parameters:
        `pageable` - Establish the pagination setup for the result set.
        `platformName` - the name of the platform where schedules will be obtained.
      Returns:
        Paged items of schedules.

    - #### list

          public org.springframework.data.domain.Page<org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo> list(org.springframework.data.domain.Pageable pageable)

      Description copied from interface: `SchedulerService`
      List all of the schedules registered with the default platform.
      Specified by:
        `list` in interface `SchedulerService`
      Parameters:
        `pageable` - Establish the pagination setup for the result set.
      Returns:
        Paged items of schedules.

    - #### list

          public List<org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo> list(String taskDefinitionName,
                                                                                          String platformName)

      Description copied from interface: `SchedulerService`
      List all of the Schedules associated with the provided TaskDefinition up to the established maximum as specified `SchedulerServiceProperties.maxSchedulesReturned`.
      Specified by:
        `list` in interface `SchedulerService`
      Parameters:
        `taskDefinitionName` - to retrieve Schedules for a specified taskDefinitionName.
        `platformName` - the name of the platform where schedules will be retrieved.
      Returns:
        A List of Schedules configured for the provided taskDefinitionName.

    - #### list

          public List<org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo> list(String taskDefinitionName)

      Description copied from interface: `SchedulerService`
      List all of the Schedules associated with the provided TaskDefinition for the default platform up to the established maximum as specified `SchedulerServiceProperties.maxSchedulesReturned`.
      Specified by:
        `list` in interface `SchedulerService`
      Parameters:
        `taskDefinitionName` - to retrieve Schedules for a specified taskDefinitionName.
      Returns:
        A List of Schedules configured for the provided taskDefinitionName.

    - #### listForPlatform

          public List<org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo> listForPlatform(String platformName)

      Description copied from interface: `SchedulerService`
      List all of the schedules registered with the system up to the established maximum as specified `SchedulerServiceProperties.maxSchedulesReturned`.
      Specified by:
        `listForPlatform` in interface `SchedulerService`
      Parameters:
        `platformName` - the name for the platform where schedules will be retrieved.
      Returns:
        A List of Schedules for the given system.

    - #### list

          public List<org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo> list()

      Description copied from interface: `SchedulerService`
      List all of the schedules registered with the default platform up to the established maximum as specified `SchedulerServiceProperties.maxSchedulesReturned`.
      Specified by:
        `list` in interface `SchedulerService`
      Returns:
        A List of Schedules for the given system.

    - #### getSchedule

          public org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo getSchedule(String scheduleName,
                                                                                           String platformName)

      Description copied from interface: `SchedulerService`
      Retrieves the `ScheduleInfo` for the specified ScheduleName.
      Specified by:
        `getSchedule` in interface `SchedulerService`
      Parameters:
        `scheduleName` - the name of schedule to retrieve.
        `platformName` - the name of the platform where this schedule will be obtained.
      Returns:
        `ScheduleInfo` for the scheduleName passed in.

    - #### getSchedule

          public org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo getSchedule(String scheduleName)

      Description copied from interface: `SchedulerService`
      Retrieves the `ScheduleInfo` for the specified ScheduleName from the default platform.
      Specified by:
        `getSchedule` in interface `SchedulerService`
      Parameters:
        `scheduleName` - the name of schedule to retrieve.
      Returns:
        `ScheduleInfo` for the scheduleName passed in.

    - #### getTaskResource

          protected org.springframework.core.io.Resource getTaskResource(String taskDefinitionName)

Copyright © 2021 Pivotal Software, Inc.. All rights reserved.