net.jot.scheduler
Class JOTSchedulingOptions

java.lang.Object
  extended by net.jot.scheduler.JOTSchedulingOptions

public class JOTSchedulingOptions
extends java.lang.Object

This reprsents a scheduled job "schedule". This is used to set schedule options


Field Summary
static int DROP_NEW_CALLS_IF_PREVIOUS_NOT_COMPLETED
          Only allow one call to run at a time If one is already running will just skip the new call
 long EVERY_12_HOURS
           
 long EVERY_15_MINUTES
           
 long EVERY_24_HOUR
           
 long EVERY_3_HOURS
           
 long EVERY_30_MINUTES
           
 long EVERY_5_MINUTES
           
 long EVERY_6_HOURS
           
 long EVERY_HOUR
           
 long EVERY_MINUTE
           
static java.lang.String scheduleHelp
           
static int START_NEW_THREAD_IF_PREVIOUS_NOT_COMPLETED
          Allow multiple concurrent calls
static java.util.regex.Pattern validator
           
 
Constructor Summary
JOTSchedulingOptions()
           
 
Method Summary
 java.util.Vector getRunAtDays()
           
 java.util.Vector getRunAtHours()
           
 java.util.Vector getRunAtMinutes()
           
 java.util.Vector getRunAtMonth()
           
 java.util.Vector getRunAtWeekDays()
           
 long getRunEvery()
           
static java.lang.String getScheduleHelp()
           
 int getThreadingScheme()
           
 boolean isStartNow()
           
static boolean isValid(java.lang.String schedule)
           
 void setRunAt(java.lang.String cronEntry)
          Request a run "right now" Very much like an unix cron line But the order is different:
Month(o=january) Day(1=1st) DayOfWeek(0=sunday) Hour Minute
'* * * 5,14 0' any day at 5:00 AM and 2:00 PM
'* * * 5,14 8' any day at 5:08 AM and 2:08 PM
'* * 0 0 0' any sunday at 00:00 AM
'* 1 * 0 0' any 1st of the month at 00:00 AM
'* 13 5 0 0' any Friday the 13th at 00:00AM
'* * * * *' any minute of any day.
'0 * * * *' any minute of any day in January
'2 13 5 0 0' Friday the 13th in March at 00:00 AM";
 void setRunEvery(long minutes, boolean startingNow)
          run the job at an interval (in milliseconds) ie: runEvery(EVERY_5_MINUTE); minutes: interval in minutes.
 void setRunNow(boolean runNow)
          Request a run right away
 void setThreadingScheme(int scheme)
          Set the threading scheme: ie: - DROP_NEW_CALLS_IF_PREVIOUS_NOT_COMPLETED - START_NEW_THREAD_IF_PREVIOUS_NOT_COMPLETED
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scheduleHelp

public static final java.lang.String scheduleHelp
See Also:
Constant Field Values

validator

public static final java.util.regex.Pattern validator

EVERY_MINUTE

public final long EVERY_MINUTE
See Also:
Constant Field Values

EVERY_5_MINUTES

public final long EVERY_5_MINUTES
See Also:
Constant Field Values

EVERY_15_MINUTES

public final long EVERY_15_MINUTES
See Also:
Constant Field Values

EVERY_30_MINUTES

public final long EVERY_30_MINUTES
See Also:
Constant Field Values

EVERY_HOUR

public final long EVERY_HOUR
See Also:
Constant Field Values

EVERY_3_HOURS

public final long EVERY_3_HOURS
See Also:
Constant Field Values

EVERY_6_HOURS

public final long EVERY_6_HOURS
See Also:
Constant Field Values

EVERY_12_HOURS

public final long EVERY_12_HOURS
See Also:
Constant Field Values

EVERY_24_HOUR

public final long EVERY_24_HOUR
See Also:
Constant Field Values

DROP_NEW_CALLS_IF_PREVIOUS_NOT_COMPLETED

public static final int DROP_NEW_CALLS_IF_PREVIOUS_NOT_COMPLETED
Only allow one call to run at a time If one is already running will just skip the new call

See Also:
Constant Field Values

START_NEW_THREAD_IF_PREVIOUS_NOT_COMPLETED

public static int START_NEW_THREAD_IF_PREVIOUS_NOT_COMPLETED
Allow multiple concurrent calls

Constructor Detail

JOTSchedulingOptions

public JOTSchedulingOptions()
Method Detail

setThreadingScheme

public void setThreadingScheme(int scheme)
Set the threading scheme: ie: - DROP_NEW_CALLS_IF_PREVIOUS_NOT_COMPLETED - START_NEW_THREAD_IF_PREVIOUS_NOT_COMPLETED

Parameters:
scheme -

setRunEvery

public void setRunEvery(long minutes,
                        boolean startingNow)
run the job at an interval (in milliseconds) ie: runEvery(EVERY_5_MINUTE); minutes: interval in minutes. startingNow: if true then first run right away, otherwise, first run after "minutes"


setRunNow

public void setRunNow(boolean runNow)
Request a run right away

Parameters:
runNow -

setRunAt

public void setRunAt(java.lang.String cronEntry)
Request a run "right now" Very much like an unix cron line But the order is different:
Month(o=january) Day(1=1st) DayOfWeek(0=sunday) Hour Minute
'* * * 5,14 0' any day at 5:00 AM and 2:00 PM
'* * * 5,14 8' any day at 5:08 AM and 2:08 PM
'* * 0 0 0' any sunday at 00:00 AM
'* 1 * 0 0' any 1st of the month at 00:00 AM
'* 13 5 0 0' any Friday the 13th at 00:00AM
'* * * * *' any minute of any day.
'0 * * * *' any minute of any day in January
'2 13 5 0 0' Friday the 13th in March at 00:00 AM";

Parameters:
runNow -

getRunAtDays

public java.util.Vector getRunAtDays()

getRunAtHours

public java.util.Vector getRunAtHours()

getRunAtMinutes

public java.util.Vector getRunAtMinutes()

getRunAtMonth

public java.util.Vector getRunAtMonth()

getRunAtWeekDays

public java.util.Vector getRunAtWeekDays()

getRunEvery

public long getRunEvery()

isStartNow

public boolean isStartNow()

getThreadingScheme

public int getThreadingScheme()

getScheduleHelp

public static java.lang.String getScheduleHelp()

isValid

public static boolean isValid(java.lang.String schedule)