NotificationRule¶
-
public class
NotificationRule
¶ A notification rule persisted in the database. Represents a rule for sending out a single notification after a matching
org.motechproject.admin.domain.StatusMessage
is registered in the system. The message is matched against its level and the module to which it is tied to. This class also contains information about this notification’s recipient and theActionType
representing a method used for notifying the recipient.
Constructors¶
NotificationRule¶
-
public
NotificationRule
(String recipient, ActionType actionType, Level level, String moduleName)¶ Constructor.
Parameters: - recipient – the recipient of the notification
- actionType – the type of action which will be performed
- level – the minimal level for which the notification will trigger
- moduleName – the module name for which this rule will trigger, leave null or blank for every module
Methods¶
getActionType¶
-
public ActionType
getActionType
()¶ Returns: the action that should be performed for this notification rule
getLevel¶
getModuleName¶
matches¶
-
public boolean
matches
(StatusMessage message)¶ Checks if the message matches this rule.
Parameters: - message – the message which will be checked against this rule
Returns: true if message matches this notification rule, false otherwise
setActionType¶
-
public void
setActionType
(ActionType actionType)¶ Parameters: - actionType – the action that should be performed for this notification rule