RepeatingSchedulableJob

public class RepeatingSchedulableJob implements SchedulableJob, Serializable

Schedulable Job - a data carrier class for a scheduled job that can be fired set number of times

Constructors

RepeatingSchedulableJob

public RepeatingSchedulableJob()

Constructor. It will create a job, which will never end, won’t ignore past fires at start and will use original fire time after misfire. Start time, MotechEvent, repeat count and repeat interval are not assigned, which means that further usage, without setting them, can cause exceptions.

RepeatingSchedulableJob

public RepeatingSchedulableJob(MotechEvent motechEvent, Integer repeatCount, Integer repeatIntervalInSeconds, Date startTime, Date endTime, boolean ignorePastFiresAtStart)

Constructor.

Parameters:
  • motechEvent – the MotechEvent which will be fired when the job triggers, not null
  • repeatCount – the number of times job should be repeated, null treated as infinite
  • repeatIntervalInSeconds – the interval(in seconds) between job fires
  • startTime – the Date at which job should become ACTIVE, not null
  • endTime – the Date at which job should be stopped, null treated as never end
  • ignorePastFiresAtStart – the flag defining whether job should ignore past fires at start or not

RepeatingSchedulableJob

public RepeatingSchedulableJob(MotechEvent motechEvent, Integer repeatIntervalInSeconds, Date startTime, Date endTime, boolean ignorePastFiresAtStart)

Constructor.

Parameters:
  • motechEvent – the MotechEvent which will be fired when the job triggers, not null
  • repeatIntervalInSeconds – the interval(in seconds) between job fires
  • startTime – the Date at which job should become ACTIVE, not null
  • endTime – the Date at which job should be stopped, null treated as never end
  • ignorePastFiresAtStart – the flag defining whether job should ignore past fires at start or not

Methods

equals

public boolean equals(Object obj)

getEndTime

public Date getEndTime()

getMotechEvent

public MotechEvent getMotechEvent()

getRepeatCount

public Integer getRepeatCount()

getRepeatIntervalInSeconds

public Integer getRepeatIntervalInSeconds()

getStartTime

public Date getStartTime()

hashCode

public int hashCode()

isIgnorePastFiresAtStart

public boolean isIgnorePastFiresAtStart()

isUseOriginalFireTimeAfterMisfire

public boolean isUseOriginalFireTimeAfterMisfire()

setEndTime

public RepeatingSchedulableJob setEndTime(Date endTime)

setIgnorePastFiresAtStart

public RepeatingSchedulableJob setIgnorePastFiresAtStart(boolean ignorePastFiresAtStart)

Ignore past fires when start time of job is in past.

ex : repeating job with interval of 5 unit, and current time in between fire 2 and 3 will start triggering from 3rd firetime.
 1     2     3     4
 +-----+-----+-----+
 start    ^current time
Parameters:
  • ignorePastFiresAtStart

setMotechEvent

public RepeatingSchedulableJob setMotechEvent(MotechEvent motechEvent)

setRepeatCount

public RepeatingSchedulableJob setRepeatCount(Integer repeatCount)

setRepeatIntervalInSeconds

public RepeatingSchedulableJob setRepeatIntervalInSeconds(Integer repeatIntervalInSeconds)

setStartTime

public RepeatingSchedulableJob setStartTime(Date startTime)

setUseOriginalFireTimeAfterMisfire

public RepeatingSchedulableJob setUseOriginalFireTimeAfterMisfire(boolean useOriginalFireTimeAfterMisfire)

toString

public String toString()