Codota Logo
NthIncludedDayTrigger
Code IndexAdd Codota to your IDE (free)

How to use
NthIncludedDayTrigger
in
org.quartz

Best Java code snippets using org.quartz.NthIncludedDayTrigger (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: com.opensymphony.quartz/com.springsource.org.quartz

/**
 * Called when the <CODE>Scheduler</CODE> has decided to 'fire' the trigger
 * (execute the associated <CODE>Job</CODE>), in order to give the 
 * <CODE>Trigger</CODE> a chance to update itself for its next triggering 
 * (if any).
 */
public void triggered(Calendar calendar) {
  this.calendar = calendar;
  this.previousFireTime = this.nextFireTime;
  this.nextFireTime = getFireTimeAfter(this.nextFireTime);
}
 
origin: quartz/quartz-all

/**
 * Updates the <CODE>NthIncludedDayTrigger</CODE>'s state based on the
 * MISFIRE_INSTRUCTION_XXX that was selected when the 
 * <CODE>NthIncludedDayTrigger</CODE> was created
 * <P>
 * If the misfire instruction is set to MISFIRE_INSTRUCTION_SMART_POLICY,
 * then the instruction will be interpreted as 
 * {@link #MISFIRE_INSTRUCTION_FIRE_ONCE_NOW}.
 * 
 * @param calendar a new or updated calendar to use for the trigger
 */
public void updateAfterMisfire(Calendar calendar) {
  int instruction = getMisfireInstruction();
  
  this.calendar = calendar;
  
  if (instruction == MISFIRE_INSTRUCTION_SMART_POLICY) {
    instruction = MISFIRE_INSTRUCTION_FIRE_ONCE_NOW;
  }
  
  if (instruction == MISFIRE_INSTRUCTION_DO_NOTHING) {
    this.nextFireTime = getFireTimeAfter(new Date());
  } else if (instruction == MISFIRE_INSTRUCTION_FIRE_ONCE_NOW) {
    this.nextFireTime = new Date();
  }
}
origin: org.quartz-scheduler/quartz-backward-compat

/**
* Used by the <CODE>Scheduler</CODE> to determine whether or not it is
* possible for this <CODE>Trigger</CODE> to fire again.
* <P>
* If the returned value is <CODE>false</CODE> then the 
* <CODE>Scheduler</CODE> may remove the <CODE>Trigger</CODE> from the
* <CODE>JobStore</CODE>
* 
* @return a boolean indicator of whether the trigger could potentially fire
*         again
*/
public boolean mayFireAgain() {
  return (getNextFireTime() != null);
}
origin: org.quartz-scheduler/quartz-backward-compat

  return getWeeklyFireTimeAfter(afterTime);
} else if (this.intervalType == INTERVAL_TYPE_MONTHLY) {
  return getMonthlyFireTimeAfter(afterTime);
} else if (this.intervalType == INTERVAL_TYPE_YEARLY) {
  return getYearlyFireTimeAfter(afterTime);
} else {
  return null;
origin: org.quartz-scheduler/quartz-backward-compat

public Object clone() {
  NthIncludedDayTrigger copy = (NthIncludedDayTrigger) super.clone();
  if(getTimeZone() != null)
    copy.timeZone = (TimeZone) getTimeZone().clone();
  
  return copy;
}

origin: quartz/quartz-all

/**
* Called after the <CODE>Scheduler</CODE> has executed the 
* <code>JobDetail</CODE> associated with the <CODE>Trigger</CODE> in order
* to get the final instruction code from the trigger.
* 
* @param jobCtx the <CODE>JobExecutionContext</CODE> that was used by the
*               <CODE>Job</CODE>'s <CODE>execute()</CODE> method.
* @param result the <CODE>JobExecutionException</CODE> thrown by the
*               <CODE>Job</CODE>, if any (may be <CODE>null</CODE>)
* @return one of the Trigger.INSTRUCTION_XXX constants.
*/
public int executionComplete(JobExecutionContext jobCtx,
  JobExecutionException result) {
  if (result != null && result.refireImmediately()) {
    return INSTRUCTION_RE_EXECUTE_JOB;
  }
  if (result != null && result.unscheduleFiringTrigger()) {
    return INSTRUCTION_SET_TRIGGER_COMPLETE;
  }

  if (result != null && result.unscheduleAllTriggers()) {
    return INSTRUCTION_SET_ALL_JOB_TRIGGERS_COMPLETE;
  }

  if (!mayFireAgain()) {
    return INSTRUCTION_DELETE_TRIGGER;
  }

  return INSTRUCTION_NOOP;
}
origin: com.opensymphony.quartz/com.springsource.org.quartz

  return getWeeklyFireTimeAfter(afterTime);
} else if (this.intervalType == INTERVAL_TYPE_MONTHLY) {
  return getMonthlyFireTimeAfter(afterTime);
} else if (this.intervalType == INTERVAL_TYPE_YEARLY) {
  return getYearlyFireTimeAfter(afterTime);
} else {
  return null;
origin: com.opensymphony.quartz/com.springsource.org.quartz

boolean gotOne = false;
afterCal = java.util.Calendar.getInstance(getTimeZone());
afterCal.setTime(afterDate);
currCal = java.util.Calendar.getInstance(getTimeZone());
currCal.set(afterCal.get(java.util.Calendar.YEAR),
      afterCal.get(java.util.Calendar.MONTH), 1);
origin: com.opensymphony.quartz/com.springsource.org.quartz

/**
* Called after the <CODE>Scheduler</CODE> has executed the 
* <code>JobDetail</CODE> associated with the <CODE>Trigger</CODE> in order
* to get the final instruction code from the trigger.
* 
* @param jobCtx the <CODE>JobExecutionContext</CODE> that was used by the
*               <CODE>Job</CODE>'s <CODE>execute()</CODE> method.
* @param result the <CODE>JobExecutionException</CODE> thrown by the
*               <CODE>Job</CODE>, if any (may be <CODE>null</CODE>)
* @return one of the Trigger.INSTRUCTION_XXX constants.
*/
public int executionComplete(JobExecutionContext jobCtx,
  JobExecutionException result) {
  if (result != null && result.refireImmediately()) {
    return INSTRUCTION_RE_EXECUTE_JOB;
  }
  if (result != null && result.unscheduleFiringTrigger()) {
    return INSTRUCTION_SET_TRIGGER_COMPLETE;
  }

  if (result != null && result.unscheduleAllTriggers()) {
    return INSTRUCTION_SET_ALL_JOB_TRIGGERS_COMPLETE;
  }

  if (!mayFireAgain()) {
    return INSTRUCTION_DELETE_TRIGGER;
  }

  return INSTRUCTION_NOOP;
}
origin: quartz/quartz-all

  return getWeeklyFireTimeAfter(afterTime);
} else if (this.intervalType == INTERVAL_TYPE_MONTHLY) {
  return getMonthlyFireTimeAfter(afterTime);
} else if (this.intervalType == INTERVAL_TYPE_YEARLY) {
  return getYearlyFireTimeAfter(afterTime);
} else {
  return null;
origin: quartz/quartz-all

/**
 * Called when the <CODE>Scheduler</CODE> has decided to 'fire' the trigger
 * (execute the associated <CODE>Job</CODE>), in order to give the 
 * <CODE>Trigger</CODE> a chance to update itself for its next triggering 
 * (if any).
 */
public void triggered(Calendar calendar) {
  this.calendar = calendar;
  this.previousFireTime = this.nextFireTime;
  this.nextFireTime = getFireTimeAfter(this.nextFireTime);
}

origin: com.opensymphony.quartz/com.springsource.org.quartz

/**
 * Updates the <CODE>NthIncludedDayTrigger</CODE>'s state based on the
 * MISFIRE_INSTRUCTION_XXX that was selected when the 
 * <CODE>NthIncludedDayTrigger</CODE> was created
 * <P>
 * If the misfire instruction is set to MISFIRE_INSTRUCTION_SMART_POLICY,
 * then the instruction will be interpreted as 
 * {@link #MISFIRE_INSTRUCTION_FIRE_ONCE_NOW}.
 * 
 * @param calendar a new or updated calendar to use for the trigger
 */
public void updateAfterMisfire(Calendar calendar) {
  int instruction = getMisfireInstruction();
  
  this.calendar = calendar;
  
  if (instruction == MISFIRE_INSTRUCTION_SMART_POLICY) {
    instruction = MISFIRE_INSTRUCTION_FIRE_ONCE_NOW;
  }
  
  if (instruction == MISFIRE_INSTRUCTION_DO_NOTHING) {
    this.nextFireTime = getFireTimeAfter(new Date());
  } else if (instruction == MISFIRE_INSTRUCTION_FIRE_ONCE_NOW) {
    this.nextFireTime = new Date();
  }
}
origin: com.opensymphony.quartz/com.springsource.org.quartz

boolean gotOne = false;
afterCal = java.util.Calendar.getInstance(getTimeZone());
afterCal.setTime(afterDate);
currCal = java.util.Calendar.getInstance(getTimeZone());
currCal.set(afterCal.get(java.util.Calendar.YEAR),
      java.util.Calendar.JANUARY, 1);
origin: com.opensymphony.quartz/com.springsource.org.quartz

/**
* Used by the <CODE>Scheduler</CODE> to determine whether or not it is
* possible for this <CODE>Trigger</CODE> to fire again.
* <P>
* If the returned value is <CODE>false</CODE> then the 
* <CODE>Scheduler</CODE> may remove the <CODE>Trigger</CODE> from the
* <CODE>JobStore</CODE>
* 
* @return a boolean indicator of whether the trigger could potentially fire
*         again
*/
public boolean mayFireAgain() {
  return (getNextFireTime() != null);
}
origin: org.quartz-scheduler/quartz-backward-compat

/**
 * Called when the <CODE>Scheduler</CODE> has decided to 'fire' the trigger
 * (execute the associated <CODE>Job</CODE>), in order to give the 
 * <CODE>Trigger</CODE> a chance to update itself for its next triggering 
 * (if any).
 */
public void triggered(Calendar calendar) {
  this.calendar = calendar;
  this.previousFireTime = this.nextFireTime;
  this.nextFireTime = getFireTimeAfter(this.nextFireTime);
}

origin: org.quartz-scheduler/quartz-backward-compat

/**
 * Updates the <CODE>NthIncludedDayTrigger</CODE>'s state based on the
 * MISFIRE_INSTRUCTION_XXX that was selected when the 
 * <CODE>NthIncludedDayTrigger</CODE> was created
 * <P>
 * If the misfire instruction is set to MISFIRE_INSTRUCTION_SMART_POLICY,
 * then the instruction will be interpreted as 
 * {@link #MISFIRE_INSTRUCTION_FIRE_ONCE_NOW}.
 * 
 * @param calendar a new or updated calendar to use for the trigger
 */
public void updateAfterMisfire(Calendar calendar) {
  int instruction = getMisfireInstruction();
  
  this.calendar = calendar;
  
  if (instruction == MISFIRE_INSTRUCTION_SMART_POLICY) {
    instruction = MISFIRE_INSTRUCTION_FIRE_ONCE_NOW;
  }
  
  if (instruction == MISFIRE_INSTRUCTION_DO_NOTHING) {
    this.nextFireTime = getFireTimeAfter(new Date());
  } else if (instruction == MISFIRE_INSTRUCTION_FIRE_ONCE_NOW) {
    this.nextFireTime = new Date();
  }
}
origin: quartz/quartz-all

boolean gotOne = false;
afterCal = java.util.Calendar.getInstance(getTimeZone());
afterCal.setTime(afterDate);
currCal = java.util.Calendar.getInstance(getTimeZone());
currCal.set(afterCal.get(java.util.Calendar.YEAR),
      java.util.Calendar.JANUARY, 1);
origin: quartz/quartz-all

/**
* Used by the <CODE>Scheduler</CODE> to determine whether or not it is
* possible for this <CODE>Trigger</CODE> to fire again.
* <P>
* If the returned value is <CODE>false</CODE> then the 
* <CODE>Scheduler</CODE> may remove the <CODE>Trigger</CODE> from the
* <CODE>JobStore</CODE>
* 
* @return a boolean indicator of whether the trigger could potentially fire
*         again
*/
public boolean mayFireAgain() {
  return (getNextFireTime() != null);
}
origin: com.opensymphony.quartz/com.springsource.org.quartz

/**
 * Called by the scheduler at the time a <CODE>Trigger</code> is first
 * added to the scheduler, in order to have the <CODE>Trigger</CODE>
 * compute its first fire time, based on any associated calendar.
 * <P>
 * After this method has been called, <CODE>getNextFireTime()</CODE>
 * should return a valid answer.
 * </p>
 * 
 * @return the first time at which the <CODE>Trigger</CODE> will be fired
 *         by the scheduler, which is also the same value 
 *         {@link #getNextFireTime()} will return (until after the first 
 *         firing of the <CODE>Trigger</CODE>).
 */
public Date computeFirstFireTime(Calendar calendar) {       
  this.calendar = calendar;
  this.nextFireTime = 
    getFireTimeAfter(new Date(this.startTime.getTime() - 1000l));
  
  return this.nextFireTime;
}
origin: org.quartz-scheduler/quartz-backward-compat

boolean gotOne = false;
afterCal = java.util.Calendar.getInstance(getTimeZone());
afterCal.setTime(afterDate);
currCal = java.util.Calendar.getInstance(getTimeZone());
currCal.set(afterCal.get(java.util.Calendar.YEAR),
      afterCal.get(java.util.Calendar.MONTH), 1);
org.quartzNthIncludedDayTrigger

Javadoc

A trigger which fires on the Nth day of every interval type ( #INTERVAL_TYPE_WEEKLY, #INTERVAL_TYPE_MONTHLY or #INTERVAL_TYPE_YEARLY) that is not excluded by the associated calendar. When determining what the Nth day of the month or year is, NthIncludedDayTrigger will skip excluded days on the associated calendar. This would commonly be used in an Nth business day situation, in which the user wishes to fire a particular job on the Nth business day (i.e. the 5th business day of every month). Each NthIncludedDayTrigger also has an associated fireAtTime which indicates at what time of day the trigger is to fire.

All NthIncludedDayTriggers default to a monthly interval type (fires on the Nth day of every month) with N = 1 (first non-excluded day) and fireAtTime set to 12:00 PM (noon). These values can be changed using the #setN, #setIntervalType, and #setFireAtTime methods. Users may also want to note the #setNextFireCutoffInterval and #getNextFireCutoffIntervalmethods.

Take, for example, the following calendar:

 
July                  August                September 
Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa 
1  W       1  2  3  4  5  W                1  2  W 
W  H  5  6  7  8  W    W  8  9 10 11 12  W    W  H  6  7  8  9  W 
W 11 12 13 14 15  W    W 15 16 17 18 19  W    W 12 13 14 15 16  W 
W 18 19 20 21 22  W    W 22 23 24 25 26  W    W 19 20 21 22 23  W 
W 25 26 27 28 29  W    W 29 30 31             W 26 27 28 29 30 
W 

Where W's represent weekend days, and H's represent holidays, all of which are excluded on a calendar associated with an NthIncludedDayTrigger with n=5 and intervalType=INTERVAL_TYPE_MONTHLY. In this case, the trigger would fire on the 8th of July (because of the July 4 holiday), the 5th of August, and the 8th of September (because of Labor Day).

Most used methods

  • getFireTimeAfter
    Returns the first time the NthIncludedDayTrigger will fire after the specified date. Because of the
  • getMisfireInstruction
  • getMonthlyFireTimeAfter
    Calculates the first time an NthIncludedDayTrigger withintervalType = #INTERVAL_TYPE_MONTHLY will fi
  • getNextFireTime
    Returns the next time at which the NthIncludedDayTrigger will fire. If the trigger will not fire aga
  • getTimeZone
    Gets the time zone in which the fireAtTime will be resolved. If no time zone was explicitly set, the
  • getWeeklyFireTimeAfter
    Calculates the first time an NthIncludedDayTrigger withintervalType = #INTERVAL_TYPE_WEEKLY will fir
  • getYearlyFireTimeAfter
    Calculates the first time an NthIncludedDayTrigger withintervalType = #INTERVAL_TYPE_YEARLY will fir
  • mayFireAgain
    Used by the Scheduler to determine whether or not it is possible for this Trigger to fire again. If

Popular in Java

  • Reading from database using SQL prepared statement
  • setContentView (Activity)
  • onCreateOptionsMenu (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Hashtable (java.util)
    Hashtable is a synchronized implementation of Map. All optional operations are supported.Neither key
  • LinkedHashMap (java.util)
    Hash table and linked list implementation of the Map interface, with predictable iteration order. Th
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Notification (javax.management)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now