Skip navigation links


oracle.iam.scheduler.api
Interface SchedulerService


public interface SchedulerService

Method Summary
 void addJob(JobDetails job)
          Adds the job that would be scheduled using the Scheduler Service
 void deleteJob(JobDetails job)
          Deletes the specified Job that has been registered with the Scheduler Service
 JobDetails[] deleteScheduledTask(java.lang.String taskName)
          Delete the Schedule task definition from the metadata repository.
 void deleteTrigger(java.lang.String job)
          Deletes the specified trigger that has been registered with a Job
 java.util.List getAllHistoryOfJob()
          Returns a run history of all the Jobs in the system
 JobDetails[] getAllJobDetails()
          Returns a list of Job-details for all the Jobs in the system
 java.lang.String[] getAllJobs()
          Returns a list of name of all the Scheduler Jobs
 JobHistory getHistoryOfJob(long jobHistoryID)
          Returns the details of the jobHitory for the jobHistoryID passed as a parameter
 java.util.List getHistoryOfJob(java.lang.String jobName)
          Lists the detail of the runs made for the specified schedule Job
 JobDetails getJobDetail(java.lang.String name)
          Returns the JobDetail for the specified job
 JobDetails[] getJobDetails(java.lang.String name)
          Searches the jobs with the specified search criteria.Wild card characters can be specified as the search criteria
 JobParameter getJobParameter(long id, java.lang.String parameterType)
          Returns the Resource Object with the whose ID specified in the parameter - Sanjeev
 JobParameter getJobParameter(java.lang.String name, java.lang.String parameterType)
          Returns the Resource Object with the name specified in the parameter - Sanjeev
 java.util.HashMap getJobParameters(java.lang.String searchCriteria, java.lang.String parameterType)
          Returns a HashMap of key and name of the Job Parameters
 java.lang.String[] getJobs(java.lang.String name)
          Searches the job with the specified name.Wild card characters can be specified as the search criteria
 JobDetails[] getJobsOfSchedulerTask(java.lang.String scheduleTaskName)
          Returns a list of the Job Details for all the jobs for the specified Task
 JobHistory getLastHistoryOfJob(java.lang.String name)
          Returns the details of the last job run for the Job specified
 java.lang.String[] getScheduledTasks(java.lang.String searchCriteria)
          Returns a list of Schedule Tasks which match the search criteria provided
 int getStatus()
          Returns the Scheduler Status
 int getStatusOfJob(java.lang.String jobName)
           
 Trigger[] getTriggersOfJob(java.lang.String jobName)
          It returns all the triggers attached to a schedule Job.
 java.util.HashMap listScheduledTasks()
          Returns a list of all the schedule tasks
 ScheduledTask lookupScheduledTask(java.lang.String name)
          Finds the Task that is specified as parameter
 void pauseJob(java.lang.String jobName)
          Pauses the action of the specified schedule Job
 void pauseTrigger(java.lang.String triggerName)
          Pauses the action of the running schedule task
 void rescheduleJob(java.lang.String name, java.lang.String existingTriggerName, Trigger trigger)
          Updates the trigger attached with the job
 void resetRunningJobStatus()
          This method is invoked prior to invocation shut down of scheduler service/shutdown of server This method reset the status of all the running jobs to stopped in job history table
 void resumeJob(java.lang.String jobName)
          Resumes the action of the paused schedule Job
 void scheduleJob(JobDetails job, Trigger trigger)
          Schedules the specified job as per the trigger details provided
 void scheduleJob(java.lang.String jobName, Trigger trigger)
          Schedules the specified job as per the trigger details provided
 java.util.HashMap searchJobs(SearchCriteria searchCriteria)
          Retrieves list of schedule Jobs based on the search criteria For specifying searchcriteria use jobname, taskname and status as parameters only By default, the results will be sorted based on id column Calls can be made in the following manner SearchCriteria sc1 = new SearchCriteria("jobName", jobname, SearchCriteria.Operator.EQUAL); SearchCriteria sc2 = new SearchCriteria("taskName", taskname, SearchCriteria.Operator.EQUAL); SearchCriteria sc3 = new SearchCriteria("status", status, SearchCriteria.Operator.EQUAL); SearchCriteria sc4 = new SearchCriteria(sc1, sc2, SearchCriteria.Operator.AND); SearchCriteria sc5 = new SearchCriteria(sc4, sc3, SearchCriteria.Operator.AND); long start=1, end=4; List<SearchResult> list = schedulerService.searchTemplate(sc5, start, end);
 void start()
          Starts the Scheduler Service
 void stop()
          Stops the Scheduler
 void stopJob(java.lang.String jobName)
          Stops the instance of the Job that is running
 void triggerNow(java.lang.String jobName)
          Runs the specified job
 void triggerNow(java.lang.String jobName, NowTrigger trigger)
          Runs the specified job at the current time
 void updateJob(JobDetails job)
          Updates the schedule Job that has been created.The update can either be for the job details or the job parameters.

 

Method Detail

start

void start()
           throws SchedulerException,
                  SchedulerAccessDeniedException
Starts the Scheduler Service
Throws:
SchedulerException
SchedulerAccessDeniedException

scheduleJob

void scheduleJob(JobDetails job,
                 Trigger trigger)
                 throws SchedulerException,
                        RequiredParameterNotSetException,
                        ParameterValueTypeNotSupportedException,
                        IncorrectScheduleTaskDefinationException,
                        SchedulerAccessDeniedException
Schedules the specified job as per the trigger details provided
Parameters:
Job - Detail of the job that is to be scheduled
trigger - Trigger Details to specify when the scheduled job will be triggered
Throws:
SchedulerException - is thrown when Job Parameters are not of one of the expected Data-Types
RequiredParameterNotSetException - This exception will be thrown if value is not set for required parameters of a schedule Job.
ParameterValueTypeNotSupported - Exception This exception will be thrown if value set for required parameters of a schedule Job is not supported in application. Only following type is supported String, Boolean & Long
IncorrectScheduleTaskDefination - Exception This exception will be thrown if SchedulerTask definition is not correct
SchedulerAccessDeniedException - This exception will be thrown if access permission for operation is not available to the user
ParameterValueTypeNotSupportedException
IncorrectScheduleTaskDefinationException

scheduleJob

void scheduleJob(java.lang.String jobName,
                 Trigger trigger)
                 throws SchedulerException,
                        oracle.iam.platform.kernel.StaleDataException,
                        SchedulerAccessDeniedException
Schedules the specified job as per the trigger details provided
Parameters:
jobName - Name of the job that is to be scheduled
trigger - Trigger Details to specify when the scheduled job will be triggered
Throws:
SchedulerException - when an error occurs at the Quartz Engine or scheduler is not running.
oracle.iam.platform.kernel.StaleDataException - This exception will be thrown if data is already updated
SchedulerAccessDeniedException - This exception will be thrown if access permission for operation is not available to the user

deleteJob

void deleteJob(JobDetails job)
               throws SchedulerException,
                      LastModifyDateNotSetException,
                      oracle.iam.platform.kernel.StaleDataException,
                      SchedulerAccessDeniedException,
                      SchedulerJobNotDeletableException
Deletes the specified Job that has been registered with the Scheduler Service
Parameters:
job - JobDetails of the job that is to be deleted.
Throws:
SchedulerException - when an error occurs at the Quartz Engine or scheduler is not running.
oracle.iam.platform.kernel.StaleDataException - This exception will be thrown if data is already updated
LastModifyDateNotSetException - This exception will be thrown if last modify date is not set for the object.
SchedulerAccessDeniedException - This exception will be thrown if access permission for operation is not available to the user
SchedulerJobNotDeletableException - This exception will be thrown if Schedule Job cannot be deleted because it is running.

deleteTrigger

void deleteTrigger(java.lang.String job)
                   throws SchedulerException,
                          SchedulerAccessDeniedException
Deletes the specified trigger that has been registered with a Job
Parameters:
jobName - name of job that has to be delete
Throws:
SchedulerException - when an error occurs at the Quartz Engine or scheduler is not running.
SchedulerAccessDeniedException - This exception will be thrown if access permission for operation is not available to the user

addJob

void addJob(JobDetails job)
            throws SchedulerException,
                   RequiredParameterNotSetException,
                   ParameterValueTypeNotSupportedException,
                   IncorrectScheduleTaskDefinationException,
                   SchedulerAccessDeniedException
Adds the job that would be scheduled using the Scheduler Service
Parameters:
job - JDetails of the job that is to be added.
Throws:
SchedulerException - when an error occurs at the Quartz Engine or scheduler is not running.
RequiredParameterNotSetException - This exception will be thrown if value is not set for required parameters of a schedule job.
ParameterValueTypeNotSupportedException - This exception will be thrown if value set for required parameters of a schedule job is not supported in application. Only following type is supported String, Boolean & Long
IncorrectScheduleTaskDefinationException - This exception will be thrown if SchedulerTask definition is not correct
SchedulerAccessDeniedException - This exception will be thrown if access permission for operation is not available to the user

updateJob

void updateJob(JobDetails job)
               throws SchedulerException,
                      RequiredParameterNotSetException,
                      ParameterValueTypeNotSupportedException,
                      IncorrectScheduleTaskDefinationException,
                      oracle.iam.platform.kernel.StaleDataException,
                      LastModifyDateNotSetException,
                      SchedulerAccessDeniedException
Updates the schedule Job that has been created.The update can either be for the job details or the job parameters.
Parameters:
job - JobDetails of the job (and or job parameters ) that is to be updated
Throws:
SchedulerException - when an error occurs at the Quartz Engine or scheduler is not running.
RequiredParameterNotSetException - This exception will be thrown if value is not set for required parameters of a schedule Job.
ParameterValueTypeNotSupportedException - This exception will be thrown if value set for required parameters of a schedule Job is not supported in application. Only following type is supported String, Boolean & Long
IncorrectScheduleTaskDefinationException - This exception will be thrown if SchedulerTask definition is not correct
oracle.iam.platform.kernel.StaleDataException - This exception will be thrown if data is already updated
LastModifyDateNotSetException - This exception will be thrown if last modify date is not set for the object.
SchedulerAccessDeniedException - This exception will be thrown if access permission for operation is not available to the user

triggerNow

void triggerNow(java.lang.String jobName)
                throws SchedulerException,
                       SchedulerAccessDeniedException
Runs the specified job
Parameters:
jobName - The job that is to be triggered
Throws:
SchedulerException - when an error occurs at the Quartz Engine or scheduler is not running.
SchedulerAccessDeniedException - This exception will be thrown if access permission for operation is not available to the user

triggerNow

void triggerNow(java.lang.String jobName,
                NowTrigger trigger)
                throws SchedulerException,
                       SchedulerAccessDeniedException
Runs the specified job at the current time
Parameters:
jobName - The job that is to be triggered
trigger - Trigger details for the execution of the specified job
Throws:
SchedulerException - when an error occurs at the Quartz Engine or scheduler is not running.
SchedulerAccessDeniedException - SchedulerAccessDeniedException This exception will be thrown if access permission for operation is not available to the user

stopJob

void stopJob(java.lang.String jobName)
             throws SchedulerException,
                    SchedulerAccessDeniedException
Stops the instance of the Job that is running
Parameters:
name - of the schedule Job
Throws:
SchedulerException - when an error occurs at the Quartz Engine or scheduler is not running.
SchedulerAccessDeniedException - This exception will be thrown if access permission for operation is not available to the user

getTriggersOfJob

Trigger[] getTriggersOfJob(java.lang.String jobName)
                           throws SchedulerException
It returns all the triggers attached to a schedule Job.
Parameters:
name - of the schedule Job
Returns:
The list of triggers attached with the specified Job
Throws:
SchedulerException - when an error occurs at the Quartz Engine or scheduler is not running.

rescheduleJob

void rescheduleJob(java.lang.String name,
                   java.lang.String existingTriggerName,
                   Trigger trigger)
                   throws SchedulerException,
                          LastModifyDateNotSetException,
                          oracle.iam.platform.kernel.StaleDataException,
                          SchedulerAccessDeniedException
Updates the trigger attached with the job
Parameters:
name - of the schedule Job
existingTriggerName - OLD Trigger Name that is to be replaced
trigger - New Trigger Details, set the lastModifyDate with the Date on which you are going to update
Throws:
SchedulerException - when an error occurs at the Quartz Engine or scheduler is not running.
oracle.iam.platform.kernel.StaleDataException - This exception will be thrown if data is already updated
LastModifyDateNotSetException - This exception will be thrown if last modify date is not set for the object.
SchedulerAccessDeniedException - This exception will be thrown if access permission for operation is not available to the user

getJobDetail

JobDetails getJobDetail(java.lang.String name)
                        throws SchedulerException
Returns the JobDetail for the specified job
Parameters:
name - of the Job
Returns:
Detail of the job which is specified as a parameter
Throws:
SchedulerException - when an error occurs at the Quartz Engine or scheduler is not running.

stop

void stop()
          throws SchedulerException,
                 SchedulerAccessDeniedException
Stops the Scheduler
Throws:
SchedulerException - when an error occurs at the Quartz Engine or scheduler is not running.
SchedulerAccessDeniedException - This exception will be thrown if access permission for operation is not available to the user

lookupScheduledTask

ScheduledTask lookupScheduledTask(java.lang.String name)
                                  throws IncorrectScheduleTaskDefinationException
Finds the Task that is specified as parameter
Parameters:
name - of the schedule task whose details are to be fetched
Returns:
The details of the task along with the Schedule task parameters for the task name passed
Throws:
IncorrectScheduleTaskDefinationException - This exception will be thrown if SchedulerTask definition is not correct

deleteScheduledTask

JobDetails[] deleteScheduledTask(java.lang.String taskName)
                                 throws SchedulerException,
                                        DeleteScheduleTaskDefinitionException,
                                        SchedulerAccessDeniedException,
                                        LastModifyDateNotSetException,
                                        oracle.iam.platform.kernel.StaleDataException,
                                        SchedulerJobNotDeletableException
Delete the Schedule task definition from the metadata repository. Before deleting the Schedule task definition, need to stop all the running jobs related to this schedule task and delete the same.
Parameters:
taskName - of the schedule task to be deleted
Returns:
if the schedule task exists in MDS for the given name, than returns List of the Job Details for all the jobs deleted against this schedule task. else returns null.
Throws:
SchedulerException - when an error occurs at the Quartz Engine or scheduler is not running.
DeleteScheduleTaskDefinationException - This exception will be thrown if MetaData repository throw any exception while deleting a Schedule task from MDS.
SchedulerAccessDeniedException - This exception will be thrown if access permission for operation is not available to the user.
LastModifyDateNotSetException - This exception will be thrown if last modify date is not set for the object.
oracle.iam.platform.kernel.StaleDataException - This exception will be thrown if data is already updated
SchedulerJobNotDeletableException - This exception will be thrown if Schedule Job cannot be deleted because it is running.
DeleteScheduleTaskDefinitionException

listScheduledTasks

java.util.HashMap listScheduledTasks()
                                     throws IncorrectScheduleTaskDefinationException
Returns a list of all the schedule tasks
Returns:
HashMap of all the schedule tasks
Throws:
IncorrectScheduleTaskDefinationException - This exception will be thrown if SchedulerTask definition is not correct

getAllJobs

java.lang.String[] getAllJobs()
                              throws SchedulerException
Returns a list of name of all the Scheduler Jobs
Returns:
list of name of all the Scheduler Jobs
Throws:
SchedulerException - when an error occurs at the Quartz Engine or scheduler is not running.

getJobs

java.lang.String[] getJobs(java.lang.String name)
                           throws SchedulerException
Searches the job with the specified name.Wild card characters can be specified as the search criteria
Parameters:
name - of the job that is to be searched
Returns:
A list of jobs that meet the search criteria
Throws:
SchedulerException - when an error occurs at the Quartz Engine or scheduler is not running.

getJobDetails

JobDetails[] getJobDetails(java.lang.String name)
                           throws SchedulerException
Searches the jobs with the specified search criteria.Wild card characters can be specified as the search criteria
Parameters:
search - criteria of the job that is to be searched
Returns:
A list of jobs that meet the search criteria
Throws:
SchedulerException - when an error occurs at the Quartz Engine or scheduler is not running.

getScheduledTasks

java.lang.String[] getScheduledTasks(java.lang.String searchCriteria)
                                     throws IncorrectScheduleTaskDefinationException
Returns a list of Schedule Tasks which match the search criteria provided
Parameters:
searchCriteria - using which schedule tasks are to be found
Returns:
List of Schedule Tasks that meet the search criteria
Throws:
IncorrectScheduleTaskDefinationException - This exception will be thrown if SchedulerTask definition is not correct

getStatusOfJob

int getStatusOfJob(java.lang.String jobName)
                   throws SchedulerException
Parameters:
JobName - whose status is to be fetched
Returns:
The integer value that maps to a status of the Scheduled Job '0' correspond to 'SHUTDOWN' '1' correspond to 'STARTED' '2' correspond to 'STOPPED' '3' correspond to 'NONE' '4' correspond to 'PAUSED' '5' correspond to 'RUNNING' '6' correspond to 'FAILED' '7' correspond to 'INTERRUPT'
Throws:
SchedulerException - when an error occurs at the Quartz Engine or scheduler is not running.

getHistoryOfJob

java.util.List getHistoryOfJob(java.lang.String jobName)
Lists the detail of the runs made for the specified schedule Job
Parameters:
name - of the Schedule Job whose RUN-history is to be fetched
Returns:
List of runs made for the specified Job

getAllHistoryOfJob

java.util.List getAllHistoryOfJob()
Returns a run history of all the Jobs in the system
Returns:
List of JobHistory for all the Jobs in the system

getLastHistoryOfJob

JobHistory getLastHistoryOfJob(java.lang.String name)
                               throws NoJobHistoryFoundException
Returns the details of the last job run for the Job specified
Parameters:
name - of the schedule Job whose history is to be retrieved
Returns:
JobHistory
Throws:
NoJobHistoryFoundException - when no history is available for the Job

getHistoryOfJob

JobHistory getHistoryOfJob(long jobHistoryID)
                           throws NoJobHistoryFoundException
Returns the details of the jobHitory for the jobHistoryID passed as a parameter
Parameters:
jobHistoryID - Id for which the details have to be fetched
Returns:
JobHistory
Throws:
NoJobHistoryFoundException

resumeJob

void resumeJob(java.lang.String jobName)
               throws SchedulerException,
                      SchedulerAccessDeniedException
Resumes the action of the paused schedule Job
Parameters:
name - of the schedule Job
Throws:
SchedulerException - when an error occurs at the Quartz Engine or scheduler is not running.
SchedulerAccessDeniedException - This exception will be thrown if access permission for operation is not available to the user

pauseJob

void pauseJob(java.lang.String jobName)
              throws SchedulerException,
                     SchedulerAccessDeniedException
Pauses the action of the specified schedule Job
Parameters:
name - of the schedule Job
Throws:
SchedulerException - when an error occurs at the Quartz Engine or scheduler is not running.
SchedulerAccessDeniedException - This exception will be thrown if access permission for operation is not available to the user

getJobsOfSchedulerTask

JobDetails[] getJobsOfSchedulerTask(java.lang.String scheduleTaskName)
                                    throws SchedulerException
Returns a list of the Job Details for all the jobs for the specified Task
Parameters:
scheduleTaskName - name of the schedule task
Returns:
List of the Job Details for all the jobs for the specified task
Throws:
SchedulerException - when an error occurs at the Quartz Engine or scheduler is not running.

getStatus

int getStatus()
Returns the Scheduler Status
Returns:
The Scheduler status

getAllJobDetails

JobDetails[] getAllJobDetails()
                              throws SchedulerException
Returns a list of Job-details for all the Jobs in the system
Returns:
A list of JobDetail object for all the Jobs present in the system
Throws:
SchedulerException - when an error occurs at the Quartz Engine or scheduler is not running.

getJobParameters

java.util.HashMap getJobParameters(java.lang.String searchCriteria,
                                   java.lang.String parameterType)
Returns a HashMap of key and name of the Job Parameters
Parameters:
searchCriteria. - This API allows passing wildcard, type of IT Resource type values etc as search criteria.
parameterType - type of parameter for e.g ITResource If a * is passed as SearchCriteria, API returns all the instances in the system.
Returns:
A HashMap<String,String> for all the ITResources present in the system

getJobParameter

JobParameter getJobParameter(long id,
                             java.lang.String parameterType)
                             throws JobParameterNotFoundException
Returns the Resource Object with the whose ID specified in the parameter - Sanjeev
Parameters:
id - of Resource
parameterType - type of parameter
Returns:
ITResource object of IT Resource
Throws:
JobParameterNotFoundException - if no IT Resource found against the lookup criteria

getJobParameter

JobParameter getJobParameter(java.lang.String name,
                             java.lang.String parameterType)
                             throws JobParameterNotFoundException
Returns the Resource Object with the name specified in the parameter - Sanjeev
Parameters:
name - of the JobParameter value
parameterType - type of parameter
Returns:
JobParameter object of JobParameter.
Throws:
JobParameterNotFoundException - if no IT Resource found against the lookup criteria

pauseTrigger

void pauseTrigger(java.lang.String triggerName)
                  throws SchedulerException,
                         SchedulerAccessDeniedException
Pauses the action of the running schedule task
Parameters:
triggerName - Name of the Trigger
Throws:
SchedulerException
SchedulerAccessDeniedException

searchJobs

java.util.HashMap searchJobs(SearchCriteria searchCriteria)
                             throws SchedulerException,
                                    SchedulerAccessDeniedException
Retrieves list of schedule Jobs based on the search criteria For specifying searchcriteria use jobname, taskname and status as parameters only By default, the results will be sorted based on id column Calls can be made in the following manner SearchCriteria sc1 = new SearchCriteria("jobName", jobname, SearchCriteria.Operator.EQUAL); SearchCriteria sc2 = new SearchCriteria("taskName", taskname, SearchCriteria.Operator.EQUAL); SearchCriteria sc3 = new SearchCriteria("status", status, SearchCriteria.Operator.EQUAL); SearchCriteria sc4 = new SearchCriteria(sc1, sc2, SearchCriteria.Operator.AND); SearchCriteria sc5 = new SearchCriteria(sc4, sc3, SearchCriteria.Operator.AND); long start=1, end=4; List<SearchResult> list = schedulerService.searchTemplate(sc5, start, end);
Returns:
A list of matching Jobs
Throws:
SchedulerException
SchedulerAccessDeniedException - Access related exception

resetRunningJobStatus

void resetRunningJobStatus()
                           throws SchedulerException,
                                  SchedulerAccessDeniedException
This method is invoked prior to invocation shut down of scheduler service/shutdown of server This method reset the status of all the running jobs to stopped in job history table
Throws:
SchedulerException
SchedulerAccessDeniedException

Skip navigation links


Copyright © 2010, Oracle and/or its affiliates. All rights reserved.