Package com.sas.lsaf.schedule

## Interface ScheduleService

-     public interface ScheduleService

  The service to manage the life cycle of a schedule. The user must have the Manage My Schedules or Manage All Schedules privilege to use these methods.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Schedule` | `createSchedule​(java.lang.String name, java.lang.String description, Schedulable schedulable, ScheduleTrigger trigger)` | Creates a schedule that runs the job that is specified in the schedulable at the time that is defined in the trigger.
    `void` | `deleteSchedule​(java.lang.String id)` | Deletes the schedule
    `java.util.Set<ScheduleDescriptor>` | `getAllSchedules()` | Gets all of the schedules defined in the system.
    `java.util.Set<ScheduleDescriptor>` | `getCurrentUserSchedules()` | Gets all of the schedules defined in the system for the current user.
    `Schedule` | `getSchedule​(java.lang.String id)` | Gets the full client representation of a schedule for the specified identifier.
    `boolean` | `isRepositoryJobScheduled​(java.lang.String jobPath)` | Indicates whether any schedules for the repository job exist.
    `boolean` | `isWorkspaceJobScheduled​(java.lang.String jobPath)` | Indicates whether any schedules for the workspace job exist.
    `void` | `pauseSchedule​(java.lang.String id)` | Pauses the schedule.
    `void` | `resumeSchedule​(java.lang.String id)` | Resumes the schedule
    `boolean` | `scheduleExists​(java.lang.String scheduleName)` | Indicates whether the schedule with the name exists.
    `Schedule` | `updateSchedule​(Schedule schedule)` | Updates the schedule

- - ### Method Detail

    - #### createSchedule

          Schedule createSchedule​(java.lang.String name,
                                  java.lang.String description,
                                  Schedulable schedulable,
                                  ScheduleTrigger trigger)
                           throws ScheduleException

      Creates a schedule that runs the job that is specified in the schedulable at the time that is defined in the trigger.
      Parameters:
        `name` - the name of the schedule.
        `description` - the description of the schedule. This value can be null.
        `schedulable` - the job to run when the schedule is triggered.
        `trigger` - the mechanism by which the job that is specified in the Schedulable is scheduled.
      Returns:
        the created schedule.
      Throws:
        `ScheduleException` - Thrown when the schedule is not created.

    - #### updateSchedule

          Schedule updateSchedule​(Schedule schedule)
                           throws ScheduleException,
                                  ScheduleNotFoundException

      Updates the schedule
      Parameters:
        `schedule` - the schedule.
      Returns:
        The updated schedule.
      Throws:
        `ScheduleException` - Thrown when the schedule is not updated.
        `ScheduleNotFoundException` - Thrown when the schedule is not found.

    - #### deleteSchedule

          void deleteSchedule​(java.lang.String id)
                       throws ScheduleException,
                              ScheduleNotFoundException

      Deletes the schedule
      Parameters:
        `id` - the schedule.
      Throws:
        `ScheduleException` - Thrown when the schedule is not deleted.
        `ScheduleNotFoundException` - Thrown when the schedule is not found.

    - #### getSchedule

          Schedule getSchedule​(java.lang.String id)
                        throws ScheduleException,
                               ScheduleNotFoundException

      Gets the full client representation of a schedule for the specified identifier.
      Parameters:
        `id` - the identifier of the schedule to be retrieved.
      Returns:
        The full client representation of the schedule.
      Throws:
        `ScheduleException` - Thrown when the schedule is not retrieved.
        `ScheduleNotFoundException` - Thrown when the schedule is not found.

    - #### getAllSchedules

          java.util.Set<ScheduleDescriptor> getAllSchedules()
                                                     throws ScheduleException

      Gets all of the schedules defined in the system. This method requires the current user have the Manage All Schedules privilege.
      Returns:
        The set of scheduleDescriptor objects for all of the schedules in the system.
      Throws:
        `ScheduleException` - Thrown when all schedules is not retrieved.

    - #### getCurrentUserSchedules

          java.util.Set<ScheduleDescriptor> getCurrentUserSchedules()
                                                             throws ScheduleException

      Gets all of the schedules defined in the system for the current user. This method requires the current user have the Manage My Schedules or the Manage All Schedules privilege.
      Returns:
        The set of scheduleDescriptor objects for all of the current user's schedules in the system.
      Throws:
        `ScheduleException` - Thrown when the schedules is not retrieved.

    - #### pauseSchedule

          void pauseSchedule​(java.lang.String id)
                      throws ScheduleException,
                             ScheduleNotFoundException

      Pauses the schedule.
      Parameters:
        `id` - the schedule to pause.
      Throws:
        `ScheduleException` - Thrown when the schedule is not paused.
        `ScheduleNotFoundException` - Thrown when the schedule is not found.

    - #### resumeSchedule

          void resumeSchedule​(java.lang.String id)
                       throws ScheduleException,
                              ScheduleNotFoundException

      Resumes the schedule
      Parameters:
        `id` - The schedule to resume.
      Throws:
        `ScheduleException` - Thrown when the schedule is not resumed.
        `ScheduleNotFoundException` - Thrown when the schedule is not found.

    - #### scheduleExists

          boolean scheduleExists​(java.lang.String scheduleName)

      Indicates whether the schedule with the name exists. If the current user does not have the Manage All Schedules privilege, this method will always return false for schedules not owned by the current user. If the current user has only the Manage My Schedules privilege, only schedules owned by the current user with the specified name will return true. Neither schedule privilege will mean this method always returns false.
      Parameters:
        `scheduleName` - the schedule name.

    - #### isRepositoryJobScheduled

          boolean isRepositoryJobScheduled​(java.lang.String jobPath)

      Indicates whether any schedules for the repository job exist. This method requires the current user have the Manage All Schedules privilege.
      Parameters:
        `jobPath` - the path of the job in the repository.

    - #### isWorkspaceJobScheduled

          boolean isWorkspaceJobScheduled​(java.lang.String jobPath)
                                   throws ScheduleException

      Indicates whether any schedules for the workspace job exist. This method requires the current user have the Manage All Schedules privilege.
      Parameters:
        `jobPath` - the path of the job in the workspace.
      Throws:
        `ScheduleException` - Thrown when schedules is not retrieved because of insufficient privilege.