MotechEvent

public class MotechEvent implements Serializable

Motech Scheduled Event data carrier class, Instance of this class with event specific data will be send by Motech Scheduler when a scheduled event is fired

This class is immutable

Fields

EVENT_TYPE_KEY_NAME

public static final String EVENT_TYPE_KEY_NAME

PARAM_DISCARDED_MOTECH_EVENT

public static final String PARAM_DISCARDED_MOTECH_EVENT

PARAM_INVALID_MOTECH_EVENT

public static final String PARAM_INVALID_MOTECH_EVENT

PARAM_REDELIVERY_COUNT

public static final String PARAM_REDELIVERY_COUNT

Constructors

MotechEvent

public MotechEvent()

MotechEvent

public MotechEvent(String subject)

Constructor with subject only (parameters can be added interactively)

Parameters:
  • subject
    • event destination
Throws:
  • IllegalArgumentException

MotechEvent

public MotechEvent(String subject, Map<String, Object> parameters)

Constructor

Parameters:
  • subject
    • event type: Pill Reminder, Appointment Reminder ...
  • parameters
    • a Map of additional parameters
Throws:
  • IllegalArgumentException

Methods

copy

public MotechEvent copy(String subject, Map<String, Object> parameters)

equals

public boolean equals(Object o)

getEndTime

public Date getEndTime()

getId

public UUID getId()

getMessageRedeliveryCount

public int getMessageRedeliveryCount()

getParameters

public Map<String, Object> getParameters()

Sets empty HashMap if parameters=null

getSubject

public String getSubject()

hashCode

public int hashCode()

incrementMessageRedeliveryCount

public void incrementMessageRedeliveryCount()

isLastEvent

public boolean isLastEvent()

setEndTime

public MotechEvent setEndTime(Date endDate)

setId

public void setId(UUID id)

setLastEvent

public MotechEvent setLastEvent(boolean lastEvent)

toString

public String toString()