All Known Implementing Classes:
ChatMessageServiceImpl

public interface ChatMessageService
  • Method Details

    • handleChatMessage

      void handleChatMessage(ChatMessage chatMessage)
      Handles chat messages from the chat queue
    • handleUserNotification

      void handleUserNotification(ChatMessage chatMessage)
      Handles user notification messages from queue
    • getConversationMessages

      List<ChatMessage> getConversationMessages(UUID conversationId)
      Get messages for a specific conversation
    • getConversationMessageSummary

      Map<UUID,OutputConversationMessageSummaryDto> getConversationMessageSummary(UUID userId, List<Conversation> conversations)
      Get message summary for each conversation for the conversations
    • getConversationMessages

      org.springframework.data.domain.Page<OutputChatMessageDto> getConversationMessages(Conversation conversation, org.springframework.data.domain.Pageable pageable)
      Get a page of chat messages for the conversation
    • markConversationAsRead

      int markConversationAsRead(Conversation conversation, UUID userId, Instant readAt)
      Mark all unread messages in a conversation as read by a specific user.
    • markConversationMessagesUptoCreatedAtAsRead

      int markConversationMessagesUptoCreatedAtAsRead(Conversation conversation, UUID userId, Instant readAt, Instant uptoCreatedAt)
      Mark all unread messages in a conversation as read by a specific user for the messages created at or before.
    • markConversationBulkMessagesAsRead

      int markConversationBulkMessagesAsRead(Conversation conversation, UUID userId, Instant readAt, Set<UUID> messageIds)
      Mark all unread messages in a conversation as read by a specific user for the passed ids.
    • getUserNotifications

      List<ChatMessage> getUserNotifications(UUID userId)
      Get notifications for a specific user (messages where receiverId matches userId)
    • clearUserNotifications

      void clearUserNotifications(UUID userId)
      Clear notifications for a user (delete notification messages for the user)
    • searchMessages

      org.springframework.data.domain.Page<OutputChatMessageDto> searchMessages(UUID userId, String searchTerm, org.springframework.data.domain.Pageable pageable)
      Get a page of chat messages matching the search term
      Parameters:
      userId - the user ID
      searchTerm - free-text term
      pageable - the pageable containing requested paging and sorting information
      Returns:
      list of matching messages
    • getOutputChatMessageDto

      OutputChatMessageDto getOutputChatMessageDto(@NonNull ChatMessage chatMessage, boolean loadUserProfiles)
      Maps the chat message entity to output dto
      Parameters:
      chatMessage - the chat message entity
      loadUserProfiles - flag to indicate if user profiles should be loaded to fetch chat user details e.g. sender
      Returns:
      the output chat message dto