com.atlassian.confluence.like
Class DefaultLikeManager

java.lang.Object
  extended by com.atlassian.confluence.like.DefaultLikeManager
All Implemented Interfaces:
LikeManager

public class DefaultLikeManager
extends Object
implements LikeManager


Constructor Summary
DefaultLikeManager(LikeDao dao, com.atlassian.event.api.EventPublisher publisher, PermissionManager permissionManager)
           
 
Method Summary
 Like 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)
          Remove 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

DefaultLikeManager

public DefaultLikeManager(LikeDao dao,
                          com.atlassian.event.api.EventPublisher publisher,
                          PermissionManager permissionManager)
Method Detail

addLike

public Like addLike(ContentEntityObject contentEntity)
Description copied from interface: LikeManager
Add a like for the current logged in user.

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

removeLike

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

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

removeAllLikesOn

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

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

removeAllLikesFor

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

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

hasLike

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

Specified by:
hasLike in interface LikeManager
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: LikeManager
Gets all the likes for the specified content entity (likes are ordered such that recent likes come first)

Specified by:
getLikes in interface LikeManager
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: LikeManager
Gets all the likes for the specified content entities (likes are ordered such that recent likes come first).

Specified by:
getLikes in interface LikeManager
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.