All Known Implementing Classes:
ConversationServiceImpl

public interface ConversationService
Service contract for managing conversations (direct and group). Each method is documented to improve generated JavaDoc and maintainability.
  • Method Details

    • getConversation

      OutputConversationDto getConversation(UUID userId, UUID conversationId)
      Get conversation details by ID.
      Parameters:
      userId - the user id
      conversationId - the conversation ID
      Returns:
      Output conversation if found
    • getRecentConversationsForUser

      org.springframework.data.domain.Page<OutputConversationDto> getRecentConversationsForUser(UUID userId, org.springframework.data.domain.Pageable pageable)
      Get recently active conversations for a user.
      Parameters:
      userId - the user ID
      pageable - the pageable containing requested paging and sorting information
      Returns:
      page of conversations ordered by recent activity
    • getConversationMessages

      org.springframework.data.domain.Page<OutputChatMessageDto> getConversationMessages(UUID userId, UUID conversationId, org.springframework.data.domain.Pageable pageable)
      Get recent messages for conversation.
      Parameters:
      userId - the user ID
      conversationId - the conversation ID
      pageable - the pageable containing requested paging and sorting information
      Returns:
      page of conversations ordered by recent activity
    • getConversationParticipants

      List<OutputConversationParticipantDto> getConversationParticipants(UUID conversationId)
      Get all participants for a conversation.
      Parameters:
      conversationId - the conversation ID
      Returns:
      list of participants
    • isUserParticipant

      boolean isUserParticipant(UUID conversationId, UUID userId)
      Check if a user is a participant in the conversation.
      Parameters:
      conversationId - the conversation ID
      userId - the user ID
      Returns:
      true if the user is an active participant
    • muteConversation

      void muteConversation(UUID conversationId, UUID userId, boolean muted)
      Mute or unmute a conversation for a user.
      Parameters:
      conversationId - the conversation ID
      userId - the user ID
      muted - true to mute, false to unmute
    • markConversationAsRead

      void markConversationAsRead(@NonNull UUID userId, @NonNull UUID conversationId)
      Mark all messages in the conversation as read for a user.
      Parameters:
      userId - the user ID
      conversationId - the conversation ID
    • markConversationUptoMessageAsRead

      void markConversationUptoMessageAsRead(@NonNull UUID userId, @NonNull UUID conversationId, @NonNull UUID messageId)
      Mark all messages in the conversation as read for a user upto the message id provided.
      Parameters:
      userId - the user ID
      conversationId - the conversation ID
      messageId - the message ID
    • markBulkMessagesAsRead

      void markBulkMessagesAsRead(@NonNull UUID userId, @NonNull UUID conversationId, @NonNull InputBulkMessagesDto request)
      Mark all messages in the conversation as read for a user for the bulk messages request.
      Parameters:
      userId - the user ID
      conversationId - the conversation ID
      request - the input bulk messages request
    • getConversationsWithUnreadMessages

      List<ConversationParticipant> getConversationsWithUnreadMessages(UUID userId)
      Get conversations along with unread message information for a user.
      Parameters:
      userId - the user ID
      Returns:
      list of participant records including unread state
    • leaveConversation

      void leaveConversation(UUID conversationId, UUID userId)
      Leave the conversation as a user.
      Parameters:
      conversationId - the conversation ID
      userId - the user ID
    • searchConversations

      OutputSearchResultDto searchConversations(UUID userId, String searchTerm, org.springframework.data.domain.Pageable pageable)
      Search conversations by a free-text term (e.g., by name/description for non-direct chats).
      Parameters:
      userId - the user ID
      searchTerm - free-text term
      pageable - the pageable containing requested paging and sorting information
      Returns:
      list of matching conversations/messages
    • getConversationStats

      OutputConversationStatsDto getConversationStats()
      Get aggregated counts for direct and group conversations.
      Returns:
      conversation statistics DTO