Interface DeliveryContext<T>
-
public interface DeliveryContext<T>A delivery context that is used for sending messages.- Author:
- Filip Hrisafov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<NotificationMessage<T>>getMessage(String deliverer)The message that needs to be sent with it's payload for the provideddeliverer.NotificationgetNotification()The information for sending the information.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 Detail
-
getMessage
Optional<NotificationMessage<T>> getMessage(String deliverer)
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
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
-
-