com.atlassian.confluence.like
Class HibernateLikeDao

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

public class HibernateLikeDao
extends Object
implements LikeDao


Constructor Summary
HibernateLikeDao(net.sf.hibernate.SessionFactory sessionFactory, PermissionManager permissionManager)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateLikeDao

public HibernateLikeDao(net.sf.hibernate.SessionFactory sessionFactory,
                        PermissionManager permissionManager)
Method Detail

addLike

public void addLike(ContentEntityObject contentEntity)
Description copied from interface: LikeDao
Add a like for the current 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
Rremove like from content entity for the current logged in user.

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

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(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)
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.

getLikes

public 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 Map<Long,List<Like>> getLikes(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.


Copyright © 2003-2012 Atlassian. All Rights Reserved.