Package com.wowza.wms.util.crontab
Class CrontabEvent
Object
com.wowza.wms.util.crontab.CrontabEvent
- All Implemented Interfaces:
Comparable<CrontabEvent>
Holds an event's schedule and is responsible for calculating event activation.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintAllows CronEvents to be sorted via Java Sort Class.voiddump()dumps this event's information to the consolegetError()intcom.wowza.wms.util.crontab.CrontabFieldgetField(int whichField) org.joda.time.MutableDateTimeorg.joda.time.MutableDateTimebooleanbooleanIndicates whether or not all execution dates for this event occur in the pastbooleanisMatch(org.joda.time.MutableDateTime date) Determines if this event will fire on the date passed invoidsetDebug(boolean debug) turns on/off debug loggingvoidvoidsetErrorField(int errorField) voidsetEventHandler(ICrontabEventHandler handler) voidsetEventStr(String entry) voidsetField(int whichField, com.wowza.wms.util.crontab.CrontabField field) voidSets the last run time to nowvoidsetLastRun(org.joda.time.MutableDateTime date) voidbooleanstart()Starts this events timervoidstop()stops this events timer
-
Field Details
-
DT_FORMAT
public static org.joda.time.format.DateTimeFormatter DT_FORMAT -
MINUTE
public static final int MINUTE- See Also:
-
HOUR
public static final int HOUR- See Also:
-
DAY
public static final int DAY- See Also:
-
MONTH
public static final int MONTH- See Also:
-
YEAR
public static final int YEAR- See Also:
-
WEEKDAY
public static final int WEEKDAY- See Also:
-
-
Constructor Details
-
CrontabEvent
public CrontabEvent()
-
-
Method Details
-
start
public boolean start()Starts this events timer- Returns:
- true - if timer is started, else false
-
stop
public void stop()stops this events timer -
isMatch
public boolean isMatch(org.joda.time.MutableDateTime date) Determines if this event will fire on the date passed in- Parameters:
date-- Returns:
- boolean
-
setField
public void setField(int whichField, com.wowza.wms.util.crontab.CrontabField field) -
getField
public com.wowza.wms.util.crontab.CrontabField getField(int whichField) -
setTarget
-
getTarget
-
setEventStr
-
getEventStr
-
getNextRun
public org.joda.time.MutableDateTime getNextRun() -
getLastRun
public org.joda.time.MutableDateTime getLastRun() -
setLastRun
public void setLastRun(org.joda.time.MutableDateTime date) -
getError
-
setError
-
getErrorField
public int getErrorField() -
setErrorField
public void setErrorField(int errorField) -
setLastRun
public void setLastRun()Sets the last run time to now -
setDebug
public void setDebug(boolean debug) turns on/off debug logging- Parameters:
debug- - true/false
-
isDebugOn
public boolean isDebugOn() -
setEventHandler
-
getEventHandler
-
isExpired
public boolean isExpired()Indicates whether or not all execution dates for this event occur in the past- Returns:
- true/false
-
compareTo
Allows CronEvents to be sorted via Java Sort Class. Compares nextRun dates of two CronEvents where earlier events are considered "less" than later events, (e.g. today < tomorrow) and nulls are "greater" than events with dates (e.g. tomorrow < null) This provides the logic to sort events by soonest to latest with nulls at the end- Specified by:
compareToin interfaceComparable<CrontabEvent>- Parameters:
o- - CronEvent to compare this event to- Returns:
- -1,0,1 - if equal, if this event is greater than
-
dump
public void dump()dumps this event's information to the console
-