com.sas.hls.schedule
Interface ScheduleService


public interface ScheduleService

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


Method Summary
 Schedule createSchedule(String name, String description, Schedulable schedulable, ScheduleTrigger trigger)
          Creates a schedule that will run the job specified in the scheduleable at the specified time(s) defined in the trigger
 void deleteSchedule(ScheduleDescriptor schedule)
          Deletes the specified schedule
 Set<ScheduleDescriptor> getAllSchedules()
          Get all schedules defined in the system.
 Schedule getScheduleByDescriptor(ScheduleDescriptor schedule)
          Get the full client representation of a schedule from their scheduleDescriptor.
 Set<ScheduleDescriptor> getSchedulesForCurrentUser()
          Get all schedules defined in the system for the current user.
 void pauseSchedule(ScheduleDescriptor schedule)
          Pauses the specified schedule.
 void resumeSchedule(ScheduleDescriptor schedule)
          Resumes the specified schedule
 Schedule updateSchedule(Schedule schedule)
          Updates the specified schedule
 

Method Detail

createSchedule

Schedule createSchedule(String name,
                        String description,
                        Schedulable schedulable,
                        ScheduleTrigger trigger)
                        throws ScheduleException
Creates a schedule that will run the job specified in the scheduleable at the specified time(s) defined in the trigger

Parameters:
name - The name of the schedule.
description - The description of the schedule. This value is not required and can be null.
schedulable - Represents the item to run when the schedule fires.
trigger - The mechanism by which the job specified in the Schedulable is scheduled
Returns:
The newly created schedule
Throws:
ScheduleException - Thrown when the schedule cannot be created.

updateSchedule

Schedule updateSchedule(Schedule schedule)
                        throws ScheduleException,
                               ScheduleNotFoundException
Updates the specified schedule

Parameters:
schedule - The schedule in which to update
Returns:
The newly updated schedule
Throws:
ScheduleException - Thrown when the schedule cannot be updated.
ScheduleNotFoundException - Thrown when the schedule cannot be found.

deleteSchedule

void deleteSchedule(ScheduleDescriptor schedule)
                    throws ScheduleException,
                           ScheduleNotFoundException
Deletes the specified schedule

Parameters:
schedule - The schedule to be deleted
Throws:
ScheduleException - Thrown when the schedule cannot be deleted.
ScheduleNotFoundException - Thrown when the schedule cannot be found.

getScheduleByDescriptor

Schedule getScheduleByDescriptor(ScheduleDescriptor schedule)
                                 throws ScheduleException,
                                        ScheduleNotFoundException
Get the full client representation of a schedule from their scheduleDescriptor.

Parameters:
schedule - - The scheduleDescriptor of the Schedule to be retrieved.
Returns:
The full client representation of the scheduleDescriptor.
Throws:
ScheduleException - Thrown when the schedule cannot be retrieved.
ScheduleNotFoundException - Thrown when the schedule cannot be found.

getAllSchedules

Set<ScheduleDescriptor> getAllSchedules()
                                        throws ScheduleException
Get all schedules defined in the system. Requires the current user to have the Manage All Schedules privilege.

Returns:
The set of scheduleDescriptor objects for all schedules in the system.
Throws:
ScheduleException - Thrown when all schedules cannot be retrieved.

getSchedulesForCurrentUser

Set<ScheduleDescriptor> getSchedulesForCurrentUser()
                                                   throws ScheduleException
Get all schedules defined in the system for the current user. Requires the current user to 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 cannot be retrieved.

pauseSchedule

void pauseSchedule(ScheduleDescriptor schedule)
                   throws ScheduleException,
                          ScheduleNotFoundException
Pauses the specified schedule.

Parameters:
schedule - The schedule to be paused.
Throws:
ScheduleException - Thrown when the schedule cannot be paused.
ScheduleNotFoundException - Thrown when the schedule cannot be found.

resumeSchedule

void resumeSchedule(ScheduleDescriptor schedule)
                    throws ScheduleException,
                           ScheduleNotFoundException
Resumes the specified schedule

Parameters:
schedule - The schedule to be resumed.
Throws:
ScheduleException - Thrown when the schedule cannot be resumed.
ScheduleNotFoundException - Thrown when the schedule cannot be found.


Copyright (c) 2012, SAS Institute Inc., Cary, NC, USA