Class TimerSchedule

java.lang.Object
org.glassfish.common.util.timer.TimerSchedule
All Implemented Interfaces:
Serializable

public class TimerSchedule extends Object implements Serializable
This class converts a cron-like string to its internal representation and calculates the next timeout after the current timestamp.
Author:
mvatkina
See Also:
  • Constructor Details

    • TimerSchedule

      public TimerSchedule()
      Construct TimerSchedule instance with all defaults.
    • TimerSchedule

      public TimerSchedule(String s)
      Construct TimerSchedule instance from a given String.
  • Method Details

    • second

      public TimerSchedule second(String s)
    • getSecond

      public String getSecond()
    • minute

      public TimerSchedule minute(String m)
    • getMinute

      public String getMinute()
    • hour

      public TimerSchedule hour(String h)
    • getHour

      public String getHour()
    • dayOfMonth

      public TimerSchedule dayOfMonth(String d)
    • getDayOfMonth

      public String getDayOfMonth()
    • month

      public TimerSchedule month(String m)
    • getMonth

      public String getMonth()
    • dayOfWeek

      public TimerSchedule dayOfWeek(String d)
    • getDayOfWeek

      public String getDayOfWeek()
    • year

      public TimerSchedule year(String y)
    • getYear

      public String getYear()
    • timezone

      public TimerSchedule timezone(String tz)
    • getTimeZoneID

      public String getTimeZoneID()
    • getTimeZone

      public TimeZone getTimeZone()
    • start

      public TimerSchedule start(Date s)
    • getStart

      public Date getStart()
    • end

      public TimerSchedule end(Date e)
    • getEnd

      public Date getEnd()
    • getScheduleAsString

      public String getScheduleAsString()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • isValid

      public boolean isValid(Calendar date)
      Returns true if this date can be used for the next timeout of the schedule represented by this instance.
    • getNextTimeout

      public Calendar getNextTimeout()
      Returns the Date of the next possible timeout.
    • getNextTimeout

      public Calendar getNextTimeout(Date date)
      Returns the Date of the next possible timeout after the specific date.
    • isExpectedElementCount

      protected boolean isExpectedElementCount(String[] el)
      Validate number of elements in the input string
    • configure

      protected void configure()
      Populate all internale structures to be used for the next timeout calculations