|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.xpn.xwiki.api.Api
com.xpn.xwiki.plugin.PluginApi<SchedulerPlugin>
com.xpn.xwiki.plugin.scheduler.SchedulerPluginApi
public class SchedulerPluginApi
A Scheduler plugin to plan execution of Jobs from XWiki with cron expressions. The plugin uses Quartz's scheduling library.
Jobs are represented byObject XObjects, instances of the
SchedulerPlugin.XWIKI_JOB_CLASS XClass. These XObjects do store a job name, the implementation class name of
the job to be executed, the cron expression to precise when the job should be fired, and possibly a groovy script
with the job's program. The plugin offers a GroovyJob Groovy Job wrapper to execute groovy scripts
(typically for use inside the Wiki), but can also be used with any Java class implementing Job
| Field Summary |
|---|
| Fields inherited from class com.xpn.xwiki.api.Api |
|---|
context |
| Constructor Summary | |
|---|---|
SchedulerPluginApi(SchedulerPlugin plugin,
com.xpn.xwiki.XWikiContext context)
|
|
| Method Summary | |
|---|---|
JobState |
getJobStatus(com.xpn.xwiki.objects.BaseObject object)
Return the trigger state as a $ JobState, that holds both the integer trigger's inner value of the state
and a String as a human readable representation of that state |
JobState |
getJobStatus(com.xpn.xwiki.api.Object object)
|
java.util.Date |
getNextFireTime(com.xpn.xwiki.objects.BaseObject object)
|
java.util.Date |
getNextFireTime(com.xpn.xwiki.api.Object object)
Give, for a XObject job in a JobState.STATE_NORMAL state, the next date at which the job will be
executed, according to its cron expression. |
java.lang.String |
getStatus(com.xpn.xwiki.api.Object object)
Return the trigger state of the given SchedulerPlugin.XWIKI_JOB_CLASS
XObject job. |
boolean |
pauseJob(com.xpn.xwiki.objects.BaseObject object)
|
boolean |
pauseJob(com.xpn.xwiki.api.Object object)
Pause the given XObject job by pausing all of its current triggers. |
boolean |
resumeJob(com.xpn.xwiki.objects.BaseObject object)
|
boolean |
resumeJob(com.xpn.xwiki.api.Object object)
Resume a XObject job that is in a JobState.STATE_PAUSED state. |
boolean |
scheduleJob(com.xpn.xwiki.objects.BaseObject object)
|
boolean |
scheduleJob(com.xpn.xwiki.api.Object object)
Schedule the given XObject to be executed according to its parameters. |
boolean |
scheduleJobs(com.xpn.xwiki.api.Document document)
Schedule all SchedulerPlugin.XWIKI_JOB_CLASS XObjects stored inside the
given Wiki document, according to each XObject own parameters. |
boolean |
unscheduleJob(com.xpn.xwiki.objects.BaseObject object)
|
boolean |
unscheduleJob(com.xpn.xwiki.api.Object object)
Unschedule a XObject job by deleting it from the jobs table. |
| Methods inherited from class com.xpn.xwiki.plugin.PluginApi |
|---|
getInternalPlugin, getPlugin, getProtectedPlugin, setPlugin |
| Methods inherited from class com.xpn.xwiki.api.Api |
|---|
checkProgrammingRights, getXWikiContext, hasAccessLevel, hasAdminRights, hasProgrammingRights |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SchedulerPluginApi(SchedulerPlugin plugin,
com.xpn.xwiki.XWikiContext context)
| Method Detail |
|---|
public java.lang.String getStatus(com.xpn.xwiki.api.Object object)
SchedulerPlugin.XWIKI_JOB_CLASS
XObject job. Possible values are : None (the trigger does not exists yet, or has been deleted), Normal, Blocked,
Complete, Error and Paused
object - the XObject job to give the state of
public JobState getJobStatus(com.xpn.xwiki.objects.BaseObject object)
throws org.quartz.SchedulerException,
SchedulerPluginException
JobState, that holds both the integer trigger's inner value of the state
and a String as a human readable representation of that state
org.quartz.SchedulerException
SchedulerPluginException
public JobState getJobStatus(com.xpn.xwiki.api.Object object)
throws org.quartz.SchedulerException,
SchedulerPluginException
org.quartz.SchedulerException
SchedulerPluginExceptionpublic boolean scheduleJob(com.xpn.xwiki.api.Object object)
#if($xwiki.scheduler.scheduleJob($job)!=true)
#error($context.get("error") #else #info("Job scheduled") #end
Where $job is an XObject, instance of the SchedulerPlugin.XWIKI_JOB_CLASS XClass
object - the XObject to be scheduled, an instance of the XClass XWiki.SchedulerJobClass
public boolean scheduleJob(com.xpn.xwiki.objects.BaseObject object)
public boolean scheduleJobs(com.xpn.xwiki.api.Document document)
SchedulerPlugin.XWIKI_JOB_CLASS XObjects stored inside the
given Wiki document, according to each XObject own parameters.
document - the document holding the XObjects Jobs to be scheduled
public boolean pauseJob(com.xpn.xwiki.api.Object object)
scheduleJob(Object)
object - the wrapped XObject Job to be paused
public boolean pauseJob(com.xpn.xwiki.objects.BaseObject object)
public boolean resumeJob(com.xpn.xwiki.api.Object object)
JobState.STATE_PAUSED state. Can be called the same way as
scheduleJob(Object)
object - the wrapped XObject Job to be paused
public boolean resumeJob(com.xpn.xwiki.objects.BaseObject object)
public boolean unscheduleJob(com.xpn.xwiki.api.Object object)
scheduleJob(Object)
object - the wrapped XObject Job to be paused
public boolean unscheduleJob(com.xpn.xwiki.objects.BaseObject object)
public java.util.Date getNextFireTime(com.xpn.xwiki.api.Object object)
JobState.STATE_NORMAL state, the next date at which the job will be
executed, according to its cron expression. Errors are returned in the context map. Can be called for example:
#set($firetime = $xwiki.scheduler.getNextFireTime($job))
#if (!$firetime || $firetime=="") #error($context.get("error") #else #info("Fire time :
$firetime") #end
Where $job is an XObject, instance of the SchedulerPlugin.XWIKI_JOB_CLASS XClass
object - the wrapped XObject for which to give the fire date
public java.util.Date getNextFireTime(com.xpn.xwiki.objects.BaseObject object)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||