|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pentaho.platform.scheduler2.quartz.QuartzScheduler
public class QuartzScheduler
A Quartz implementation of IScheduler
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.pentaho.platform.api.scheduler2.IScheduler |
---|
IScheduler.SchedulerStatus |
Field Summary | |
---|---|
static String |
RESERVEDMAPKEY_ACTIONCLASS
|
static String |
RESERVEDMAPKEY_ACTIONID
|
static String |
RESERVEDMAPKEY_ACTIONUSER
|
Constructor Summary | |
---|---|
QuartzScheduler()
|
|
QuartzScheduler(org.quartz.SchedulerFactory schedulerFactory)
|
Method Summary | |
---|---|
static ComplexJobTrigger |
createComplexTrigger(String cronExpression)
|
Job |
createJob(String jobName,
Class<? extends IAction> action,
Map<String,Serializable> jobParams,
JobTrigger trigger)
Schedules a job to be run at one or more times in the future. |
Job |
createJob(String jobName,
String actionId,
Map<String,Serializable> jobParams,
JobTrigger trigger)
|
Map<IScheduleSubject,ComplexJobTrigger> |
getAvailabilityWindows()
Gets the scheduler availability window for all subjects for whom a window has been set |
List<IJobResult> |
getJobHistory(String jobId)
Returns a history of the runs for a particular job. |
List<Job> |
getJobs(IJobFilter filter)
Lists currently scheduled jobs. |
Integer |
getMinScheduleInterval(IScheduleSubject subject)
Get the minimum time that must elapse between job runs. |
IScheduler.SchedulerStatus |
getStatus()
Returns the current scheduler status. |
ComplexJobTrigger |
getSubjectAvailabilityWindow(IScheduleSubject subject)
Gets the scheduler availability window to the specified subject |
void |
pause()
Pauses the entire scheduler, which prevents all scheduled jobs from running. |
void |
pauseJob(String jobId)
Prevents the specified job from running in the future. |
static String |
prettyPrintMap(Map<String,Serializable> map)
|
void |
removeJob(String jobId)
Removes the specified job from the list of scheduled jobs |
void |
resumeJob(String jobId)
Allows previously paused jobs to resume running in the future. |
void |
setAvailabilityWindows(Map<IScheduleSubject,ComplexJobTrigger> availability)
Replaces the scheduler availability map with the provided availability map. |
void |
setMinScheduleInterval(IScheduleSubject subject,
int intervalInSeconds)
Sets the minimum time that must elapse between runs of any jobs. |
void |
setQuartzSchedulerFactory(org.quartz.SchedulerFactory quartzSchedulerFactory)
Overrides the default Quartz SchedulerFactory . |
void |
setSubjectAvailabilityWindow(IScheduleSubject subject,
ComplexJobTrigger availability)
Sets when a particular subject is allowed to schedule jobs. |
void |
shutdown()
Shuts the scheduler down so it will process no more jobs. |
void |
start()
Allows the scheduler to process scheduled jobs. |
void |
updateJob(String jobId,
Map<String,Serializable> jobParams,
JobTrigger trigger)
Updates both the parameters and trigger to be used to execute an existing scheduled action. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String RESERVEDMAPKEY_ACTIONCLASS
public static final String RESERVEDMAPKEY_ACTIONUSER
public static final String RESERVEDMAPKEY_ACTIONID
Constructor Detail |
---|
public QuartzScheduler(org.quartz.SchedulerFactory schedulerFactory)
public QuartzScheduler()
Method Detail |
---|
public void setQuartzSchedulerFactory(org.quartz.SchedulerFactory quartzSchedulerFactory)
SchedulerFactory
. Note: depending on the type of
scheduler you are setting here, there may be initializing required prior to this
setter being called. Only the SchedulerFactory.getScheduler()
will be called later,
so the factory set here must already be in a state where that invocation will be successful.
quartzSchedulerFactory
- the quartz factory to use for generating scheduler instancespublic Job createJob(String jobName, String actionId, Map<String,Serializable> jobParams, JobTrigger trigger) throws SchedulerException
createJob
in interface IScheduler
SchedulerException
public Job createJob(String jobName, Class<? extends IAction> action, Map<String,Serializable> jobParams, JobTrigger trigger) throws SchedulerException
createJob
in interface IScheduler
jobName
- the user defined name for the jobaction
- the action to be run at the scheduled time(s)jobParams
- the parameters to be passed to the action when it runstrigger
- the time(s) at which to run the action
SchedulerException
- If the job could not be scheduledpublic void updateJob(String jobId, Map<String,Serializable> jobParams, JobTrigger trigger) throws SchedulerException
IScheduler
updateJob
in interface IScheduler
jobId
- the ID of an existing scheduled jobjobParams
- the parameters to be passed to the action when it runstrigger
- the time(s) at which to run the action
SchedulerException
- If the job could not be updatedpublic Map<IScheduleSubject,ComplexJobTrigger> getAvailabilityWindows()
getAvailabilityWindows
in interface IScheduler
public List<IJobResult> getJobHistory(String jobId)
getJobHistory
in interface IScheduler
jobId
- the job for which to query it's execution history
public List<Job> getJobs(IJobFilter filter) throws SchedulerException
getJobs
in interface IScheduler
filter
- the filter to use to determine which jobs to return. If null all scheduled
jobs are return.
SchedulerException
public Integer getMinScheduleInterval(IScheduleSubject subject)
getMinScheduleInterval
in interface IScheduler
subject
- the subject whose min interval is being requested
return the minimum interval or null if no interval has been setpublic ComplexJobTrigger getSubjectAvailabilityWindow(IScheduleSubject subject)
getSubjectAvailabilityWindow
in interface IScheduler
subject
- the subject whose window is being requested
public void pause() throws SchedulerException
pause
in interface IScheduler
SchedulerException
public void pauseJob(String jobId) throws SchedulerException
pauseJob
in interface IScheduler
jobId
- the job to be paused
SchedulerException
public void removeJob(String jobId) throws SchedulerException
removeJob
in interface IScheduler
jobId
- the job to be removed
SchedulerException
public void start() throws SchedulerException
start
in interface IScheduler
SchedulerException
public void resumeJob(String jobId) throws SchedulerException
resumeJob
in interface IScheduler
jobId
- the job to be resumed
SchedulerException
public void setAvailabilityWindows(Map<IScheduleSubject,ComplexJobTrigger> availability)
setAvailabilityWindows
in interface IScheduler
availability
- the new scheduler availability mappublic void setMinScheduleInterval(IScheduleSubject subject, int intervalInSeconds)
setMinScheduleInterval
in interface IScheduler
subject
- the subject to which the interval appliespublic void setSubjectAvailabilityWindow(IScheduleSubject subject, ComplexJobTrigger availability)
setSubjectAvailabilityWindow
in interface IScheduler
subject
- the subject to which the subject appliesavailability
- the window of time at which the scheduler is availablepublic static ComplexJobTrigger createComplexTrigger(String cronExpression)
public IScheduler.SchedulerStatus getStatus() throws SchedulerException
getStatus
in interface IScheduler
SchedulerException
public void shutdown() throws SchedulerException
shutdown
in interface IScheduler
SchedulerException
public static String prettyPrintMap(Map<String,Serializable> map)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |