Class MessageDestinations
java.lang.Object
com.finconsgroup.itserr.marketplace.usercommunication.dm.constant.MessageDestinations
Utility class for methods related to message destinations.
-
Constructor Summary
ConstructorsConstructorDescriptionMessageDestinations(WebSocketConfigurationProperties webSocketConfigurationProperties) -
Method Summary
Modifier and TypeMethodDescriptionextractConversationId(String destination) Determines if the destination is for topic for conversation.getConversationChildTopic(UUID conversationId, String child) Constructs the topic name for the conversation relate child topic to send the STOMP messages to.getConversationTopic(UUID conversationId) Constructs the topic name for the conversation to send the STOMP messages to.getConversationTypingTopic(UUID conversationId) Constructs the topic name for the conversation typing indicator to send the STOMP messages to.Constructs the topic name for the broadcasting messages for users that remain unresolved.Constructs the topic name for the broadcasting user registry messages.booleanisTopicConversation(String destination) Determines if the destination is for topic for conversation.booleanisUserMessages(String destination) Determines if the destination is for user messages.booleanisUserMessagesOrTopicConversation(String destination) Determines if the destination is for user messages or for topic for conversation.booleanisUserNotifications(String destination) Determines if the destination is for user notifications.
-
Constructor Details
-
MessageDestinations
-
-
Method Details
-
getUserMessagesSuffix
- Returns:
- the user messages suffix
-
getUserNotificationsSuffix
- Returns:
- the user notifications suffix
-
getUserInvitationsSuffix
- Returns:
- the user invitations suffix
-
isUserMessages
Determines if the destination is for user messages.- Parameters:
destination- the destination- Returns:
trueif it is,falseotherwise.
-
isUserNotifications
Determines if the destination is for user notifications.- Parameters:
destination- the destination- Returns:
trueif it is,falseotherwise.
-
isTopicConversation
Determines if the destination is for topic for conversation.- Parameters:
destination- the destination- Returns:
trueif it is,falseotherwise.
-
isUserMessagesOrTopicConversation
Determines if the destination is for user messages or for topic for conversation.- Parameters:
destination- the destination- Returns:
trueif it is,falseotherwise.
-
getConversationTopic
Constructs the topic name for the conversation to send the STOMP messages to.- Parameters:
conversationId- the conversation id- Returns:
- the conversation topic name
-
getConversationTypingTopic
Constructs the topic name for the conversation typing indicator to send the STOMP messages to.- Parameters:
conversationId- the conversation id *- Returns:
- the conversation typing topic name
-
getConversationChildTopic
Constructs the topic name for the conversation relate child topic to send the STOMP messages to.- Parameters:
conversationId- the conversation idchild- the child topic name- Returns:
- the conversation typing topic name
-
getUserDestinationBroadcastTopic
Constructs the topic name for the broadcasting messages for users that remain unresolved.- Returns:
- the user destination broadcast topic name
-
getUserRegistryBroadcastTopic
Constructs the topic name for the broadcasting user registry messages.- Returns:
- the user registry broadcast topic name
-
extractConversationId
Determines if the destination is for topic for conversation. If yes, then retrieves and returns the conversation id from the destination name.- Parameters:
destination- the destination- Returns:
- the conversation id if it is valid.
- Throws:
IllegalArgumentException- if it does not have a valid conversation id
-