/** * Creates a new {@link Trigger} that gets {@link #run() run} * periodically. This is useful when your trigger does * some polling work. */ protected Trigger(@Nonnull String cronTabSpec) throws ANTLRException { this.spec = cronTabSpec; this.tabs = CronTabList.create(cronTabSpec); }
public static CronTabList create(@Nonnull String format) throws ANTLRException { return create(format,null); }
@DataBoundConstructor public SimpleScheduledRetentionStrategy(String startTimeSpec, int upTimeMins, boolean keepUpWhenActive) throws ANTLRException { this.startTimeSpec = startTimeSpec; this.keepUpWhenActive = keepUpWhenActive; this.tabs = CronTabList.create(startTimeSpec); this.lastChecked = new GregorianCalendar(); this.upTimeMins = Math.max(1, upTimeMins); this.lastChecked.add(Calendar.MINUTE, -1); }
protected Object readResolve() throws ObjectStreamException { try { tabs = CronTabList.create(spec); } catch (ANTLRException e) { InvalidObjectException x = new InvalidObjectException(e.getMessage()); x.initCause(e); throw x; } return this; }
protected synchronized Object readResolve() throws ObjectStreamException { try { tabs = CronTabList.create(startTimeSpec); lastChecked = new GregorianCalendar(); this.lastChecked.add(Calendar.MINUTE, -1); nextStop = Long.MIN_VALUE; nextStart = Long.MIN_VALUE; lastStop = Long.MAX_VALUE; lastStart = Long.MAX_VALUE; } catch (ANTLRException e) { InvalidObjectException x = new InvalidObjectException(e.getMessage()); x.initCause(e); throw x; } return this; }
/** * Performs syntax check. */ public FormValidation doCheck(@QueryParameter String value) { try { String msg = CronTabList.create(fixNull(value)).checkSanity(); if (msg != null) return FormValidation.warning(msg); return FormValidation.ok(); } catch (ANTLRException e) { return FormValidation.error(e.getMessage()); } } }
/** * Performs syntax check. */ public FormValidation doCheckSpec(@QueryParameter String value, @AncestorInPath Item item) { try { CronTabList ctl = CronTabList.create(fixNull(value), item != null ? Hash.from(item.getFullName()) : null); Collection<FormValidation> validations = new ArrayList<>(); updateValidationsForSanity(validations, ctl); updateValidationsForNextRun(validations, ctl); return FormValidation.aggregate(validations); } catch (ANTLRException e) { if (value.trim().indexOf('\n')==-1 && value.contains("**")) return FormValidation.error(Messages.TimerTrigger_MissingWhitespace()); return FormValidation.error(e.getMessage()); } }
/** * Called when a {@link Trigger} is loaded into memory and started. * * @param project * given so that the persisted form of this object won't have to have a back pointer. * @param newInstance * True if this may be a newly created trigger first attached to the {@link Project} (generally if the project is being created or configured). * False if this is invoked for a {@link Project} loaded from disk. * @see Items#currentlyUpdatingByXml */ public void start(J project, boolean newInstance) { this.job = project; try {// reparse the tabs with the job as the hash if (spec != null) { this.tabs = CronTabList.create(spec, Hash.from(project.getFullName())); } else { LOGGER.log(Level.WARNING, "The job {0} has a null crontab spec which is incorrect", job.getFullName()); } } catch (ANTLRException e) { // this shouldn't fail because we've already parsed stuff in the constructor, // so if it fails, use whatever 'tabs' that we already have. LOGGER.log(Level.WARNING, String.format("Failed to parse crontab spec %s in job %s", spec, project.getFullName()), e); } }
/** * Creates a new {@link Trigger} that gets {@link #run() run} * periodically. This is useful when your trigger does * some polling work. */ protected Trigger(String cronTabSpec) throws ANTLRException { this.spec = cronTabSpec; this.tabs = CronTabList.create(cronTabSpec); }
/** * Creates a new {@link Trigger} that gets {@link #run() run} * periodically. This is useful when your trigger does * some polling work. */ protected Trigger(String cronTabSpec) throws ANTLRException { this.spec = cronTabSpec; this.tabs = CronTabList.create(cronTabSpec); }
/** * Creates a new {@link Trigger} that gets {@link #run() run} * periodically. This is useful when your trigger does * some polling work. */ protected Trigger(String cronTabSpec) throws ANTLRException { this.spec = cronTabSpec; this.tabs = CronTabList.create(cronTabSpec); }
/** * Creates a new {@link Trigger} that gets {@link #run() run} * periodically. This is useful when your trigger does * some polling work. */ protected Trigger(@Nonnull String cronTabSpec) throws ANTLRException { this.spec = cronTabSpec; this.tabs = CronTabList.create(cronTabSpec); }
@DataBoundConstructor public SimpleScheduledRetentionStrategy(String startTimeSpec, int upTimeMins, boolean keepUpWhenActive) throws ANTLRException { this.startTimeSpec = startTimeSpec; this.keepUpWhenActive = keepUpWhenActive; this.tabs = CronTabList.create(startTimeSpec); this.lastChecked = new GregorianCalendar(); this.upTimeMins = Math.max(1, upTimeMins); this.lastChecked.add(Calendar.MINUTE, -1); }
@DataBoundConstructor public SimpleScheduledRetentionStrategy(String startTimeSpec, int upTimeMins, boolean keepUpWhenActive) throws RecognitionException { this.startTimeSpec = startTimeSpec; this.keepUpWhenActive = keepUpWhenActive; this.tabs = CronTabList.create(startTimeSpec); this.lastChecked = new GregorianCalendar(); this.upTimeMins = Math.max(1, upTimeMins); this.lastChecked.add(Calendar.MINUTE, -1); }
@DataBoundConstructor public SimpleScheduledRetentionStrategy(String startTimeSpec, int upTimeMins, boolean keepUpWhenActive) throws ANTLRException { this.startTimeSpec = startTimeSpec; this.keepUpWhenActive = keepUpWhenActive; this.tabs = CronTabList.create(startTimeSpec); this.lastChecked = new GregorianCalendar(); this.upTimeMins = Math.max(1, upTimeMins); this.lastChecked.add(Calendar.MINUTE, -1); }
protected Object readResolve() throws ObjectStreamException { try { tabs = CronTabList.create(spec); } catch (RecognitionException e) { InvalidObjectException x = new InvalidObjectException(e.getMessage()); x.initCause(e); throw x; } jobs = new ArrayList<J>(); return this; }
protected Object readResolve() throws ObjectStreamException { try { tabs = CronTabList.create(spec); } catch (ANTLRException e) { InvalidObjectException x = new InvalidObjectException(e.getMessage()); x.initCause(e); throw x; } return this; }
protected Object readResolve() throws ObjectStreamException { try { tabs = CronTabList.create(spec); } catch (ANTLRException e) { InvalidObjectException x = new InvalidObjectException(e.getMessage()); x.initCause(e); throw x; } return this; }
protected Object readResolve() throws ObjectStreamException { try { tabs = CronTabList.create(spec); } catch (ANTLRException e) { InvalidObjectException x = new InvalidObjectException(e.getMessage()); x.initCause(e); throw x; } return this; }
protected Object readResolve() throws ObjectStreamException { try { tabs = CronTabList.create(spec); } catch (ANTLRException e) { InvalidObjectException x = new InvalidObjectException(e.getMessage()); x.initCause(e); throw x; } return this; }