java.lang.Object
com.finconsgroup.itserr.marketplace.usercommunication.dm.constant.MessageDestinations

@Component public final class MessageDestinations extends Object
Utility class for methods related to message destinations.
  • Constructor Details

  • Method Details

    • getUserMessagesSuffix

      public String getUserMessagesSuffix()
      Returns:
      the user messages suffix
    • getUserNotificationsSuffix

      public String getUserNotificationsSuffix()
      Returns:
      the user notifications suffix
    • getUserInvitationsSuffix

      public String getUserInvitationsSuffix()
      Returns:
      the user invitations suffix
    • isUserMessages

      public boolean isUserMessages(String destination)
      Determines if the destination is for user messages.
      Parameters:
      destination - the destination
      Returns:
      true if it is, false otherwise.
    • isUserNotifications

      public boolean isUserNotifications(String destination)
      Determines if the destination is for user notifications.
      Parameters:
      destination - the destination
      Returns:
      true if it is, false otherwise.
    • isTopicConversation

      public boolean isTopicConversation(String destination)
      Determines if the destination is for topic for conversation.
      Parameters:
      destination - the destination
      Returns:
      true if it is, false otherwise.
    • isUserMessagesOrTopicConversation

      public boolean isUserMessagesOrTopicConversation(String destination)
      Determines if the destination is for user messages or for topic for conversation.
      Parameters:
      destination - the destination
      Returns:
      true if it is, false otherwise.
    • getConversationTopic

      public String getConversationTopic(UUID conversationId)
      Constructs the topic name for the conversation to send the STOMP messages to.
      Parameters:
      conversationId - the conversation id
      Returns:
      the conversation topic name
    • getConversationTypingTopic

      public String getConversationTypingTopic(UUID conversationId)
      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

      public String getConversationChildTopic(UUID conversationId, String child)
      Constructs the topic name for the conversation relate child topic to send the STOMP messages to.
      Parameters:
      conversationId - the conversation id
      child - the child topic name
      Returns:
      the conversation typing topic name
    • getUserDestinationBroadcastTopic

      public String getUserDestinationBroadcastTopic()
      Constructs the topic name for the broadcasting messages for users that remain unresolved.
      Returns:
      the user destination broadcast topic name
    • getUserRegistryBroadcastTopic

      public String getUserRegistryBroadcastTopic()
      Constructs the topic name for the broadcasting user registry messages.
      Returns:
      the user registry broadcast topic name
    • extractConversationId

      @NonNull public UUID extractConversationId(@NonNull String destination)
      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