|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.scheduler.cron.SimpleToCronTriggerConverter
public class SimpleToCronTriggerConverter
From
the extranet spec page:
Constructor Summary | |
---|---|
SimpleToCronTriggerConverter()
|
Method Summary | |
---|---|
ConversionResult |
convertToCronString(Date nextFireDate,
long intervalMs)
Converts trigger data taken from the database entries into a quartz CronTrigger String. |
protected long |
determineBaseTimeUnit(long intervalMs)
Return the time unit (SECONDS, MINUTES, MONTHS etc.) that the supplied interval (ms) is closest to. |
protected long |
getSucceedingTimeUnit(long timeUnit)
Given a unit of time (e.g. |
protected String |
makeIncrementalCronElement(int targetTime,
long frequency,
int base)
Make a cron element of the form 'START_TIME''/''FREQUENCY'. |
protected long |
roundInterval(long intervalMs,
long baseTimeUnit)
Round the interval to the nearest time unit multiple that is a denominator of the succeeding time unit. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleToCronTriggerConverter()
Method Detail |
---|
public ConversionResult convertToCronString(Date nextFireDate, long intervalMs)
nextFireDate
- a time a trigger will next fireintervalMs
- a time delay in milliseconds between trigger firing
ConversionResult
which contains composed of the following cron fields:protected String makeIncrementalCronElement(int targetTime, long frequency, int base)
targetTime
- The time that the trigger should fire on, parsed from the nextFire quartz trigger fieldfrequency
- The delay between trigger firingsbase
- The base of the cron timeunit: 0 or 1. Seconds [0-59], minutes [0-59] & hours [0-23] are zero-based.
Day of Month [1-31], Months [1-12] and Days of Week [1-7] are one-based.
protected long roundInterval(long intervalMs, long baseTimeUnit)
intervalMs
- the original interval in millisecondsbaseTimeUnit
- the time unit that is the major component of the cron string (e.g. SECONDS, HOURS, etc.)
protected long getSucceedingTimeUnit(long timeUnit)
timeUnit
- a unit of time, defined at the top of this class
protected long determineBaseTimeUnit(long intervalMs)
intervalMs
- the supplied interval in milliseconds
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |