/** * <p> * Set the given <code>Trigger</code>'s name to the given value, and its * group to the default group (<code>Scheduler.DEFAULT_GROUP</code>). * </p> * * @deprecated use org.quartz.TriggerUtils instead! * */ public static void setTriggerIdentity(Trigger trig, String name) { trig.setName(name); trig.setGroup(Scheduler.DEFAULT_GROUP); }
/** * <p> * Set the given <code>Trigger</code>'s name to the given value, and its * group to the default group (<code>Scheduler.DEFAULT_GROUP</code>). * </p> * * @deprecated use org.quartz.TriggerUtils instead! * */ public static void setTriggerIdentity(Trigger trig, String name) { trig.setName(name); trig.setGroup(Scheduler.DEFAULT_GROUP); }
/** * <p> * Set the given <code>Trigger</code>'s name to the given value, and its * group to the given group. * </p> * * @deprecated use org.quartz.TriggerUtils instead! * */ public static void setTriggerIdentity(Trigger trig, String name, String group) { trig.setName(name); trig.setGroup(group); }
/** * <p> * Set the given <code>Trigger</code>'s name to the given value, and its * group to the given group. * </p> * * @deprecated use org.quartz.TriggerUtils instead! * */ public static void setTriggerIdentity(Trigger trig, String name, String group) { trig.setName(name); trig.setGroup(group); }
/** * <p> * Set the given <code>Trigger</code>'s name to the given value, and its * group to the given group. * </p> * * @param trig the tigger to change name to * @param name the new trigger name * @param group the new trigger group */ public static void setTriggerIdentity( Trigger trig, String name, String group) { trig.setName(name); trig.setGroup(group); }
/** * <p> * Set the given <code>Trigger</code>'s name to the given value, and its * group to the given group. * </p> * * @param trig the tigger to change name to * @param name the new trigger name * @param group the new trigger group */ public static void setTriggerIdentity( Trigger trig, String name, String group) { trig.setName(name); trig.setGroup(group); }
/** * <p> * Create a <code>Trigger</code> with the given name, and default group. * </p> * * <p> * Note that the {@link #setJobName(String)}and * {@link #setJobGroup(String)}methods must be called before the <code>Trigger</code> * can be placed into a {@link Scheduler}. * </p> * * @param group if <code>null</code>, Scheduler.DEFAULT_GROUP will be used. * * @exception IllegalArgumentException * if name is null or empty, or the group is an empty string. */ public Trigger(String name) { setName(name); setGroup(null); }
/** * <p> * Create a <code>Trigger</code> with the given name, and group. * </p> * * <p> * Note that the {@link #setJobName(String)}and * {@link #setJobGroup(String)}methods must be called before the <code>Trigger</code> * can be placed into a {@link Scheduler}. * </p> * * @param group if <code>null</code>, Scheduler.DEFAULT_GROUP will be used. * * @exception IllegalArgumentException * if name is null or empty, or the group is an empty string. */ public Trigger(String name, String group) { setName(name); setGroup(group); }
/** * <p> * Make a trigger that will fire every N seconds, with the given number of * repeats. * </p> * * <p> * The generated trigger will not have its group, * or end-time set. The Start time defaults to 'now'. * </p> * * @param trigName the trigger's name * @param intervalInSeconds the number of seconds between firings * @param repeatCount the number of times to repeat the firing * @return the new trigger */ public static Trigger makeSecondlyTrigger( String trigName, int intervalInSeconds, int repeatCount) { Trigger trig = makeSecondlyTrigger(intervalInSeconds, repeatCount); trig.setName(trigName); return trig; }
/** * <p> * Make a trigger that will fire every N hours, with the given number of * repeats. * </p> * * <p> * The generated trigger will not have its group, * or end-time set. The Start time defaults to 'now'. * </p> * * @param trigName the trigger's name * @param intervalInHours the number of hours between firings * @param repeatCount the number of times to repeat the firing * @return the new trigger */ public static Trigger makeHourlyTrigger( String trigName, int intervalInHours, int repeatCount) { Trigger trig =makeHourlyTrigger(intervalInHours, repeatCount); trig.setName(trigName); return trig; }
/** * <p> * Create a <code>Trigger</code> with the given name, and group. * </p> * * <p> * Note that the {@link #setJobName(String)}and * {@link #setJobGroup(String)}methods must be called before the <code>Trigger</code> * can be placed into a {@link Scheduler}. * </p> * * @param group if <code>null</code>, Scheduler.DEFAULT_GROUP will be used. * * @exception IllegalArgumentException * if name is null or empty, or the group is an empty string. */ public Trigger(String name, String group) { setName(name); setGroup(group); }
/** * <p> * Make a trigger that will fire every day at the given time. * </p> * * <p> * The generated trigger will not have its group or end-time set. * The Start time defaults to 'now'. * </p> * * @param trigName the trigger's name * @param hour the hour (0-23) upon which to fire * @param minute the minute (0-59) upon which to fire * @return the newly created trigger */ public static Trigger makeDailyTrigger( String trigName, int hour, int minute) { Trigger trig = makeDailyTrigger(hour, minute); trig.setName(trigName); return trig; }
/** * <p> * Make a trigger that will fire every N minutes, with the given number of * repeats. * </p> * * <p> * The generated trigger will not have its group, * or end-time set. The Start time defaults to 'now'. * </p> * * @param trigName the trigger's name * @param intervalInMinutes the number of minutes between firings * @param repeatCount the number of times to repeat the firing * @return the new trigger */ public static Trigger makeMinutelyTrigger( String trigName, int intervalInMinutes, int repeatCount) { Trigger trig = makeMinutelyTrigger(intervalInMinutes, repeatCount); trig.setName(trigName); return trig; }
/** * <p> * Make a trigger that will fire every N minutes, with the given number of * repeats. * </p> * * <p> * The generated trigger will not have its group, * or end-time set. The Start time defaults to 'now'. * </p> * * @param trigName the trigger's name * @param intervalInMinutes the number of minutes between firings * @param repeatCount the number of times to repeat the firing * @return the new trigger */ public static Trigger makeMinutelyTrigger( String trigName, int intervalInMinutes, int repeatCount) { Trigger trig = makeMinutelyTrigger(intervalInMinutes, repeatCount); trig.setName(trigName); return trig; }
/** * <p> * Make a trigger that will fire every day at the given time. * </p> * * <p> * The generated trigger will not have its group or end-time set. * The Start time defaults to 'now'. * </p> * * @param trigName the trigger's name * @param hour the hour (0-23) upon which to fire * @param minute the minute (0-59) upon which to fire * @return the newly created trigger */ public static Trigger makeDailyTrigger( String trigName, int hour, int minute) { Trigger trig = makeDailyTrigger(hour, minute); trig.setName(trigName); return trig; }
/***********************************************************************/ public static Trigger createTrigger(Trigger trigger, String name, String defaultGroup) { trigger.setName(name); trigger.setGroup(defaultGroup); trigger.setStartTime(new Date()); trigger.setEndTime(new Date(Long.MAX_VALUE)); return trigger; } }
/** * <p> * Create a <code>Trigger</code> with the given name, and group. * </p> * * @param group if <code>null</code>, Scheduler.DEFAULT_GROUP will be used. * * @exception IllegalArgumentException * if name is null or empty, or the group is an empty string. */ public Trigger(String name, String group, String jobName, String jobGroup) { setName(name); setGroup(group); setJobName(jobName); setJobGroup(jobGroup); }
/** * <p> * Create a <code>Trigger</code> with the given name, and group. * </p> * * @param group if <code>null</code>, Scheduler.DEFAULT_GROUP will be used. * * @exception IllegalArgumentException * if name is null or empty, or the group is an empty string. */ public Trigger(String name, String group, String jobName, String jobGroup) { setName(name); setGroup(group); setJobName(jobName); setJobGroup(jobGroup); }
public Trigger buildTrigger(final JobId jobId, final JobConfig jobConfig) throws SchedulerServiceException { final byte[] parameters = parameterMapSerializer.serializeParameters(jobConfig.getParameters()); final Trigger trigger = buildTrigger(jobConfig.getSchedule()); trigger.setGroup(QUARTZ_TRIGGER_GROUP); trigger.setName(jobId.toString()); trigger.getJobDataMap().put(QUARTZ_PARAMETERS_KEY, parameters); return trigger; }
private Trigger createTrigger(Server server) throws ParseException { int runPeriod = configuration.getRunPeriod(); Trigger trigger; if (server.getCronExpression() != null && CronExpression.isValidExpression(server.getCronExpression())) { CronTrigger cTrigger = new CronTrigger(); cTrigger.setCronExpression(server.getCronExpression()); trigger = cTrigger; } else { if (server.getRunPeriodSeconds() != null) { runPeriod = server.getRunPeriodSeconds(); } trigger = TriggerUtils.makeSecondlyTrigger(runPeriod); // TODO replace Quartz with a ScheduledExecutorService } trigger.setName(server.getHost() + ":" + server.getPort() + "-" + Long.toString(System.nanoTime())); trigger.setStartTime(computeSpreadStartDate(runPeriod)); return trigger; }