Class StandardSlackService

java.lang.Object
jenkins.plugins.slack.StandardSlackService
All Implemented Interfaces:
SlackService

public class StandardSlackService extends Object implements SlackService
  • Constructor Details

  • Method Details

    • builder

      public static StandardSlackServiceBuilder builder()
    • getResponseString

      public String getResponseString()
      Specified by:
      getResponseString in interface SlackService
    • publish

      public boolean publish(String message)
      Specified by:
      publish in interface SlackService
    • upload

      public boolean upload(FilePath workspace, String artifactIncludes, TaskListener log)
      Make an HTTP POST upload to the Slack API
      Specified by:
      upload in interface SlackService
      Parameters:
      workspace - - job workspace
      artifactIncludes - - includes comma-separated Ant-style globs as per Util.createFileSet(File, String, String) using / as a path separator;
      log - - print log stream
      Returns:
      boolean indicating whether the API request succeeded
    • publish

      public boolean publish(SlackRequest slackRequest)
      Specified by:
      publish in interface SlackService
    • publish

      public boolean publish(String message, String color)
      Specified by:
      publish in interface SlackService
    • publish

      public boolean publish(String message, net.sf.json.JSONArray attachments, String color)
      Specified by:
      publish in interface SlackService
    • publish

      public boolean publish(String message, String color, String timestamp)
      Specified by:
      publish in interface SlackService
    • publish

      public boolean publish(String message, net.sf.json.JSONArray attachments, String color, String timestamp)
      Specified by:
      publish in interface SlackService
    • addReaction

      public boolean addReaction(String channelId, String timestamp, String emojiName)
      Add an emoji reaction to a message
      Specified by:
      addReaction in interface SlackService
      Parameters:
      channelId - - Slack's internal channel id (i.e. what's returned in a `chat.postMessage` response)
      timestamp - - Timestamp identifying the message
      emojiName - - The name of the emoji to add in reaction to the message (no colons)
      Returns:
      boolean indicating whether the API request succeeded
    • removeReaction

      public boolean removeReaction(String channelId, String timestamp, String emojiName)
      Remove an emoji reaction from a message.
      Specified by:
      removeReaction in interface SlackService
      Parameters:
      channelId - - Slack's internal channel id (i.e. what's returned in a `chat.postMessage` response)
      timestamp - - Timestamp identifying the message
      emojiName - - The name of the emoji to add in reaction to the message (no colons)
      Returns:
      boolean indicating whether the API request succeeded
    • getHttpClient

      protected org.apache.http.impl.client.CloseableHttpClient getHttpClient()