public class AlertSlack extends Object
AlertSlack
handles slack based alerting outputConstructor and Description |
---|
AlertSlack(AlertConfiguration cfg)
Construct new alert slack object
|
AlertSlack(AlertConfiguration cfg,
SlackManager slackManager)
Construct new alert slack object, providing an already instantiated
SlackManager |
Modifier and Type | Method and Description |
---|---|
void |
done()
Mark AlertSlack instance as done
|
String |
getUserId(String email)
Get slack user id from user's email
|
Boolean |
sendConfirmationAlertToUser(Alert a,
String userId)
Send an alert to a user asking them if it was caused by them.
|
Boolean |
sendToCatchall(Alert a)
Send alert to slack catchall channel
|
Boolean |
sendToSupplementary(Alert a)
Send alert to supplementary slack channel
|
Boolean |
sendToUser(Alert a,
String userId)
Send alert to a user.
|
public AlertSlack(AlertConfiguration cfg) throws IOException
cfg
- AlertConfiguration
IOException
- IOExceptionpublic AlertSlack(AlertConfiguration cfg, SlackManager slackManager)
SlackManager
cfg
- AlertConfiguration
slackManager
- SlackManager
instancepublic void done()
Should be called when object will no longer be used.
public Boolean sendToCatchall(Alert a)
a
- Alertpublic Boolean sendToSupplementary(Alert a)
If any supplementary slack output metadata is set in the alert, this method will send the required message to the configured channel.
a
- Alertpublic Boolean sendToUser(Alert a, String userId)
a
- AlertuserId
- Slack user idpublic Boolean sendConfirmationAlertToUser(Alert a, String userId)
a
- AlertuserId
- Slack user idCopyright © 2022. All rights reserved.