Class WebhookRecipient
- java.lang.Object
-
- com.atlassian.bamboo.notification.recipients.AbstractNotificationRecipient
-
- com.atlassian.bamboo.notification.recipients.WebhookRecipient
-
- All Implemented Interfaces:
NotificationRecipient
,BambooPluginModule
,Comparable
public class WebhookRecipient extends AbstractNotificationRecipient
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.atlassian.bamboo.notification.NotificationRecipient
NotificationRecipient.RequiresEvent, NotificationRecipient.RequiresPlan, NotificationRecipient.RequiresResultSummary, NotificationRecipient.Scope, NotificationRecipient.UserRecipientExpandable
-
-
Field Summary
Fields Modifier and Type Field Description static String
GLOBAL_WEBHOOKS
static String
WEBHOOK_FIELD
static String
WEBHOOK_NAME
static String
WEBHOOK_URL_FIELD
-
Fields inherited from class com.atlassian.bamboo.notification.recipients.AbstractNotificationRecipient
notificationRecipientModuleDescriptor
-
-
Constructor Summary
Constructors Constructor Description WebhookRecipient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull String
getEditHtml()
Returns the html to be displayed on the edit screen (to input data into notification type)@NotNull String
getRecipientConfig()
Retrieve string representation of data - if none exists return empty string@NotNull List<NotificationTransport>
getTransports()
Evaluates the appropriate mediums for sending notifications for this recipient, returning a list of appropriate transports.@NotNull String
getViewHtml()
Returns the HTML representing the notification type for the notificationString
getWebhookUrl()
void
init(@Nullable String configurationData)
Initialise recipient with string based representation of its configuration datavoid
populate(@NotNull Map<String,String[]> params)
takes the map of config data from action and extracts the parameters it needsvoid
setNotificationFactory(NotificationFactory notificationFactory)
void
setTemplateRenderer(TemplateRenderer templateRenderer)
void
setTextProvider(com.atlassian.struts.TextProvider textProvider)
void
setWebhookTemplateService(WebhookTemplateService webhookTemplateService)
void
setWebhookUrl(String webhookUrl)
@NotNull ErrorCollection
validate(@NotNull Map<String,String[]> params)
Validate the data user provided.-
Methods inherited from class com.atlassian.bamboo.notification.recipients.AbstractNotificationRecipient
compareTo, getDescription, getKey, getModuleDescriptor, getParam, getScopes, getTransports, init
-
-
-
-
Field Detail
-
WEBHOOK_FIELD
public static final String WEBHOOK_FIELD
- See Also:
- Constant Field Values
-
WEBHOOK_URL_FIELD
public static final String WEBHOOK_URL_FIELD
- See Also:
- Constant Field Values
-
GLOBAL_WEBHOOKS
public static final String GLOBAL_WEBHOOKS
- See Also:
- Constant Field Values
-
WEBHOOK_NAME
public static final String WEBHOOK_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getTransports
@NotNull public @NotNull List<NotificationTransport> getTransports()
Description copied from interface:NotificationRecipient
Evaluates the appropriate mediums for sending notifications for this recipient, returning a list of appropriate transports.
-
init
public void init(@Nullable @Nullable String configurationData)
Description copied from interface:NotificationRecipient
Initialise recipient with string based representation of its configuration data- Specified by:
init
in interfaceNotificationRecipient
- Overrides:
init
in classAbstractNotificationRecipient
-
getRecipientConfig
@NotNull public @NotNull String getRecipientConfig()
Description copied from interface:NotificationRecipient
Retrieve string representation of data - if none exists return empty string- Specified by:
getRecipientConfig
in interfaceNotificationRecipient
- Overrides:
getRecipientConfig
in classAbstractNotificationRecipient
-
populate
public void populate(@NotNull @NotNull Map<String,String[]> params)
Description copied from interface:NotificationRecipient
takes the map of config data from action and extracts the parameters it needs- Specified by:
populate
in interfaceNotificationRecipient
- Overrides:
populate
in classAbstractNotificationRecipient
- Parameters:
params
- map of key (String), value (String []) pairs from action
-
getEditHtml
@NotNull public @NotNull String getEditHtml()
Description copied from interface:NotificationRecipient
Returns the html to be displayed on the edit screen (to input data into notification type)- Specified by:
getEditHtml
in interfaceNotificationRecipient
- Overrides:
getEditHtml
in classAbstractNotificationRecipient
- Returns:
- String of html
-
getViewHtml
@NotNull public @NotNull String getViewHtml()
Description copied from interface:NotificationRecipient
Returns the HTML representing the notification type for the notification- Specified by:
getViewHtml
in interfaceNotificationRecipient
- Overrides:
getViewHtml
in classAbstractNotificationRecipient
- Returns:
- HTML of data for view configuration. If this returns null the description will be used.
-
validate
@NotNull public @NotNull ErrorCollection validate(@NotNull @NotNull Map<String,String[]> params)
Description copied from interface:NotificationRecipient
Validate the data user provided.- Specified by:
validate
in interfaceNotificationRecipient
- Overrides:
validate
in classAbstractNotificationRecipient
- Parameters:
params
- map of key (String), value (String []) pairs from action- Returns:
- error collection of any errors to be reported back to the user
-
setTemplateRenderer
public void setTemplateRenderer(TemplateRenderer templateRenderer)
-
setNotificationFactory
public void setNotificationFactory(NotificationFactory notificationFactory)
-
setWebhookTemplateService
public void setWebhookTemplateService(WebhookTemplateService webhookTemplateService)
-
setTextProvider
public void setTextProvider(com.atlassian.struts.TextProvider textProvider)
-
getWebhookUrl
public String getWebhookUrl()
-
setWebhookUrl
public void setWebhookUrl(String webhookUrl)
-
-