Class SlackNotifier
java.lang.Object
de.codecentric.boot.admin.server.notify.AbstractEventNotifier
de.codecentric.boot.admin.server.notify.AbstractStatusChangeNotifier
de.codecentric.boot.admin.server.notify.filter.AbstractContentNotifier
de.codecentric.boot.admin.server.notify.SlackNotifier
- All Implemented Interfaces:
Notifier
Notifier submitting events to Slack.
- Author:
- Artur Dobosiewicz
-
Constructor Summary
ConstructorsConstructorDescriptionSlackNotifier(InstanceRepository repository, org.springframework.web.client.RestTemplate restTemplate) -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectcreateMessage(InstanceEvent event, Instance instance) protected reactor.core.publisher.Mono<Void>doNotify(InstanceEvent event, Instance instance) @Nullable Stringprotected StringgetColor(InstanceEvent event) protected StringDefines the default SpEL template string used for message generation.@Nullable StringgetIcon()@Nullable String@Nullable URIvoidsetChannel(@Nullable String channel) voidvoidsetRestTemplate(org.springframework.web.client.RestTemplate restTemplate) voidsetUsername(@Nullable String username) voidsetWebhookUrl(@Nullable URI webhookUrl) Methods inherited from class de.codecentric.boot.admin.server.notify.filter.AbstractContentNotifier
buildContentModel, createContent, getMessage, setMessageMethods inherited from class de.codecentric.boot.admin.server.notify.AbstractStatusChangeNotifier
getIgnoreChanges, getLastStatus, notify, setIgnoreChanges, shouldNotify, updateLastStatusMethods inherited from class de.codecentric.boot.admin.server.notify.AbstractEventNotifier
isEnabled, setEnabled
-
Constructor Details
-
SlackNotifier
public SlackNotifier(InstanceRepository repository, org.springframework.web.client.RestTemplate restTemplate)
-
-
Method Details
-
doNotify
- Specified by:
doNotifyin classAbstractEventNotifier
-
setRestTemplate
public void setRestTemplate(org.springframework.web.client.RestTemplate restTemplate) -
createMessage
-
getColor
-
getWebhookUrl
-
setWebhookUrl
-
getChannel
-
setChannel
-
getIcon
-
setIcon
-
getUsername
-
setUsername
-
getDefaultMessage
Description copied from class:AbstractContentNotifierDefines the default SpEL template string used for message generation.The template should use #{key} syntax to reference variables provided by
AbstractContentNotifier.buildContentModel(InstanceEvent, Instance). This default can be overridden at runtime usingAbstractContentNotifier.setMessage(String).- Specified by:
getDefaultMessagein classAbstractContentNotifier- Returns:
- the default SpEL template string (e.g., "#{name} is #{status}")
-