Enrollment

public class Enrollment

Represents details about the client enrollment.

Constructors

Enrollment

public Enrollment()

Creates an Enrollment.

Methods

copyFrom

public Enrollment copyFrom(Enrollment enrollment)

Creates copy of the given enrollment.

Parameters:
  • enrollment – the enrollment to copy
Returns:

this instance with copied properties

fulfillCurrentMilestone

public void fulfillCurrentMilestone(DateTime fulfillmentDateTime)

Adds the current milestone to the milestone fulfillments list with the given date and time.

Parameters:
  • fulfillmentDateTime – the fulfillment date and time

getCurrentMilestoneName

public String getCurrentMilestoneName()

getCurrentMilestoneStartDate

public DateTime getCurrentMilestoneStartDate()

Returns the start date and time of the current milestone.

Returns:the start date and time of the current milestone

getCurrentWindowAsOf

public WindowName getCurrentWindowAsOf(DateTime asOf)

Returns the name of the window in the current milestone where the given date and time must be in the window time range.

Parameters:
  • asOf – the date and time which is the time range of the window
Returns:

the window name

getEndOfWindowForCurrentMilestone

public DateTime getEndOfWindowForCurrentMilestone(WindowName windowName)

Returns the end date and time of the window with the given name in the current milestone.

Parameters:
  • windowName – the window name
Returns:

the end date and time of the window

getEnrolledOn

public DateTime getEnrolledOn()

getExternalId

public String getExternalId()

getFulfillments

public List<MilestoneFulfillment> getFulfillments()

getId

public Long getId()

getLastFulfilledDate

public DateTime getLastFulfilledDate()

Returns the date and time of the last milestone fulfilment.

Returns:the date and time of the last milestone fulfilment

getMetadata

public Map<String, String> getMetadata()

getPreferredAlertTime

public Time getPreferredAlertTime()

getSchedule

public Schedule getSchedule()

getScheduleName

public String getScheduleName()

getStartOfSchedule

public DateTime getStartOfSchedule()

getStartOfWindowForCurrentMilestone

public DateTime getStartOfWindowForCurrentMilestone(WindowName windowName)

Returns the start date and time of the window with the given name in the current milestone.

Parameters:
  • windowName – the window name
Returns:

the start date and time of the window

getStatus

public EnrollmentStatus getStatus()

isActive

public boolean isActive()

Checks whether the enrollment is active.

Returns:true if the enrollment is active, otherwise false

isCompleted

public boolean isCompleted()

Checks whether the enrollment is completed.

Returns:true if the enrollment is completed, otherwise false

setCurrentMilestoneName

public void setCurrentMilestoneName(String currentMilestoneName)

setEnrolledOn

public void setEnrolledOn(DateTime enrolledOn)

setExternalId

public void setExternalId(String externalId)

setFulfillments

public void setFulfillments(List<MilestoneFulfillment> fulfillments)

setId

public void setId(Long id)

setMetadata

public void setMetadata(Map<String, String> metadata)

setPreferredAlertTime

public void setPreferredAlertTime(Time preferredAlertTime)

setSchedule

public void setSchedule(Schedule schedule)

Sets the schedule and the schedule name from the given schedule.

Parameters:
  • schedule – the schedule to which the enrollment belongs

setScheduleName

public void setScheduleName(String scheduleName)

setStartOfSchedule

public void setStartOfSchedule(DateTime startOfSchedule)

setStatus

public void setStatus(EnrollmentStatus status)