public JobState(int state) { setState(state); }
public JobState(TriggerState state) { setQuartzState(state); }
/** * Retrieve the job's status of a given {@link com.xpn.xwiki.plugin.scheduler.SchedulerPlugin#XWIKI_JOB_CLASS} job * XObject, by asking the actual job status to the quartz scheduler instance. It's the actual status, as the one * stored in the XObject may be changed manually by users. * * @param object the XObject to give the status of * @return the status of the Job inside the quartz scheduler, as {@link com.xpn.xwiki.plugin.scheduler.JobState} * instance */ public JobState getJobStatus(BaseObject object, XWikiContext context) throws SchedulerException { int state = getScheduler().getTriggerState(getObjectUniqueId(object, context), Scheduler.DEFAULT_GROUP); return new JobState(state); }
/** * Return the trigger state of the given {@link com.xpn.xwiki.plugin.scheduler.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 * * @param object the XObject job to give the state of * @return a String representing this state */ public String getStatus(Object object) { try { return getJobStatus(object.getXWikiObject()).getValue(); } catch (Exception e) { this.context.put("error", e.getMessage()); return null; } }
switch (status.getQuartzState()) { case PAUSED:
switch (status.getState()) { case Trigger.STATE_PAUSED:
/** * Retrieve the job's status of a given {@link com.xpn.xwiki.plugin.scheduler.SchedulerPlugin#XWIKI_JOB_CLASS} job * XObject, by asking the actual job status to the quartz scheduler instance. It's the actual status, as the one * stored in the XObject may be changed manually by users. * * @param object the XObject to give the status of * @return the status of the Job inside the quartz scheduler, as {@link com.xpn.xwiki.plugin.scheduler.JobState} * instance */ public JobState getJobStatus(BaseObject object, XWikiContext context) throws SchedulerException { TriggerState state = getScheduler().getTriggerState(new TriggerKey(getObjectUniqueId(object, context))); return new JobState(state); }
/** * Return the trigger state of the given {@link com.xpn.xwiki.plugin.scheduler.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 * * @param object the XObject job to give the state of * @return a String representing this state */ public String getStatus(Object object) { try { return getJobStatus(object.getXWikiObject()).getValue(); } catch (Exception e) { this.context.put("error", e.getMessage()); return null; } }
@Deprecated public JobState(int state) { setState(state); }