com.atlassian.bamboo.notification
Interface Notification

All Known Subinterfaces:
ExtendedNotification, Notification.HtmlImContentProvidingNotification
All Known Implementing Classes:
AbstractArtifactStorageCappingNotification, AbstractCompletedNotification, AbstractNotification, AbstractTrackingNotification, AfterXFailedNotification, ArtifactStorageHardLimitExceededNotification, ArtifactStorageSoftLimitExceededNotification, BuildCompletedNotification, BuildErrorNotification, BuildHungNotification, BuildMissingCapableAgentNotification, BuildQueueTimeoutNotification, ChainCompletedNotification, CommentNotification, DeploymentFinishedNotification, DeploymentStartedNotification, StageCompletedNotification, UserResponsibilityAddedNotification, UserResponsibilityRemovedNotification

public interface Notification

Represents a Notification ready to be sent.


Nested Class Summary
static interface Notification.HtmlImContentProvidingNotification
          Extension interface if the Notification supports HTML in IM messages.
 
Method Summary
 void addRecipient(NotificationRecipient recipient)
          Add a singular recipient to this notification
 boolean applyDefaultCssStyles()
          Determines if this notification HTML templates should be decorated with default CSS styles.
 void excludeRecipient(NotificationRecipient recipient)
          Exclude a singular recipient from this notification.
 String getDescription()
          Text describing this notification object - used for logging/debugging purposes.
 String getEmailSubject()
          Retrieves the subject for the notification.
 com.atlassian.event.Event getEvent()
          Deprecated. since 5.6 use getPojoEvent()
 Set<NotificationRecipient> getExcludedNotificationRecipients()
          Returns the excluded recipients of this Notification
 String getHtmlEmailContent()
          Generates the html for the html part of an email notification.
 String getIMContent()
          Retrieves the content for the IM notification
 Set<NotificationRecipient> getNotificationRecipients()
          Returns the recipients of this Notification
 Object getPojoEvent()
          Retrieves the event object that triggered this notification
 String getTextEmailContent()
          Generates the text email content for the notifications
 void setEvent(com.atlassian.event.Event event)
          Deprecated. since 5.6 use setEvent(Object)
 void setEvent(Object event)
          Sets the event object that triggered this notification
 void setExcludedNotificationRecipients(Set<NotificationRecipient> recipients)
          Sets the excluded recipients for this Notification
 void setNotificationRecipients(Set<NotificationRecipient> recipients)
          Sets the recipients for this Notification
 

Method Detail

getDescription

@NotNull
String getDescription()
Text describing this notification object - used for logging/debugging purposes.

Returns:
Notification's description

getTextEmailContent

@Nullable
String getTextEmailContent()
                           throws Exception
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

@Nullable
String getHtmlEmailContent()
                           throws Exception
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:
NotificationFormatter.applyStyles(String)

getEmailSubject

@Nullable
String getEmailSubject()
                       throws Exception
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

@Nullable
String getIMContent()
Retrieves the content for the IM notification

Returns:
IM message content for this notification

setEvent

@Deprecated
void setEvent(@Nullable
                         com.atlassian.event.Event event)
Deprecated. since 5.6 use setEvent(Object)

Sets the event object that triggered this notification

Parameters:
event - Event object that triggered this notification

setEvent

void setEvent(@Nullable
              Object event)
Sets the event object that triggered this notification

Parameters:
event - Event object that triggered this notification

getEvent

@Nullable
@Deprecated
com.atlassian.event.Event getEvent()
Deprecated. since 5.6 use getPojoEvent()

Retrieves the event object that triggered this notification

Returns:
Event object that triggered this notification

getPojoEvent

@Nullable
Object getPojoEvent()
Retrieves the event object that triggered this notification

Returns:
Event object that triggered this notification

getNotificationRecipients

@NotNull
Set<NotificationRecipient> getNotificationRecipients()
Returns the recipients of this Notification

Returns:
Set of notification recipients

getExcludedNotificationRecipients

@NotNull
Set<NotificationRecipient> getExcludedNotificationRecipients()
Returns the excluded recipients of this Notification

Returns:
Set of excluded notification recipients

setNotificationRecipients

void setNotificationRecipients(@NotNull
                               Set<NotificationRecipient> recipients)
Sets the recipients for this Notification

Parameters:
recipients - Set of notification recipients

setExcludedNotificationRecipients

void setExcludedNotificationRecipients(@NotNull
                                       Set<NotificationRecipient> recipients)
Sets the excluded recipients for this Notification

Parameters:
recipients - Set of excluded notification recipients

addRecipient

void addRecipient(@NotNull
                  NotificationRecipient recipient)
Add a singular recipient to this notification

Parameters:
recipient - Recipient to be added to notification

excludeRecipient

void excludeRecipient(@NotNull
                      NotificationRecipient recipient)
Exclude a singular recipient from this notification. Recipient exclusion takes precedence over inclusion.

Parameters:
recipient - Recipient to be excluded from notification


Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.