com.atlassian.confluence.like
Interface LikeDao

All Known Implementing Classes:
EventPublishingLikeDao, HibernateLikeDao

public interface LikeDao

Persists and retrieves likes. Likes will be exposed via the transfer object Like.


Method Summary
 void addLike(ContentEntityObject contentEntity)
          Add a like for the current logged in user.
 Map<Long,List<Like>> getLikes(Collection<? extends ContentEntityObject> contentEntities)
          Gets all the likes for the specified content entities (likes are ordered such that recent likes come first).
 List<Like> getLikes(ContentEntityObject contentEntity)
          Gets all the likes for the specified content entity (likes are ordered such that recent likes come first)
 boolean hasLike(ContentEntityObject contentEntity)
          Returns true if the current logged in user likes this content entity.
 void removeAllLikesFor(String username)
          Removes all likes (for any user) from the specified content entity.
 void removeAllLikesOn(ContentEntityObject contentEntity)
          Removes all likes (for any user) from the specified content entity.
 void removeLike(ContentEntityObject contentEntity)
          Rremove like from content entity for the current logged in user.
 

Method Detail

addLike

void addLike(ContentEntityObject contentEntity)
Add a like for the current logged in user.

Parameters:
contentEntity - the content entity to add a like to

removeLike

void removeLike(ContentEntityObject contentEntity)
Rremove like from content entity for the current logged in user.

Parameters:
contentEntity - content entity to remove like from

removeAllLikesOn

void removeAllLikesOn(ContentEntityObject contentEntity)
Removes all likes (for any user) from the specified content entity.

Parameters:
contentEntity - content entity

removeAllLikesFor

void removeAllLikesFor(String username)
Removes all likes (for any user) from the specified content entity.

Parameters:
username - the name of the user to remove all likes for

hasLike

boolean hasLike(ContentEntityObject contentEntity)
Returns true if the current logged in user likes this content entity.

Parameters:
contentEntity - the content entity
Returns:
true if the current logged in user likes this content entity.

getLikes

List<Like> getLikes(ContentEntityObject contentEntity)
Gets all the likes for the specified content entity (likes are ordered such that recent likes come first)

Parameters:
contentEntity - the content entity
Returns:
all the likes for the specified content entity.

getLikes

Map<Long,List<Like>> getLikes(Collection<? extends ContentEntityObject> contentEntities)
Gets all the likes for the specified content entities (likes are ordered such that recent likes come first).

Parameters:
contentEntities - content entities
Returns:
a map of contentId to a set of all the likes for that piece of content.


Copyright © 2003-2012 Atlassian. All Rights Reserved.