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
Modifier and TypeMethodDescriptioncreateSchedule(String name, 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.voiddeleteSchedule(String id) Deletes the scheduleGets all of the schedules defined in the system.Gets all of the schedules defined in the system for the current user.getSchedule(String id) Gets the full client representation of a schedule for the specified identifier.booleanisRepositoryJobScheduled(String jobPath) Indicates whether any schedules for the repository job exist.booleanisWorkspaceJobScheduled(String jobPath) Indicates whether any schedules for the workspace job exist.voidpauseSchedule(String id) Pauses the schedule.voidresumeSchedule(String id) Resumes the schedulebooleanscheduleExists(String scheduleName) Indicates whether the schedule with the name exists.updateSchedule(Schedule schedule) Updates the schedule
-
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
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
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
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
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
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
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
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
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.
-