StatusMessage

public class StatusMessage

Represents a message displayed in the ‘messages’ section of the Admin UI. Persisted by MDS. Apart from the message and its Level, it contains also information about the module that sent the message. The timeout field represents the DateTime of the message expiration. Status messages are matched against notification rules.

See also: org.motechproject.admin.domain.NotificationRule

Constructors

StatusMessage

public StatusMessage()

Constructor. Defaults the level of this message to INFO and the expiration date to 60 minutes from now.

StatusMessage

public StatusMessage(String text, String moduleName, Level level)

Constructor. Defaults the expiration date to 60 minutes from now.

Parameters:
  • text – the message content
  • moduleName – the name of the module to which this message relates to
  • level – the message level

StatusMessage

public StatusMessage(String text, String moduleName, Level level, DateTime timeout)

Constructor.

Parameters:
  • text – the message content
  • moduleName – the name of the module to which this message relates to
  • level – the message level
  • timeout – the message expiry date

Methods

getDate

public DateTime getDate()
Returns:the date and time at which this message was published

getLevel

public Level getLevel()
Returns:the level of the message

getModuleName

public String getModuleName()
Returns:the name of the module to which this message relates to

getText

public String getText()
Returns:the message content

getTimeout

public DateTime getTimeout()
Returns:the message expiry date

setDate

public void setDate(DateTime date)
Parameters:
  • date – the date and time at which this message was published

setLevel

public void setLevel(Level level)
Parameters:
  • level – the level of the message

setModuleName

public void setModuleName(String moduleName)
Parameters:
  • moduleName – the name of the module to which this message relates to

setText

public void setText(String text)
Parameters:
  • text – the message content

setTimeout

public void setTimeout(DateTime timeout)
Parameters:
  • timeout – the message expiry date