Package com.flowable.notification.simp
Class SimpMessageDeliverer
java.lang.Object
com.flowable.notification.simp.SimpMessageDeliverer
- All Implemented Interfaces:
MessageDeliverer
public class SimpMessageDeliverer extends java.lang.Object implements MessageDeliverer
A
MessageDeliverer
that uses the SimpMessagingTemplate
and the SimpUserRegistry
for delivering a message to a user.- Author:
- Filip Hrisafov
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
messageDestination
protected org.springframework.messaging.simp.SimpMessagingTemplate
messagingTemplate
protected org.springframework.messaging.simp.user.SimpUserRegistry
userRegistry
-
Constructor Summary
Constructors Constructor Description SimpMessageDeliverer(org.springframework.messaging.simp.SimpMessagingTemplate messagingTemplate, org.springframework.messaging.simp.user.SimpUserRegistry userRegistry, java.lang.String messageDestination)
-
Method Summary
Modifier and Type Method Description protected boolean
canDeliver(java.lang.String userId)
java.lang.String
getDelivererType()
The type of the message deliverer.int
getPriority()
void
sendMessage(DeliveryContext<?> deliveryContext)
Perform sending of a message using the provided delivery context.
-
Field Details
-
messagingTemplate
protected final org.springframework.messaging.simp.SimpMessagingTemplate messagingTemplate -
userRegistry
protected final org.springframework.messaging.simp.user.SimpUserRegistry userRegistry -
messageDestination
protected final java.lang.String messageDestination
-
-
Constructor Details
-
SimpMessageDeliverer
public SimpMessageDeliverer(org.springframework.messaging.simp.SimpMessagingTemplate messagingTemplate, org.springframework.messaging.simp.user.SimpUserRegistry userRegistry, java.lang.String messageDestination)
-
-
Method Details
-
sendMessage
Description copied from interface:MessageDeliverer
Perform sending of a message using the provided delivery context. The message deliverer should decide on it's own whether a message should be sent. Usually message should always be send if a user is connected in real time. Notification (offline) senders should first check if no message has been delivered and only then perform a delivery (if they can).- Specified by:
sendMessage
in interfaceMessageDeliverer
- Parameters:
deliveryContext
- the delivery context that can be used to transfer data between multiple delivers
-
canDeliver
protected boolean canDeliver(java.lang.String userId) -
getDelivererType
public java.lang.String getDelivererType()Description copied from interface:MessageDeliverer
The type of the message deliverer. Usually used to create a message based on the type- Specified by:
getDelivererType
in interfaceMessageDeliverer
- Returns:
- type of the deliverer
-
getPriority
public int getPriority()- Specified by:
getPriority
in interfaceMessageDeliverer
-