Class NotificationSenderService.MessageContext

java.lang.Object
es.kukenan.smartfi.microservice.communication.service.NotificationSenderService.MessageContext
Enclosing class:
NotificationSenderService

public static class NotificationSenderService.MessageContext extends Object
This class is designed to hold all the required information to send a set of messages. Any additional information needed should be reachable from the data present in this class.
  • Field Details

    • user

      private final User user
      The user that is the original destination of the messages.
    • receiver

      private Receiver receiver
      The receiver for this message.
    • messageSpecialProperties

      private final MessagesRequest.MessageSpecialProperties messageSpecialProperties
      A message to be delivered.
    • campaign

      private final Campaign campaign
      Campaign.
    • currentChannel

      private NotificationChannel currentChannel
      Channel to procces this message.
    • variables

      private final Map<String,Object> variables
      A list of variables that may be used by the templates to compose the message.
    • attachments

      private Map<String,String> attachments
      A list of attachment that may be sent to the user.
    • templates

      private Set<Template> templates
      The set of templates available to send this message, only one should be used.
    • unexpectedErrors

      private final List<String> unexpectedErrors
      A list where unexpected errors must be added.
    • specificChannel

      private Boolean specificChannel
      Flag if set an specific channel.
    • channel

      private NotificationChannel channel
      Specific channel to send.
  • Constructor Details

    • MessageContext

      public MessageContext(MessagesRequest.MessageSpecialProperties messageSpecialProperties, Campaign campaign, MessagesRequest messagesRequest, List<String> unexpectedErrors)
      Constructor that use as source the information of the given MessagesRequest.
      Parameters:
      messageSpecialProperties - the message to send.
      campaign - campaign.
      messagesRequest - the messages request the message belongs to.
      unexpectedErrors - a list of unexpected errors to maintain.