if (object.getStringValue("status").equals("Paused")) { getScheduler().pauseJob(new JobKey(xjob)); saveStatus("Paused", object, context); } else { saveStatus("Normal", object, context); LOGGER.debug("Schedule Job: [{}]", object.getStringValue("jobName")); getScheduler().scheduleJob(trigger); saveStatus("Normal", object, context); break;
/** * Unschedule the given job * * @param object the unwrapped XObject job to be unscheduled */ public void unscheduleJob(BaseObject object, XWikiContext context) throws SchedulerPluginException { try { getScheduler().deleteJob(getObjectUniqueId(object, context), Scheduler.DEFAULT_GROUP); saveStatus("None", object, context); } catch (SchedulerException e) { throw new SchedulerPluginException(SchedulerPluginException.ERROR_SCHEDULERPLUGIN_JOB_XCLASS_NOT_FOUND, "Error while unscheduling job " + object.getStringValue("jobName"), e); } catch (XWikiException e) { throw new SchedulerPluginException(SchedulerPluginException.ERROR_SCHEDULERPLUGIN_JOB_XCLASS_NOT_FOUND, "Error while saving status of job " + object.getStringValue("jobName"), e); } }
/** * Resume the job with the given name (un-pause) * * @param object the non-wrapped XObject Job to be resumed */ public void resumeJob(BaseObject object, XWikiContext context) throws SchedulerPluginException { try { getScheduler().resumeJob(getObjectUniqueId(object, context), Scheduler.DEFAULT_GROUP); saveStatus("Normal", object, context); } catch (SchedulerException e) { throw new SchedulerPluginException(SchedulerPluginException.ERROR_SCHEDULERPLUGIN_RESUME_JOB, "Error occured while trying to resume job " + object.getStringValue("jobName"), e); } catch (XWikiException e) { throw new SchedulerPluginException(SchedulerPluginException.ERROR_SCHEDULERPLUGIN_RESUME_JOB, "Error occured while trying to save status of job " + object.getStringValue("jobName"), e); } }
/** * Pause the job with the given name by pausing all of its current triggers. * * @param object the non-wrapped XObject Job to be paused */ public void pauseJob(BaseObject object, XWikiContext context) throws SchedulerPluginException { try { getScheduler().pauseJob(getObjectUniqueId(object, context), Scheduler.DEFAULT_GROUP); saveStatus("Paused", object, context); } catch (SchedulerException e) { throw new SchedulerPluginException(SchedulerPluginException.ERROR_SCHEDULERPLUGIN_PAUSE_JOB, "Error occured while trying to pause job " + object.getStringValue("jobName"), e); } catch (XWikiException e) { throw new SchedulerPluginException(SchedulerPluginException.ERROR_SCHEDULERPLUGIN_PAUSE_JOB, "Error occured while trying to save status of job " + object.getStringValue("jobName"), e); } }
if (object.getStringValue("status").equals("Paused")) { getScheduler().pauseJob(xjob, Scheduler.DEFAULT_GROUP); saveStatus("Paused", object, context); } else { saveStatus("Normal", object, context); LOG.debug("Schedule Job : " + object.getStringValue("jobName")); getScheduler().scheduleJob(trigger); saveStatus("Normal", object, context); break;
/** * Unschedule the given job * * @param object the unwrapped XObject job to be unscheduled */ public void unscheduleJob(BaseObject object, XWikiContext context) throws SchedulerPluginException { String job = getObjectUniqueId(object, context); try { getScheduler().deleteJob(new JobKey(job)); saveStatus("None", object, context); } catch (SchedulerException e) { throw new SchedulerPluginException(SchedulerPluginException.ERROR_SCHEDULERPLUGIN_JOB_XCLASS_NOT_FOUND, "Error while unscheduling job " + object.getStringValue("jobName"), e); } catch (XWikiException e) { throw new SchedulerPluginException(SchedulerPluginException.ERROR_SCHEDULERPLUGIN_JOB_XCLASS_NOT_FOUND, "Error while saving status of job " + object.getStringValue("jobName"), e); } }
/** * Pause the job with the given name by pausing all of its current triggers. * * @param object the non-wrapped XObject Job to be paused */ public void pauseJob(BaseObject object, XWikiContext context) throws SchedulerPluginException { String job = getObjectUniqueId(object, context); try { getScheduler().pauseJob(new JobKey(job)); saveStatus("Paused", object, context); } catch (SchedulerException e) { throw new SchedulerPluginException(SchedulerPluginException.ERROR_SCHEDULERPLUGIN_PAUSE_JOB, "Error occured while trying to pause job " + object.getStringValue("jobName"), e); } catch (XWikiException e) { throw new SchedulerPluginException(SchedulerPluginException.ERROR_SCHEDULERPLUGIN_PAUSE_JOB, "Error occured while trying to save status of job " + object.getStringValue("jobName"), e); } }
/** * Resume the job with the given name (un-pause) * * @param object the non-wrapped XObject Job to be resumed */ public void resumeJob(BaseObject object, XWikiContext context) throws SchedulerPluginException { String job = getObjectUniqueId(object, context); try { getScheduler().resumeJob(new JobKey(job)); saveStatus("Normal", object, context); } catch (SchedulerException e) { throw new SchedulerPluginException(SchedulerPluginException.ERROR_SCHEDULERPLUGIN_RESUME_JOB, "Error occured while trying to resume job " + object.getStringValue("jobName"), e); } catch (XWikiException e) { throw new SchedulerPluginException(SchedulerPluginException.ERROR_SCHEDULERPLUGIN_RESUME_JOB, "Error occured while trying to save status of job " + object.getStringValue("jobName"), e); } }