com.atlassian.confluence.pages.persistence.dao
Interface CommentDao

All Superinterfaces:
ObjectDao
All Known Implementing Classes:
HibernateCommentDao

public interface CommentDao
extends ObjectDao


Field Summary
 
Fields inherited from interface bucket.core.persistence.ObjectDao
NON_CACHEABLE
 
Method Summary
 Map<com.atlassian.bonnie.Searchable,Integer> countComments(Collection<? extends com.atlassian.bonnie.Searchable> searchables)
          Count all comments for each content in a collection
 int countComments(com.atlassian.bonnie.Searchable searchable)
          Count all comments in a searchable content
 Map<Long,Integer> countUnresolvedComments(Collection<Long> containerIds)
          Count unresolved comments of comment containers.
 Comment getById(long id)
          Get a comment by its id
 PageResponse<Comment> getChildren(Comment comment, LimitedRequest pageRequest, Depth depth, com.google.common.base.Predicate<? super Comment>... predicates)
          Get the children of a comment
 List<Comment> getPageComments(long pageId, Date since)
          Get the comments that have been added or updated since a specific time
 List<Comment> getPageComments(long pageId, Date since, String ignoreUsername)
          Get the comments that have been added or updated since a specific time but not by a user
 PageResponse<Comment> getPageComments(long pageId, LimitedRequest pageRequest, Depth depth, com.google.common.base.Predicate<? super Comment>... predicates)
          Get the comments belonging to a page
 Iterator getRecentlyUpdatedComments(long spaceId, int maxResults)
          Get all comments that have been updated recently in a space
 
Methods inherited from interface bucket.core.persistence.ObjectDao
findAll, findAllSorted, findAllSorted, getPersistentClass, refresh, remove, replicate, save, saveRaw
 

Method Detail

getById

Comment getById(long id)
Get a comment by its id

Parameters:
id - the comment's id
Returns:
the comment object

getRecentlyUpdatedComments

Iterator getRecentlyUpdatedComments(long spaceId,
                                    int maxResults)
Get all comments that have been updated recently in a space

Parameters:
spaceId - the space's id
maxResults - the maximum number of comments that can be retrieved
Returns:
a Iterator object that encapsulates the list of comments found

getPageComments

List<Comment> getPageComments(long pageId,
                              Date since)
Get the comments that have been added or updated since a specific time

Parameters:
pageId - the page's id
since - Date the time after which the comments have been added or updated
Returns:
a list of comments created or updated

getPageComments

List<Comment> getPageComments(long pageId,
                              Date since,
                              String ignoreUsername)
Get the comments that have been added or updated since a specific time but not by a user

Parameters:
pageId - the page's id
since - Date the time after which the comments have been added or updated
ignoreUsername - the user to be ignored
Returns:
a list of comments created or updated

getPageComments

PageResponse<Comment> getPageComments(long pageId,
                                      LimitedRequest pageRequest,
                                      Depth depth,
                                      com.google.common.base.Predicate<? super Comment>... predicates)
Get the comments belonging to a page

Parameters:
pageId - the page's id
pageRequest - the pagination info
depth - the search depth
predicates - the predicates used to filter the children
Returns:
a PageResponse object that encapsulates the comments

countComments

Map<com.atlassian.bonnie.Searchable,Integer> countComments(Collection<? extends com.atlassian.bonnie.Searchable> searchables)
Count all comments for each content in a collection

Parameters:
searchables - a collection of Searchable objects representing the contents
Returns:
a map of counts for each searchable content

countComments

int countComments(com.atlassian.bonnie.Searchable searchable)
Count all comments in a searchable content

Parameters:
searchable - a Searchable object representing the content
Returns:
a number of comments in the searchable content

getChildren

PageResponse<Comment> getChildren(Comment comment,
                                  LimitedRequest pageRequest,
                                  Depth depth,
                                  com.google.common.base.Predicate<? super Comment>... predicates)
Get the children of a comment

Parameters:
comment - the parent comment
pageRequest - the pagination info
depth - the search depth
predicates - the predicates used to filter the children
Returns:
the PageResponse object that encapsulates the children comments

countUnresolvedComments

Map<Long,Integer> countUnresolvedComments(@Nonnull
                                          Collection<Long> containerIds)
Count unresolved comments of comment containers.

Parameters:
containerIds - the list of comment containers ids
Returns:
The map of container id and its unresolved comment count
Since:
5.7


Copyright © 2003–2015 Atlassian. All rights reserved.