Package com.atlassian.jira.mention
Class MentionServiceImpl
java.lang.Object
com.atlassian.jira.mention.MentionServiceImpl
- All Implemented Interfaces:
MentionService
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.jira.mention.MentionService
MentionService.MentionResult, MentionService.Mentions
-
Constructor Summary
ConstructorsConstructorDescriptionMentionServiceImpl
(MentionFinder finder, UserManager userManager, PermissionManager permissionManager, GlobalPermissionManager globalPermissionManager, com.atlassian.event.api.EventPublisher eventPublisher, ChangeHistoryManager changeHistoryManager, CommentPermissionManager commentPermissionManager, NotificationFilterManager notificationFilterManager, FeatureManager featureManager) -
Method Summary
Modifier and TypeMethodDescriptiongetMentionedUsers
(IssueEvent issueEvent) Returns mentioned users calculated from passedissueEvent
.boolean
isUserAbleToMention
(ApplicationUser remoteUser) Whether the specified user is able to mention other users in a Jira issue.sendCommentMentions
(Set<NotificationRecipient> currentRecipients, ApplicationUser remoteUser, Comment comment, Comment originalComment) Given a comment object this method will look for any mentions using theMentionFinder
and send e-mails to all users mentioned.sendIssueCreateMentions
(Set<NotificationRecipient> currentRecipients, ApplicationUser remoteUser, Issue issue) Given an issue object this method will look for any mentions in the description field using theMentionFinder
and send e-mails to all users mentioned.sendIssueEditMentions
(Set<NotificationRecipient> currentRecipients, ApplicationUser remoteUser, Issue issue, Comment comment) Given an issue that has just been edited and an optional edit comment this method sends mention e-mails to all users mentioned in either the new issue description or option edit comment.
-
Constructor Details
-
MentionServiceImpl
public MentionServiceImpl(MentionFinder finder, UserManager userManager, PermissionManager permissionManager, GlobalPermissionManager globalPermissionManager, com.atlassian.event.api.EventPublisher eventPublisher, ChangeHistoryManager changeHistoryManager, CommentPermissionManager commentPermissionManager, NotificationFilterManager notificationFilterManager, FeatureManager featureManager)
-
-
Method Details
-
sendCommentMentions
@Nonnull public MentionService.MentionResult sendCommentMentions(Set<NotificationRecipient> currentRecipients, ApplicationUser remoteUser, Comment comment, Comment originalComment) Description copied from interface:MentionService
Given a comment object this method will look for any mentions using theMentionFinder
and send e-mails to all users mentioned.Sending mentions can not be performed by anonymous users. The user sending the mentions must have browse users permission and all users mentioned must have permission to browse the issue. Otherwise no e-mails will be sent.
- Specified by:
sendCommentMentions
in interfaceMentionService
- Parameters:
currentRecipients
- A set of recipients already being notified for this issue event bundle.remoteUser
- The currently logged in user performing this operation.comment
- The comment to scan for text.originalComment
- If a comment was edited provide the original comment so that a comparison can be carried out to only send mentions to new users. May be null
-
sendIssueEditMentions
@Nonnull public MentionService.MentionResult sendIssueEditMentions(Set<NotificationRecipient> currentRecipients, ApplicationUser remoteUser, @Nonnull Issue issue, Comment comment) Description copied from interface:MentionService
Given an issue that has just been edited and an optional edit comment this method sends mention e-mails to all users mentioned in either the new issue description or option edit comment.Mentions will only be sent for users if the description field was edited (as determined by the latest change history for this issue) and only to users that weren't mentioned in the description text previously.
- Specified by:
sendIssueEditMentions
in interfaceMentionService
- Parameters:
currentRecipients
- A set of recipients already being notified for this issue event bundle.remoteUser
- The currently logged in user performing this operation.issue
- The issue whose description will be scanned for mentions.comment
- An optional comment for the edit
-
sendIssueCreateMentions
@Nonnull public MentionService.MentionResult sendIssueCreateMentions(Set<NotificationRecipient> currentRecipients, ApplicationUser remoteUser, @Nonnull Issue issue) Description copied from interface:MentionService
Given an issue object this method will look for any mentions in the description field using theMentionFinder
and send e-mails to all users mentioned.Sending mentions can not be performed by anonymous users. The user sending the mentions must have browse users permission and all users mentioned must have permission to browse the issue. Otherwise no e-mails will be sent.
- Specified by:
sendIssueCreateMentions
in interfaceMentionService
- Parameters:
currentRecipients
- A set of recipients already being notified for this issue event bundle.remoteUser
- The currently logged in user performing this operation.issue
- The issue whose description will be scanned for mentions.
-
isUserAbleToMention
Description copied from interface:MentionService
Whether the specified user is able to mention other users in a Jira issue.- Specified by:
isUserAbleToMention
in interfaceMentionService
- Parameters:
remoteUser
- The user to check mention permissions for.- Returns:
- true if the user is able to mention other users; false otherwise.
-
getMentionedUsers
Description copied from interface:MentionService
Returns mentioned users calculated from passedissueEvent
. Sending mentions can not be performed by anonymous users. The user sending the mentions must have browse users permission and all users mentioned must have permission to browse the issue.- Specified by:
getMentionedUsers
in interfaceMentionService
- Parameters:
issueEvent
- Event to find mentions for- Returns:
- Map of users mentioned calculated from passed
issueEvent
.
-