Class Notification

java.lang.Object
mc.core.model.base.EntityText
mc.core.model.system.Notification
All Implemented Interfaces:
Serializable, IBaseEntity, ICoreEntity

@Entity public class Notification extends EntityText implements IBaseEntity
Entity to store a message to a number of users or user groups, optionally concerning a specific entity and/or containing a report, e.g. of performed imports/exports.
Notifications are made multilingual by using resource bundle keys for topic and message. The display application must replace the resource bundle keys with the actual texts.
See Also:
  • Constructor Details

    • Notification

      public Notification()
    • Notification

      public Notification(Notification source)
  • Method Details

    • getId

      public long getId()
      Specified by:
      getId in interface IBaseEntity
    • setId

      public void setId(long id)
      Specified by:
      setId in interface IBaseEntity
    • getNotificationReceiver

      public List<NotificationReceiver> getNotificationReceiver()
    • setNotificationReceiver

      public void setNotificationReceiver(List<NotificationReceiver> receiver)
    • getReceiver

      public List<Principal> getReceiver()
      transient for mapping from entity manager and existing code
      Returns:
      list of Principal from the list of NotificationReceiver
    • setReceiver

      public void setReceiver(List<Principal> receiver)
      for setting notification receivers through entity mapping. new NotificationReceiver entities are inserted by cascade.
      Parameters:
      receiver -
    • addReceiver

      public void addReceiver(Principal receiver)
      add this principal (user or group) as direct receiver to notification
      Parameters:
      receiver -
    • addReceiver

      public void addReceiver(Principal receiver, boolean directReceiver)
    • getNotificationAttachments

      public List<NotificationAttachment> getNotificationAttachments()
    • setNotificationAttachments

      public void setNotificationAttachments(List<NotificationAttachment> attachments)
    • addNotificationAttachment

      public void addNotificationAttachment(IEntity entity)
    • addNotificationAttachment

      public void addNotificationAttachment(ComplexEntity entity)
    • getSender

      public User getSender()
    • setSender

      public void setSender(User sender)
    • getReport

      public Report getReport()
    • setReport

      public void setReport(Report report)
    • getDateCreated

      public Calendar getDateCreated()
    • setDateCreated

      public void setDateCreated(Calendar date)
    • getMessageKey

      public String getMessageKey()
    • setMessageKey

      public void setMessageKey(String message)
    • getTopicKey

      public String getTopicKey()
    • setTopicKey

      public void setTopicKey(String topic)
    • getMessageArgString

      public String getMessageArgString()
    • setMessageArgString

      public void setMessageArgString(String messageArgString)
    • getTopicArgString

      public String getTopicArgString()
    • setTopicArgString

      public void setTopicArgString(String topicArgString)
    • getMessageArguments

      public String[] getMessageArguments()
    • setMessageArguments

      public void setMessageArguments(String... args)
    • getTopicArguments

      public String[] getTopicArguments()
    • setTopicArguments

      public void setTopicArguments(String... args)
    • getMessageBoard

      public String getMessageBoard()
    • setMessageBoard

      public void setMessageBoard(String messageBoard)
    • getTopic

      public Resource getTopic()
    • setTopic

      public void setTopic(Resource topic)
      do not call directly. use textService or dataMap!
    • setTopic

      @Deprecated public void setTopic(String text, Locale locale)
      Deprecated.
      do not call directly. use textService or dataMap!
    • getMessage

      public Resource getMessage()
    • setMessage

      public void setMessage(Resource message)
      do not call directly. use textService or dataMap!
    • setMessage

      @Deprecated public void setMessage(String text, Locale locale)
      Deprecated.
      do not call directly. use textService or dataMap!
    • getTopic

      public String getTopic(Locale locale)
    • getMessage

      public String getMessage(Locale locale)
    • getNotificationType

      public String getNotificationType()
    • setNotificationType

      public void setNotificationType(String notificationType)
    • isNotificationForce

      public boolean isNotificationForce()
    • setNotificationForce

      public void setNotificationForce(boolean notificationForce)
    • isRead

      public boolean isRead(User user)
    • setRead

      public void setRead(User user, boolean read)
    • setDateMailed

      public void setDateMailed(User user)
    • equals

      public boolean equals(Object another)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object