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