Class CommentNotification
- java.lang.Object
-
- com.atlassian.bamboo.notification.AbstractNotification
-
- com.atlassian.bamboo.notification.buildcommented.CommentNotification
-
- All Implemented Interfaces:
ExtendedNotification,Notification,Notification.HtmlImContentProvidingNotification
@NotThreadSafe public class CommentNotification extends AbstractNotification implements ExtendedNotification
This class is used to generate content for Build Commented Notifications. If you wish to customise the default notifications, please see the online Bamboo documentation: http://confluence.atlassian.com/display/BAMBOO/Modifying+Notification+Templates
The notification templates are written in Freemarker markup. The object context below provides information about Bamboo builds that you can insert in the Freemarker markup of your notification templates.
Object Context:
- buildSummary -
ResultsSummary - build -
Plan - plan -
Plan - addedComment -
CommentThe comment which was just added - comments -
ListAll comments on this build
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.atlassian.bamboo.notification.Notification
Notification.HtmlImContentProvidingNotification
-
-
Field Summary
Fields Modifier and Type Field Description static StringHTML_EMAIL_TEMPLATEstatic StringIM_TEMPLATEstatic StringTEXT_EMAIL_TEMPLATE-
Fields inherited from class com.atlassian.bamboo.notification.AbstractNotification
NAVIGATION_SOURCE
-
-
Constructor Summary
Constructors Constructor Description CommentNotification()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull StringgetDescription()Text describing this notification object - used for logging/debugging purposes.@Nullable StringgetEmailSubject()Retrieves the subject for the notification.@Nullable StringgetHtmlEmailContent()Generates the html for the html part of an email notification.@Nullable StringgetHtmlImContent()@Nullable StringgetIMContent()Retrieves the content for the IM notification@Nullable StringgetTextEmailContent()Generates the text email content for the notificationsvoidsetGravatarService(GravatarService gravatarService)voidsetPlanManager(PlanManager planManager)voidsetResultsSummaryManager(ResultsSummaryManager resultsSummaryManager)voidsetTemplateRenderer(TemplateRenderer templateRenderer)@NotNull com.atlassian.mail.EmailupdateEmail(@NotNull com.atlassian.mail.Email email)Sets the email from-name to the user that wrote the comment (if the user exists)-
Methods inherited from class com.atlassian.bamboo.notification.AbstractNotification
addRecipient, applyDefaultCssStyles, excludeRecipient, getCommitUrl, getEvent, getExcludedNotificationRecipients, getNotificationRecipients, getPojoEvent, getRepositoryData, getRepositoryData, setEvent, setEvent, setExcludedNotificationRecipients, setNotificationRecipients
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.bamboo.notification.Notification
addRecipient, applyDefaultCssStyles, excludeRecipient, getEvent, getExcludedNotificationRecipients, getNotificationRecipients, getPojoEvent, setEvent, setEvent, setExcludedNotificationRecipients, setNotificationRecipients
-
-
-
-
Field Detail
-
TEXT_EMAIL_TEMPLATE
public static final String TEXT_EMAIL_TEMPLATE
- See Also:
- Constant Field Values
-
HTML_EMAIL_TEMPLATE
public static final String HTML_EMAIL_TEMPLATE
- See Also:
- Constant Field Values
-
IM_TEMPLATE
public static final String IM_TEMPLATE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDescription
@NotNull public @NotNull String getDescription()
Description copied from interface:NotificationText describing this notification object - used for logging/debugging purposes.- Specified by:
getDescriptionin interfaceNotification- Returns:
- Notification's description
-
getTextEmailContent
@Nullable public @Nullable String getTextEmailContent() throws Exception
Description copied from interface:NotificationGenerates the text email content for the notifications- Specified by:
getTextEmailContentin interfaceNotification- Returns:
- Email content formatted as text for this notification
- Throws:
Exception- if there is a problem preventing production of the e-mail content.
-
getHtmlEmailContent
@Nullable public @Nullable String getHtmlEmailContent() throws Exception
Description copied from interface:NotificationGenerates the html for the html part of an email notification.- Specified by:
getHtmlEmailContentin interfaceNotification- Returns:
- Email content formatted as HTML for this notification
- Throws:
Exception- if there is a problem preventing production of the e-mail content.
-
getEmailSubject
@Nullable public @Nullable String getEmailSubject() throws Exception
Description copied from interface:NotificationRetrieves the subject for the notification.- Specified by:
getEmailSubjectin interfaceNotification- Returns:
- Email subject for this notification
- Throws:
Exception- if there is a problem preventing production of the e-mail subject.
-
getIMContent
@Nullable public @Nullable String getIMContent()
Description copied from interface:NotificationRetrieves the content for the IM notification- Specified by:
getIMContentin interfaceNotification- Returns:
- IM message content for this notification
-
getHtmlImContent
@Nullable public @Nullable String getHtmlImContent()
- Specified by:
getHtmlImContentin interfaceNotification.HtmlImContentProvidingNotification- Overrides:
getHtmlImContentin classAbstractNotification
-
updateEmail
@NotNull public @NotNull com.atlassian.mail.Email updateEmail(@NotNull @NotNull com.atlassian.mail.Email email)Sets the email from-name to the user that wrote the comment (if the user exists)- Specified by:
updateEmailin interfaceExtendedNotification- Parameters:
email- - prepopulated email- Returns:
- email with updated from-name
-
setPlanManager
public void setPlanManager(PlanManager planManager)
-
setResultsSummaryManager
public void setResultsSummaryManager(ResultsSummaryManager resultsSummaryManager)
-
setTemplateRenderer
public void setTemplateRenderer(TemplateRenderer templateRenderer)
-
setGravatarService
public void setGravatarService(GravatarService gravatarService)
-
-