/** * Set the identity of the Job which should be fired by the produced * Trigger - a <code>JobKey</code> will be produced with the given * name and default group. * * @param jobName the name of the job (in default group) to fire. * @return the updated TriggerBuilder * @see Trigger#getJobKey() */ public TriggerBuilder<T> forJob(String jobName) { this.jobKey = new JobKey(jobName, null); return this; }
/** * Set the identity of the Job which should be fired by the produced * Trigger - a <code>JobKey</code> will be produced with the given * name and default group. * * @param jobName the name of the job (in default group) to fire. * @return the updated TriggerBuilder * @see Trigger#getJobKey() */ public TriggerBuilder<T> forJob(String jobName) { this.jobKey = new JobKey(jobName, null); return this; }
public static JobKey jobKey(String name, String group) { return new JobKey(name, group); }
public static JobKey jobKey(String name) { return new JobKey(name, null); }
public static JobKey jobKey(String name) { return new JobKey(name, null); }
/** * Set the identity of the Job which should be fired by the produced * Trigger - a <code>JobKey</code> will be produced with the given * name and group. * * @param jobName the name of the job to fire. * @param jobGroup the group of the job to fire. * @return the updated TriggerBuilder * @see Trigger#getJobKey() */ public TriggerBuilder<T> forJob(String jobName, String jobGroup) { this.jobKey = new JobKey(jobName, jobGroup); return this; }
public static JobKey jobKey(String name, String group) { return new JobKey(name, group); }
/** * Set the identity of the Job which should be fired by the produced * Trigger - a <code>JobKey</code> will be produced with the given * name and group. * * @param jobName the name of the job to fire. * @param jobGroup the group of the job to fire. * @return the updated TriggerBuilder * @see Trigger#getJobKey() */ public TriggerBuilder<T> forJob(String jobName, String jobGroup) { this.jobKey = new JobKey(jobName, jobGroup); return this; }
private static JobKey getJobKey(String id) { return new JobKey(id, GROUP_ID); }
/** * Use a <code>JobKey</code> with the given name and default group to * identify the JobDetail. * * <p>If none of the 'withIdentity' methods are set on the JobBuilder, * then a random, unique JobKey will be generated.</p> * * @param name the name element for the Job's JobKey * @return the updated JobBuilder * @see JobKey * @see JobDetail#getKey() */ public JobBuilder withIdentity(String name) { key = new JobKey(name, null); return this; }
public boolean ifJobExist(final String jobName, final String groupName) throws SchedulerException { return this.scheduler.getJobDetail(new JobKey(jobName, groupName)) != null; }
/** * pause a job given the groupname. since pausing request might be issued concurrently, * so synchronized is added to ensure thread safety. */ public synchronized void pauseJob(final String jobName, final String groupName) throws SchedulerException { checkJobExistence(jobName, groupName); this.scheduler.pauseJob(new JobKey(jobName, groupName)); }
/** * resume a paused job given the groupname. since resuming request might be issued concurrently, * so synchronized is added to ensure thread safety. */ public synchronized void resumeJob(final String jobName, final String groupName) throws SchedulerException { checkJobExistence(jobName, groupName); this.scheduler.resumeJob(new JobKey(jobName, groupName)); }
/** * Unregister a job given the groupname. Since unregister might be called when * concurrently removing projects, so synchronized is added to ensure thread safety. */ public synchronized void unregisterJob(final String jobName, final String groupName) throws SchedulerException { checkJobExistence(jobName, groupName); this.scheduler.deleteJob(new JobKey(jobName, groupName)); }
protected JobKey createJobKey(ScheduleJobEntity jobEntity) { String group = jobEntity.getType() == null ? "hsweb.scheduler" : jobEntity.getType(); return new JobKey(jobEntity.getId(), group); }
public JobKey getJobKey() { if(getJobName() == null) return null; return new JobKey(getJobName(), getJobGroup()); }
public JobKey getKey() { if(key == null) { if(getName() == null) return null; key = new JobKey(getName(), getGroup()); } return key; }
public JobKey getJobKey() { if(getJobName() == null) return null; return new JobKey(getJobName(), getJobGroup()); }
public JobKey getKey() { if(key == null) { if(getName() == null) return null; key = new JobKey(getName(), getGroup()); } return key; }
public synchronized boolean isJobPaused(final String jobName, final String groupName) throws SchedulerException { final JobKey jobKey = new JobKey(jobName, groupName); final JobDetail jobDetail = this.scheduler.getJobDetail(jobKey); final List<? extends Trigger> triggers = this.scheduler.getTriggersOfJob(jobDetail.getKey()); for (final Trigger trigger : triggers) { final TriggerState triggerState = this.scheduler.getTriggerState(trigger.getKey()); if (TriggerState.PAUSED.equals(triggerState)) { return true; } } return false; }