com.atlassian.confluence.like
Class HibernateLikeDao

java.lang.Object
  extended by com.atlassian.confluence.like.HibernateLikeDao
All Implemented Interfaces:
LikeDao

public class HibernateLikeDao
extends java.lang.Object
implements LikeDao


Constructor Summary
HibernateLikeDao(LikeEntityDao likeEntityDao)
           
 
Method Summary
 void addLike(ContentEntityObject contentEntity)
          Add a like on the content entity for the currently logged-in user.
 Like addLike(ContentEntityObject contentEntity, com.atlassian.user.User user)
          Add a like on the content entity for the given user.
 java.util.Map<java.lang.Long,java.util.List<Like>> getLikes(java.util.Collection<? extends ContentEntityObject> contentEntities)
          Gets all the likes for the specified content entities (likes are ordered such that recent likes come first).
 java.util.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.
 boolean hasLike(ContentEntityObject contentEntity, com.atlassian.user.User user)
          Returns true if the given user likes this content entity.
 void removeAllLikesFor(java.lang.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)
          Remove like from content entity for the currently logged-in user.
 void removeLike(ContentEntityObject contentEntity, com.atlassian.user.User user)
          Remove like from content entity for the given user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateLikeDao

public HibernateLikeDao(LikeEntityDao likeEntityDao)
Method Detail

addLike

public Like addLike(ContentEntityObject contentEntity,
                    com.atlassian.user.User user)
Description copied from interface: LikeDao
Add a like on the content entity for the given user.

Specified by:
addLike in interface LikeDao
Parameters:
contentEntity - the content entity to add a like to
user - User liking the content
Returns:
the created Like

removeLike

public void removeLike(ContentEntityObject contentEntity,
                       com.atlassian.user.User user)
Description copied from interface: LikeDao
Remove like from content entity for the given user.

Specified by:
removeLike in interface LikeDao
Parameters:
contentEntity - content entity to remove like from
user - User removing their Like

removeAllLikesOn

public void removeAllLikesOn(ContentEntityObject contentEntity)
Description copied from interface: LikeDao
Removes all likes (for any user) from the specified content entity.

Specified by:
removeAllLikesOn in interface LikeDao
Parameters:
contentEntity - content entity

removeAllLikesFor

public void removeAllLikesFor(java.lang.String username)
Description copied from interface: LikeDao
Removes all likes (for any user) from the specified content entity.

Specified by:
removeAllLikesFor in interface LikeDao
Parameters:
username - the name of the user to remove all likes for

hasLike

public boolean hasLike(ContentEntityObject contentEntity,
                       com.atlassian.user.User user)
Description copied from interface: LikeDao
Returns true if the given user likes this content entity.

Specified by:
hasLike in interface LikeDao
Parameters:
contentEntity - the content entity
user - the User the Like is being checked for
Returns:
true if the user likes this content entity.

getLikes

public java.util.List<Like> getLikes(ContentEntityObject contentEntity)
Description copied from interface: LikeDao
Gets all the likes for the specified content entity (likes are ordered such that recent likes come first)

Specified by:
getLikes in interface LikeDao
Parameters:
contentEntity - the content entity
Returns:
all the likes for the specified content entity.

getLikes

public java.util.Map<java.lang.Long,java.util.List<Like>> getLikes(java.util.Collection<? extends ContentEntityObject> contentEntities)
Description copied from interface: LikeDao
Gets all the likes for the specified content entities (likes are ordered such that recent likes come first).

Specified by:
getLikes in interface LikeDao
Parameters:
contentEntities - content entities
Returns:
a map of contentId to a set of all the likes for that piece of content.

addLike

public void addLike(ContentEntityObject contentEntity)
Description copied from interface: LikeDao
Add a like on the content entity for the currently logged-in user.

Specified by:
addLike in interface LikeDao
Parameters:
contentEntity - the content entity to add a like to

removeLike

public void removeLike(ContentEntityObject contentEntity)
Description copied from interface: LikeDao
Remove like from content entity for the currently logged-in user.

Specified by:
removeLike in interface LikeDao
Parameters:
contentEntity - content entity to remove like from

hasLike

public boolean hasLike(ContentEntityObject contentEntity)
Description copied from interface: LikeDao
Returns true if the current logged in user likes this content entity.

Specified by:
hasLike in interface LikeDao
Parameters:
contentEntity - the content entity
Returns:
true if the current logged in user likes this content entity.


Copyright © 2003-2014 Atlassian. All Rights Reserved.