public class DefaultLikeManager extends Object implements LikeManager
| Constructor and Description |
|---|
DefaultLikeManager(org.springframework.transaction.PlatformTransactionManager transactionManager,
LikeEntityDao dao,
com.atlassian.event.api.EventPublisher publisher,
PermissionManager permissionManager,
ConfluenceAccessManager confluenceAccessManager,
ContentEntityManager contentEntityManager,
AccessModeService accessModeService) |
| Modifier and Type | Method and Description |
|---|---|
Like |
addLike(ContentEntityObject contentEntity,
com.atlassian.user.User user)
Add a like for the provided user.
|
Map<com.atlassian.bonnie.Searchable,Integer> |
countLikes(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
|
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,
com.atlassian.user.User user)
Returns true if the provided user likes this content entity.
|
void |
removeAllLikesFor(String username)
Removes all likes (for any user) from the specified content entity.
|
void |
removeAllLikesFor(@NonNull com.atlassian.sal.api.user.UserKey key)
Remove all likes for the given userkey.
|
void |
removeAllLikesOn(ContentEntityObject contentEntity)
Removes all likes (for any user) from the specified content entity.
|
void |
removeLike(ContentEntityObject contentEntity,
com.atlassian.user.User user)
Remove like from content entity for the current logged in user.
|
public DefaultLikeManager(org.springframework.transaction.PlatformTransactionManager transactionManager,
LikeEntityDao dao,
com.atlassian.event.api.EventPublisher publisher,
PermissionManager permissionManager,
ConfluenceAccessManager confluenceAccessManager,
ContentEntityManager contentEntityManager,
AccessModeService accessModeService)
public Like addLike(ContentEntityObject contentEntity, com.atlassian.user.User user)
LikeManageraddLike in interface LikeManagercontentEntity - the content entity to add a like touser - the userpublic void removeLike(ContentEntityObject contentEntity, com.atlassian.user.User user)
LikeManagerremoveLike in interface LikeManagercontentEntity - content entity to remove like fromuser - the userpublic void removeAllLikesOn(ContentEntityObject contentEntity)
LikeManagerremoveAllLikesOn in interface LikeManagercontentEntity - content entitypublic void removeAllLikesFor(String username)
LikeManagerremoveAllLikesFor in interface LikeManagerusername - the name of the user to remove all likes forpublic void removeAllLikesFor(@NonNull com.atlassian.sal.api.user.UserKey key)
LikeManagerremoveAllLikesFor in interface LikeManagerkey - a userKey. If no such user exists, this method will be a noop.public boolean hasLike(ContentEntityObject contentEntity, com.atlassian.user.User user)
LikeManagerhasLike in interface LikeManagercontentEntity - the content entityuser - the user who would like this contentpublic List<Like> getLikes(ContentEntityObject contentEntity)
LikeManagergetLikes in interface LikeManagercontentEntity - the content entitypublic Map<Long,List<Like>> getLikes(Collection<? extends ContentEntityObject> contentEntities)
LikeManagergetLikes in interface LikeManagercontentEntities - content entitiespublic Map<com.atlassian.bonnie.Searchable,Integer> countLikes(Collection<? extends com.atlassian.bonnie.Searchable> searchables)
LikeManagercountLikes in interface LikeManagersearchables - A searchable object whose ID must be setpublic int countLikes(com.atlassian.bonnie.Searchable searchable)
LikeManagercountLikes in interface LikeManagersearchable - A searchable object whose ID must be setCopyright © 2003–2020 Atlassian. All rights reserved.