Schedule

public class Schedule

Represents schedule of the milestones. Clients are enrolled to the schedules, after this alerts will be raised. If the schedule is absolute: The alert reference time is the start of the schedule. All offsets for alerts are calculated from the start of schedule. If the schedule is not absolute(default): If there are no fulfilled milestones, the enrollment date is used as the alert reference time. If there are fulfilled milestones, the last milestone’s fulfillment date is used as the alert reference time.

Constructors

Schedule

public Schedule()

Creates a Schedule.

Schedule

public Schedule(String name)

Creates a Schedule with the name attribute set to name.

Parameters:
  • name – the name of the schedule

Methods

addMilestones

public void addMilestones(Milestone... milestonesList)

Adds the given milestones to this schedule.

Parameters:
  • milestonesList – the list of the milestones

equals

public boolean equals(Object o)

getDuration

public Period getDuration()

Returns the duration of all milestones in this schedule.

Returns:the duration of all milestones

getFirstMilestone

public Milestone getFirstMilestone()

Returns the first milestone in the schedule.

Returns:the first milestone

getMilestone

public Milestone getMilestone(String milestoneName)

Returns the milestone with the given name.

Parameters:
  • milestoneName – the name of the milestone
Returns:

the milestone

getMilestones

public List<Milestone> getMilestones()

getName

public String getName()

getNextMilestoneName

public String getNextMilestoneName(String currentMilestoneName)

Returns the name of the next milestone.

Parameters:
  • currentMilestoneName – the name of the current milestone
Returns:

the name of the next milestone

hasExpiredSince

public boolean hasExpiredSince(DateTime referenceDateTime, String currentMilestoneStr)

Checks whether the milstone with the given name has expired.

Parameters:
  • referenceDateTime – the expiration reference date and time
  • currentMilestoneStr – the name of the milestone
Returns:

true if the milestone has been expired

hashCode

public int hashCode()

isBasedOnAbsoluteWindows

public boolean isBasedOnAbsoluteWindows()

merge

public Schedule merge(Schedule schedule)

Sets the milestones and the basedOnAbsoluteWindows attributes. The values are retrieved from the given scheduler.

Parameters:
  • schedule – the scheduler which data will be merged with this scheduler
Returns:

the scheduler with merged data

setBasedOnAbsoluteWindows

public void setBasedOnAbsoluteWindows(boolean value)