Interface DeliveryContext<T>

All Known Implementing Classes:
DeliveryContextImpl

public interface DeliveryContext<T>
A delivery context that is used for sending messages.
Author:
Filip Hrisafov
  • Method Summary

    Modifier and Type Method Description
    java.util.Optional<NotificationMessage<T>> getMessage​(java.lang.String deliverer)
    The message that needs to be sent with it's payload for the provided deliverer.
    Notification getNotification()
    The information for sending the information.
    java.lang.String getRecipientId()
    The id of the user that needs to receive the message
    boolean isMessageDelivered()
    Whether a message has already been delivered.
    void setMessageDelivered​(boolean messageDelivered)
    Set whether the message has been delivered
  • Method Details

    • getMessage

      java.util.Optional<NotificationMessage<T>> getMessage​(java.lang.String deliverer)
      The message that needs to be sent with it's payload for the provided deliverer.
      Returns:
      the message that needs to be sent
    • getNotification

      Notification getNotification()
      The information for sending the information. Such as whether a push is needed, or something similar
      Returns:
      the notification information
    • getRecipientId

      java.lang.String getRecipientId()
      The id of the user that needs to receive the message
      Returns:
      the id of the user that needs to received the message
    • isMessageDelivered

      boolean isMessageDelivered()
      Whether a message has already been delivered. This is used for communication between different MessageDeliverer(s) in order to decide whether a message needs to be sent.
      Returns:
      whether the message has been delivered
    • setMessageDelivered

      void setMessageDelivered​(boolean messageDelivered)
      Set whether the message has been delivered
      Parameters:
      messageDelivered - flag marking that the message has been delivered