com.atlassian.jira.mention
Class MentionServiceImpl

java.lang.Object
  extended by com.atlassian.jira.mention.MentionServiceImpl
All Implemented Interfaces:
MentionService

public class MentionServiceImpl
extends Object
implements MentionService


Constructor Summary
MentionServiceImpl(MentionFinder finder, UserManager userManager, PermissionManager permissionManager, com.atlassian.event.api.EventPublisher eventPublisher, ChangeHistoryManager changeHistoryManager)
           
 
Method Summary
 boolean isUserAbleToMention(com.atlassian.crowd.embedded.api.User remoteUser)
          Whether the specified user is able to mention other users in a JIRA issue.
 void sendCommentMentions(com.atlassian.crowd.embedded.api.User remoteUser, Set<NotificationRecipient> currentRecipients, Comment comment, Comment originalComment)
          Given a comment object this method will look for any mentions using the MentionFinder and send e-mails to all users mentioned.
 void sendIssueCreateMentions(com.atlassian.crowd.embedded.api.User remoteUser, Set<NotificationRecipient> currentRecipients, Issue issue)
          Given an issue object this method will look for any mentions in the description field using the MentionFinder and send e-mails to all users mentioned.
 void sendIssueEditMentions(com.atlassian.crowd.embedded.api.User remoteUser, Set<NotificationRecipient> currentRecipients, 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MentionServiceImpl

public MentionServiceImpl(MentionFinder finder,
                          UserManager userManager,
                          PermissionManager permissionManager,
                          com.atlassian.event.api.EventPublisher eventPublisher,
                          ChangeHistoryManager changeHistoryManager)
Method Detail

sendCommentMentions

public void sendCommentMentions(com.atlassian.crowd.embedded.api.User remoteUser,
                                Set<NotificationRecipient> currentRecipients,
                                Comment comment,
                                Comment originalComment)
Description copied from interface: MentionService
Given a comment object this method will look for any mentions using the MentionFinder 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 interface MentionService
Parameters:
remoteUser - The currently logged in user performing this operation.
currentRecipients - A set of recipients already being notified for this mention.
comment - the comment to scan for text.
originalComment - If a comment was edited provied the original comment so that a comparison can be carried out to only send mentions to new users. May be null

sendIssueEditMentions

public void sendIssueEditMentions(com.atlassian.crowd.embedded.api.User remoteUser,
                                  Set<NotificationRecipient> currentRecipients,
                                  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 interface MentionService
Parameters:
remoteUser - The currently logged in user performing this operation.
currentRecipients - A set of recipients already being notified for this mention.
issue - the issue whose description will be scanned for metions.
comment - An optional comment for the edit

sendIssueCreateMentions

public void sendIssueCreateMentions(com.atlassian.crowd.embedded.api.User remoteUser,
                                    Set<NotificationRecipient> currentRecipients,
                                    Issue issue)
Description copied from interface: MentionService
Given an issue object this method will look for any mentions in the description field using the MentionFinder 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 interface MentionService
Parameters:
remoteUser - The currently logged in user performing this operation.
currentRecipients - A set of recipients already being notified for this mention.
issue - the issue whose description will be scanned for metions.

isUserAbleToMention

public boolean isUserAbleToMention(com.atlassian.crowd.embedded.api.User remoteUser)
Description copied from interface: MentionService
Whether the specified user is able to mention other users in a JIRA issue.

Specified by:
isUserAbleToMention in interface MentionService
Parameters:
remoteUser - The user to check mention permissions for.
Returns:
true if the user is able to mention other users; false otherwise.


Copyright © 2002-2013 Atlassian. All Rights Reserved.