Interface Notification
- All Known Subinterfaces:
ExtendedNotification
,Notification.HtmlImContentProvidingNotification
- All Known Implementing Classes:
AbstractAccessTokenNotification
,AbstractArtifactStorageCappingNotification
,AbstractCompletedNotification
,AbstractNotification
,AbstractTrackingNotification
,AccessTokenCreatedNotification
,AccessTokenDeletedNotification
,AfterXFailedNotification
,ArtifactStorageHardLimitExceededNotification
,ArtifactStorageSoftLimitExceededNotification
,BuildCompletedNotification
,BuildErrorNotification
,BuildHungNotification
,BuildMissingCapableAgentNotification
,BuildQueueTimeoutNotification
,ChainCompletedNotification
,CommentNotification
,DeploymentFinishedNotification
,DeploymentStartedNotification
,RssNotification
,StageCompletedNotification
,UserResponsibilityAddedNotification
,UserResponsibilityRemovedNotification
public interface Notification
Represents a Notification ready to be sent.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Extension interface if the Notification supports HTML in IM messages. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRecipient
(@NotNull NotificationRecipient recipient) Add a singular recipient to this notificationboolean
Determines if this notification HTML templates should be decorated with default CSS styles.void
excludeRecipient
(@NotNull NotificationRecipient recipient) Exclude a singular recipient from this notification.@NotNull String
Text describing this notification object - used for logging/debugging purposes.@Nullable String
Retrieves the subject for the notification.@Nullable BambooEvent
getEvent()
Retrieves the event object that triggered this notification.@NotNull Set<NotificationRecipient>
Returns the excluded recipients of this Notification@Nullable String
Generates the html for the html part of an email notification.@Nullable String
Retrieves the content for the IM notification@NotNull Set<NotificationRecipient>
Returns the recipients of this Notification@Nullable Object
Retrieves the event object that triggered this notification@Nullable String
Generates the text email content for the notificationsvoid
setEvent
(@Nullable BambooEvent event) Deprecated.since 10.0void
Sets the event object that triggered this notificationvoid
setExcludedNotificationRecipients
(@NotNull Set<NotificationRecipient> recipients) Sets the excluded recipients for this Notificationvoid
setNotificationRecipients
(@NotNull Set<NotificationRecipient> recipients) Sets the recipients for this Notification
-
Method Details
-
getDescription
Text describing this notification object - used for logging/debugging purposes.- Returns:
- Notification's description
-
getTextEmailContent
Generates the text email content for the notifications- Returns:
- Email content formatted as text for this notification
- Throws:
Exception
- if there is a problem preventing production of the e-mail content.
-
getHtmlEmailContent
Generates the html for the html part of an email notification.- Returns:
- Email content formatted as HTML for this notification
- Throws:
Exception
- if there is a problem preventing production of the e-mail content.
-
applyDefaultCssStyles
@ExperimentalApi boolean applyDefaultCssStyles()Determines if this notification HTML templates should be decorated with default CSS styles.- Returns:
- true, if default styles should be applied and inlined, false otherwise
- See Also:
-
getEmailSubject
Retrieves the subject for the notification.- Returns:
- Email subject for this notification
- Throws:
Exception
- if there is a problem preventing production of the e-mail subject.
-
getIMContent
Retrieves the content for the IM notification- Returns:
- IM message content for this notification
-
setEvent
Deprecated.since 10.0Sets the event object that triggered this notification Before 10.0 this method received a com.atlassian.event.Event object. Now it receivesBambooEvent
.- Parameters:
event
- Event object that triggered this notification
-
setEvent
Sets the event object that triggered this notification- Parameters:
event
- Event object that triggered this notification
-
getEvent
Retrieves the event object that triggered this notification. Before 10.0 this method returned a com.atlassian.event.Event object. Now it returnsBambooEvent
.- Returns:
- Event object that triggered this notification
- Since:
- 10.0
-
getPojoEvent
Retrieves the event object that triggered this notification- Returns:
- Event object that triggered this notification
-
getNotificationRecipients
Returns the recipients of this Notification- Returns:
- Set of notification recipients
-
getExcludedNotificationRecipients
Returns the excluded recipients of this Notification- Returns:
- Set of excluded notification recipients
-
setNotificationRecipients
Sets the recipients for this Notification- Parameters:
recipients
- Set of notification recipients
-
setExcludedNotificationRecipients
Sets the excluded recipients for this Notification- Parameters:
recipients
- Set of excluded notification recipients
-
addRecipient
Add a singular recipient to this notification- Parameters:
recipient
- Recipient to be added to notification
-
excludeRecipient
Exclude a singular recipient from this notification. Recipient exclusion takes precedence over inclusion.- Parameters:
recipient
- Recipient to be excluded from notification
-