com.atlassian.bamboo.notification
Interface Notification

All Known Subinterfaces:
ExtendedNotification
All Known Implementing Classes:
AbstractCompletedNotification, AbstractNotification, AfterXFailedNotification, BuildCompletedNotification, BuildErrorNotification, BuildHungNotification, BuildMissingCapableAgentNotification, BuildQueueTimeoutNotification, ChainCompletedNotification, CommentNotification, StageCompletedNotification

public interface Notification

Represents a Notification ready to be sent.


Method Summary
 void addRecipient(NotificationRecipient recipient)
          Add a singular recipient to this notification
 void excludeRecipient(NotificationRecipient recipient)
          Exclude a singular recipient from this notification.
 java.lang.String getDescription()
          Text describing this notification object - used for logging/debugging purposes.
 java.lang.String getEmailSubject()
          Retrieves the subject for the notification.
 com.atlassian.event.Event getEvent()
          Retrieves the event object that triggered this notification
 java.util.Set<NotificationRecipient> getExcludedNotificationRecipients()
          Returns the excluded recipients of this Notification
 java.lang.String getHtmlEmailContent()
          Generates the html for the html part of an email notification.
 java.lang.String getIMContent()
          Retrieves the content for the IM notification
 java.util.Set<NotificationRecipient> getNotificationRecipients()
          Returns the recipients of this Notification
 java.lang.String getTextEmailContent()
          Generates the text email content for the notifications
 void setEvent(com.atlassian.event.Event event)
          Sets the event object that triggered this notification
 void setExcludedNotificationRecipients(java.util.Set<NotificationRecipient> recipients)
          Sets the excluded recipients for this Notification
 void setNotificationRecipients(java.util.Set<NotificationRecipient> recipients)
          Sets the recipients for this Notification
 

Method Detail

getDescription

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

Returns:
Notification's description

getTextEmailContent

@Nullable
java.lang.String getTextEmailContent()
                                     throws java.lang.Exception
Generates the text email content for the notifications

Returns:
Email content formatted as text for this notification
Throws:
java.lang.Exception - if there is a problem preventing production of the e-mail content.

getHtmlEmailContent

@Nullable
java.lang.String getHtmlEmailContent()
                                     throws java.lang.Exception
Generates the html for the html part of an email notification.

Returns:
Email content formatted as HTML for this notification
Throws:
java.lang.Exception - if there is a problem preventing production of the e-mail content.

getEmailSubject

@Nullable
java.lang.String getEmailSubject()
                                 throws java.lang.Exception
Retrieves the subject for the notification.

Returns:
Email subject for this notification
Throws:
java.lang.Exception - if there is a problem preventing production of the e-mail subject.

getIMContent

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

Returns:
IM message content for this notification

setEvent

void setEvent(@Nullable
              com.atlassian.event.Event event)
Sets the event object that triggered this notification

Parameters:
event - Event object that triggered this notification

getEvent

@Nullable
com.atlassian.event.Event getEvent()
Retrieves the event object that triggered this notification

Returns:
Event object that triggered this notification

getNotificationRecipients

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

Returns:
Set of notification recipients

getExcludedNotificationRecipients

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

Returns:
Set of excluded notification recipients

setNotificationRecipients

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

Parameters:
recipients - Set of notification recipients

setExcludedNotificationRecipients

void setExcludedNotificationRecipients(@NotNull
                                       java.util.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 © 2011 Atlassian. All Rights Reserved.