Package com.wowza.wms.util.crontab
Class CrontabEvent
- Object
- 
- com.wowza.wms.util.crontab.CrontabEvent
 
- 
- All Implemented Interfaces:
- Comparable<CrontabEvent>
 
 public class CrontabEvent extends Object implements Comparable<CrontabEvent> Holds an event's schedule and is responsible for calculating event activation.
- 
- 
Constructor SummaryConstructors Constructor Description CrontabEvent()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(CrontabEvent o)Allows CronEvents to be sorted via Java Sort Class.voiddump()dumps this event's information to the consoleStringgetError()intgetErrorField()ICrontabEventHandlergetEventHandler()StringgetEventStr()com.wowza.wms.util.crontab.CrontabFieldgetField(int whichField)org.joda.time.MutableDateTimegetLastRun()org.joda.time.MutableDateTimegetNextRun()StringgetTarget()booleanisDebugOn()booleanisExpired()Indicates 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 loggingvoidsetError(String error)voidsetErrorField(int errorField)voidsetEventHandler(ICrontabEventHandler handler)voidsetEventStr(String entry)voidsetField(int whichField, com.wowza.wms.util.crontab.CrontabField field)voidsetLastRun()Sets the last run time to nowvoidsetLastRun(org.joda.time.MutableDateTime date)voidsetTarget(String target)booleanstart()Starts this events timervoidstop()stops this events timer
 
- 
- 
- 
Field Detail- 
DT_FORMATpublic static org.joda.time.format.DateTimeFormatter DT_FORMAT 
 - 
MINUTEpublic static final int MINUTE - See Also:
- Constant Field Values
 
 - 
HOURpublic static final int HOUR - See Also:
- Constant Field Values
 
 - 
DAYpublic static final int DAY - See Also:
- Constant Field Values
 
 - 
MONTHpublic static final int MONTH - See Also:
- Constant Field Values
 
 - 
YEARpublic static final int YEAR - See Also:
- Constant Field Values
 
 - 
WEEKDAYpublic static final int WEEKDAY - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
startpublic boolean start() Starts this events timer- Returns:
- true - if timer is started, else false
 
 - 
stoppublic void stop() stops this events timer
 - 
isMatchpublic boolean isMatch(org.joda.time.MutableDateTime date) Determines if this event will fire on the date passed in- Parameters:
- date-
- Returns:
- boolean
 
 - 
setFieldpublic void setField(int whichField, com.wowza.wms.util.crontab.CrontabField field)
 - 
getFieldpublic com.wowza.wms.util.crontab.CrontabField getField(int whichField) 
 - 
setTargetpublic void setTarget(String target) 
 - 
getTargetpublic String getTarget() 
 - 
setEventStrpublic void setEventStr(String entry) 
 - 
getEventStrpublic String getEventStr() 
 - 
getNextRunpublic org.joda.time.MutableDateTime getNextRun() 
 - 
getLastRunpublic org.joda.time.MutableDateTime getLastRun() 
 - 
setLastRunpublic void setLastRun(org.joda.time.MutableDateTime date) 
 - 
getErrorpublic String getError() 
 - 
setErrorpublic void setError(String error) 
 - 
getErrorFieldpublic int getErrorField() 
 - 
setErrorFieldpublic void setErrorField(int errorField) 
 - 
setLastRunpublic void setLastRun() Sets the last run time to now
 - 
setDebugpublic void setDebug(boolean debug) turns on/off debug logging- Parameters:
- debug- - true/false
 
 - 
isDebugOnpublic boolean isDebugOn() 
 - 
setEventHandlerpublic void setEventHandler(ICrontabEventHandler handler) 
 - 
getEventHandlerpublic ICrontabEventHandler getEventHandler() 
 - 
isExpiredpublic boolean isExpired() Indicates whether or not all execution dates for this event occur in the past- Returns:
- true/false
 
 - 
compareTopublic int compareTo(CrontabEvent o) 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 interface- Comparable<CrontabEvent>
- Parameters:
- o- - CronEvent to compare this event to
- Returns:
- -1,0,1 - if equal, if this event is greater than
 
 - 
dumppublic void dump() dumps this event's information to the console
 
- 
 
-