com.atlassian.confluence.like
Interface LikeManager

All Known Implementing Classes:
DefaultLikeManager

public interface LikeManager

Controls all access to Like-ing and Unlike-ing content.

Since:
4.3

Method Summary
 Like addLike(ContentEntityObject contentEntity)
          Deprecated. since 4.3.1 - Use addLike(com.atlassian.confluence.core.ContentEntityObject, com.atlassian.user.User) with AuthenticatedUserThreadLocal.get() instead.
 Like addLike(ContentEntityObject contentEntity, com.atlassian.user.User user)
          Add a like for the provided user.
 java.util.Map<com.atlassian.bonnie.Searchable,java.lang.Integer> countLikes(java.util.Collection<? extends com.atlassian.bonnie.Searchable> searchables)
          Count the number of likes for the given objects
 int countLikes(com.atlassian.bonnie.Searchable searchable)
          Count the number of likes for the given object
 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)
          Deprecated. since 4.3.1 - Use hasLike(com.atlassian.confluence.core.ContentEntityObject, com.atlassian.user.User) with AuthenticatedUserThreadLocal.get() instead.
 boolean hasLike(ContentEntityObject contentEntity, com.atlassian.user.User user)
          Returns true if the provided 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 content)
          Removes all likes (for any user) from the specified content entity.
 void removeLike(ContentEntityObject contentEntity)
          Deprecated. since 4.3.1 - Use removeLike(com.atlassian.confluence.core.ContentEntityObject, com.atlassian.user.User) with AuthenticatedUserThreadLocal.get() instead.
 void removeLike(ContentEntityObject contentEntity, com.atlassian.user.User user)
          Remove like from content entity for the current logged in user.
 

Method Detail

addLike

Like addLike(ContentEntityObject contentEntity)
Deprecated. since 4.3.1 - Use addLike(com.atlassian.confluence.core.ContentEntityObject, com.atlassian.user.User) with AuthenticatedUserThreadLocal.get() instead.


addLike

Like addLike(ContentEntityObject contentEntity,
             com.atlassian.user.User user)
Add a like for the provided user.

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

removeLike

void removeLike(ContentEntityObject contentEntity)
Deprecated. since 4.3.1 - Use removeLike(com.atlassian.confluence.core.ContentEntityObject, com.atlassian.user.User) with AuthenticatedUserThreadLocal.get() instead.


removeLike

void removeLike(ContentEntityObject contentEntity,
                com.atlassian.user.User user)
Remove like from content entity for the current logged in user.

Parameters:
user - the user
contentEntity - content entity to remove like from

removeAllLikesOn

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

Parameters:
content - content entity

removeAllLikesFor

void removeAllLikesFor(java.lang.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)
Deprecated. since 4.3.1 - Use hasLike(com.atlassian.confluence.core.ContentEntityObject, com.atlassian.user.User) with AuthenticatedUserThreadLocal.get() instead.


hasLike

boolean hasLike(ContentEntityObject contentEntity,
                com.atlassian.user.User user)
Returns true if the provided user likes this content entity.

Parameters:
contentEntity - the content entity
user - the user who would like this content
Returns:
true if the provided user likes this content entity.

getLikes

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)

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

getLikes

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

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

countLikes

java.util.Map<com.atlassian.bonnie.Searchable,java.lang.Integer> countLikes(java.util.Collection<? extends com.atlassian.bonnie.Searchable> searchables)
Count the number of likes for the given objects

Parameters:
searchables - A searchable object whose ID must be set
Returns:
A map mapping the object to the number of likes it has. If an object no longer exists, it has 0 likes.

countLikes

int countLikes(com.atlassian.bonnie.Searchable searchable)
Count the number of likes for the given object

Parameters:
searchable - A searchable object whose ID must be set
Returns:
The number of likes it has. If an object no longer exists, it has 0 likes.


Copyright © 2003-2014 Atlassian. All Rights Reserved.