Class DeliveryContextImpl<T>
java.lang.Object
com.flowable.notification.engine.impl.DeliveryContextImpl<T>
- All Implemented Interfaces:
DeliveryContext<T>
public class DeliveryContextImpl<T> extends java.lang.Object implements DeliveryContext<T>
- Author:
- Filip Hrisafov
-
Field Summary
Fields Modifier and Type Field Description protected boolean
messageDelivered
protected NotificationMessageProvider<T>
messageProvider
protected Notification
notification
protected java.lang.String
recipientId
-
Constructor Summary
Constructors Constructor Description DeliveryContextImpl(NotificationMessageProvider<T> messageProvider, Notification notification, java.lang.String recipientId)
-
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
.Notification
getNotification()
The information for sending the information.java.lang.String
getRecipientId()
The id of the user that needs to receive the messageboolean
isMessageDelivered()
Whether a message has already been delivered.void
setMessageDelivered(boolean messageDelivered)
Set whether the message has been delivered
-
Field Details
-
messageProvider
-
notification
-
recipientId
protected final java.lang.String recipientId -
messageDelivered
protected boolean messageDelivered
-
-
Constructor Details
-
DeliveryContextImpl
public DeliveryContextImpl(NotificationMessageProvider<T> messageProvider, Notification notification, java.lang.String recipientId)
-
-
Method Details
-
getMessage
Description copied from interface:DeliveryContext
The message that needs to be sent with it's payload for the provideddeliverer
.- Specified by:
getMessage
in interfaceDeliveryContext<T>
- Returns:
- the message that needs to be sent
-
getNotification
Description copied from interface:DeliveryContext
The information for sending the information. Such as whether a push is needed, or something similar- Specified by:
getNotification
in interfaceDeliveryContext<T>
- Returns:
- the notification information
-
getRecipientId
public java.lang.String getRecipientId()Description copied from interface:DeliveryContext
The id of the user that needs to receive the message- Specified by:
getRecipientId
in interfaceDeliveryContext<T>
- Returns:
- the id of the user that needs to received the message
-
isMessageDelivered
public boolean isMessageDelivered()Description copied from interface:DeliveryContext
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.- Specified by:
isMessageDelivered
in interfaceDeliveryContext<T>
- Returns:
- whether the message has been delivered
-
setMessageDelivered
public void setMessageDelivered(boolean messageDelivered)Description copied from interface:DeliveryContext
Set whether the message has been delivered- Specified by:
setMessageDelivered
in interfaceDeliveryContext<T>
- Parameters:
messageDelivered
- flag marking that the message has been delivered
-