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 provideddeliverer.NotificationgetNotification()The information for sending the information.java.lang.StringgetRecipientId()The id of the user that needs to receive the messagebooleanisMessageDelivered()Whether a message has already been delivered.voidsetMessageDelivered(boolean messageDelivered)Set whether the message has been delivered
-
Method Details
-
getMessage
The message that needs to be sent with it's payload for the provideddeliverer.- 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 differentMessageDeliverer(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
-