Class 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 Detail

      • CrontabEvent

        public CrontabEvent()
    • Method Detail

      • 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

        public void setTarget​(String target)
      • getTarget

        public String getTarget()
      • setEventStr

        public void setEventStr​(String entry)
      • getEventStr

        public String 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

        public String getError()
      • setError

        public void setError​(String error)
      • 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()
      • isExpired

        public boolean isExpired()
        Indicates whether or not all execution dates for this event occur in the past
        Returns:
        true/false
      • compareTo

        public 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:
        compareTo in interface Comparable<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