Class SlackMessageProvider


  • public class SlackMessageProvider
    extends Object
    Class that allows BFA to send failure cause messages for each build to Slack.
    Author:
    Johan Cornelissen <j.cornelissen@queensu.ca>
    • Method Detail

      • getBotUser

        public boolean getBotUser()
        Retrieve latest set Slack bot user.
        Returns:
        String of slack bot user
      • getTeamDomain

        public String getTeamDomain()
        Retrieve latest set Slack team domain.
        Returns:
        String of slack team domain
      • getBaseUrl

        public String getBaseUrl()
        Retrieve latest set Slack base URL.
        Returns:
        String of slack base URL
      • getRoom

        public String getRoom()
        Retrieve latest set Slack channel.
        Returns:
        String of slack channel name
      • getSlackMessageText

        public String getSlackMessageText()
        Retrieve latest slack message text.
        Returns:
        String of slack message
      • postToSlack

        public boolean postToSlack​(String messageText,
                                   PrintStream buildLog)
        Function to send a slack message to a channel specificed in the plugin configuration. Uses all slack plugin settings except those that are overridden by the build failure analyzer plugin configurations (this plugin).
        Parameters:
        messageText - - Content of the slack message.
        buildLog - - PrintStream of build to allow for success and error messages to be displayed.
        Returns:
        boolean true if message sent successfully, otherwise false