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.StringmessageDestinationprotected org.springframework.messaging.simp.SimpMessagingTemplatemessagingTemplateprotected org.springframework.messaging.simp.user.SimpUserRegistryuserRegistry -
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 booleancanDeliver(java.lang.String userId)java.lang.StringgetDelivererType()The type of the message deliverer.intgetPriority()voidsendMessage(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:MessageDelivererPerform 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:
sendMessagein 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:MessageDelivererThe type of the message deliverer. Usually used to create a message based on the type- Specified by:
getDelivererTypein interfaceMessageDeliverer- Returns:
- type of the deliverer
-
getPriority
public int getPriority()- Specified by:
getPriorityin interfaceMessageDeliverer
-