Interface CommentStorage

All Known Implementing Classes:
CommentStorageImpl

public interface CommentStorage
  • Method Details

    • getComment

      CommentDto getComment(long commentId)
    • getCommentsWithSubs

      List<CommentDto> getCommentsWithSubs(long taskId, int offset, int limit)
    • getComments

      List<CommentDto> getComments(long taskId, int offset, int limit)
    • countComments

      int countComments(long taskId)
    • addComment

      CommentDto addComment(TaskDto task, String username, String commentText) throws EntityNotFoundException
      Throws:
      EntityNotFoundException
    • addComment

      CommentDto addComment(TaskDto task, long parentCommentId, String username, String comment) throws EntityNotFoundException
      Throws:
      EntityNotFoundException
    • removeComment

      void removeComment(long commentId) throws EntityNotFoundException
      Throws:
      EntityNotFoundException
    • loadSubComments

      List<CommentDto> loadSubComments(List<CommentDto> listComments)
      Fetch sub comments of designed comments
      Parameters:
      listComments - the given list of comments.
      Returns:
      List of SubComments
    • countCommentsWithSubs

      int countCommentsWithSubs(long taskId)
      Retrieves the Task comments including sub-comments
      Parameters:
      taskId - Task identifier
      Returns:
      Integer
    • getLastComment

      CommentDto getLastComment(long taskId)
      Parameters:
      taskId - Task identifier
      Returns:
      null if no comments else last created comment on task
    • getCommentsSummaries

      Map<Long, CommentsSummaryDto> getCommentsSummaries(Collection<Long> taskIds)
      Summarizes the comments of several tasks in two queries, whatever their number.
      Parameters:
      taskIds - the tasks
      Returns:
      for each of them that has comments, the number of its comments, replies included, and its latest comment's date and author; the tasks without comments are absent