Package com.atlassian.jira.reactions
Class DefaultCommentReactionsService
java.lang.Object
com.atlassian.jira.reactions.DefaultCommentReactionsService
- All Implemented Interfaces:
Startable,CommentReactionsService
public class DefaultCommentReactionsService
extends Object
implements CommentReactionsService, Startable
- Since:
- 8.17, 8.21 added the product type key to identify if reactions are coming from Jira or JSM projects
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultCommentReactionsService(CommentReactionManager commentReactionManager, UserManager userManager, PermissionManager permissionManager, CommentService commentService, CommentReactionsEnabledService commentReactionsEnabledService, CommentPermissionManager commentPermissionManager, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionaddReaction(ApplicationUser loggedInUser, long commentId, String emojiId) Checks whether the user already reacted to the comment with given emoji, and if not, adds a reaction.deleteReaction(ApplicationUser loggedInUser, Long commentId, String emojiId) Deletes a reaction.getDetailedReaction(ApplicationUser loggedInUser, Long commentId, String emoji) Gets the details of the reaction containing Unicode of the emoji and a list of users who reacted with it.getReactions(ApplicationUser loggedInUser, Collection<Long> commentIds) Gets all reactions for a given comment.voidvoidstart()This method will be called after the plugin system is fully initialised and all components added to the dependency injection framework.
-
Constructor Details
-
DefaultCommentReactionsService
public DefaultCommentReactionsService(CommentReactionManager commentReactionManager, UserManager userManager, PermissionManager permissionManager, CommentService commentService, CommentReactionsEnabledService commentReactionsEnabledService, CommentPermissionManager commentPermissionManager, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Details
-
start
public void start()Description copied from interface:StartableThis method will be called after the plugin system is fully initialised and all components added to the dependency injection framework. -
onCommentDeleted
-
getReactions
@Nonnull public ServiceOutcome<Collection<ReactionSummary>> getReactions(@Nonnull ApplicationUser loggedInUser, Collection<Long> commentIds) Description copied from interface:CommentReactionsServiceGets all reactions for a given comment.- Specified by:
getReactionsin interfaceCommentReactionsService- Parameters:
loggedInUser- the user performing operationcommentIds- comments ids- Returns:
- a collection of
ReactionSummary
-
getDetailedReaction
public ServiceOutcome<ReactionSummary> getDetailedReaction(@Nonnull ApplicationUser loggedInUser, Long commentId, String emoji) Description copied from interface:CommentReactionsServiceGets the details of the reaction containing Unicode of the emoji and a list of users who reacted with it.- Specified by:
getDetailedReactionin interfaceCommentReactionsService- Parameters:
loggedInUser- the user performing operationcommentId- the ID of the commentemoji- Unicode of the emoji- Returns:
- the
ReactionSummaryobject
-
addReaction
public ServiceOutcome<ReactionSummary> addReaction(@Nonnull ApplicationUser loggedInUser, long commentId, String emojiId) Description copied from interface:CommentReactionsServiceChecks whether the user already reacted to the comment with given emoji, and if not, adds a reaction.- Specified by:
addReactionin interfaceCommentReactionsService- Parameters:
loggedInUser- the user performing operationcommentId- the ID of the commentemojiId- Unicode of the emoji- Returns:
- the updated
ReactionSummaryfor given emoji and given comment
-
deleteReaction
public ServiceOutcome<ReactionSummary> deleteReaction(@Nonnull ApplicationUser loggedInUser, Long commentId, String emojiId) Description copied from interface:CommentReactionsServiceDeletes a reaction. If there are duplicated reactions in the database, all matching records will be deleted.- Specified by:
deleteReactionin interfaceCommentReactionsService- Parameters:
loggedInUser- the user performing operationcommentId- the ID of the commentemojiId- Unicode of the emoji- Returns:
- the updated
ReactionSummaryfor given emoji and given comment
-