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 Details

    • createSchedule

      Schedule createSchedule(String name, 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

      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(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

      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

      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

      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(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(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(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(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(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.