Package jenkins.plugins.slack
Class StandardSlackService
java.lang.Object
jenkins.plugins.slack.StandardSlackService
- All Implemented Interfaces:
SlackService
-
Constructor Summary
ConstructorDescriptionStandardSlackService
(String baseUrl, String teamDomain, boolean botUser, String roomId, boolean replyBroadcast, String populatedToken) Deprecated.StandardSlackService
(String baseUrl, String teamDomain, String authTokenCredentialId, boolean botUser, String roomId) Deprecated.StandardSlackService
(String baseUrl, String teamDomain, String token, String authTokenCredentialId, boolean botUser, String roomId) Deprecated.StandardSlackService
(String baseUrl, String teamDomain, String token, String authTokenCredentialId, boolean botUser, String roomId, boolean replyBroadcast) Deprecated.StandardSlackService
(StandardSlackServiceBuilder standardSlackServiceBuilder) Default constructor -
Method Summary
Modifier and TypeMethodDescriptionboolean
addReaction
(String channelId, String timestamp, String emojiName) Add an emoji reaction to a messagestatic StandardSlackServiceBuilder
builder()
protected org.apache.http.impl.client.CloseableHttpClient
boolean
boolean
boolean
boolean
boolean
boolean
publish
(SlackRequest slackRequest) boolean
removeReaction
(String channelId, String timestamp, String emojiName) Remove an emoji reaction from a message.boolean
upload
(FilePath workspace, String artifactIncludes, TaskListener log) Make an HTTP POST upload to the Slack API
-
Constructor Details
-
StandardSlackService
@Deprecated public StandardSlackService(String baseUrl, String teamDomain, String authTokenCredentialId, boolean botUser, String roomId) Deprecated.- Parameters:
baseUrl
- is a base URLteamDomain
- is a teamDomainauthTokenCredentialId
-botUser
- is a bot UserroomId
- is a room Id
-
StandardSlackService
@Deprecated public StandardSlackService(String baseUrl, String teamDomain, String token, String authTokenCredentialId, boolean botUser, String roomId) Deprecated.- Parameters:
baseUrl
- is a base URLteamDomain
- is a teamDomaintoken
- is a tokenauthTokenCredentialId
-botUser
- is a bot UserroomId
- is a room Id
-
StandardSlackService
@Deprecated public StandardSlackService(String baseUrl, String teamDomain, String token, String authTokenCredentialId, boolean botUser, String roomId, boolean replyBroadcast) Deprecated.- Parameters:
baseUrl
- is a base URLteamDomain
- is a teamDomaintoken
- is a tokenauthTokenCredentialId
-botUser
- is a bot UserroomId
- is a room IdreplyBroadcast
- is a replyBroadcast
-
StandardSlackService
@Deprecated public StandardSlackService(String baseUrl, String teamDomain, boolean botUser, String roomId, boolean replyBroadcast, String populatedToken) Deprecated.- Parameters:
baseUrl
- is a base URLteamDomain
- is a teamDomainbotUser
- is a bot UserroomId
- is a room IdreplyBroadcast
- is replayBroadcastpopulatedToken
- is populated Token
-
StandardSlackService
Default constructor- Parameters:
standardSlackServiceBuilder
- is a StandardSlackServiceBuilder
-
-
Method Details
-
builder
-
getResponseString
- Specified by:
getResponseString
in interfaceSlackService
-
publish
- Specified by:
publish
in interfaceSlackService
-
upload
Make an HTTP POST upload to the Slack API- Specified by:
upload
in interfaceSlackService
- Parameters:
workspace
- - job workspaceartifactIncludes
- - includes comma-separated Ant-style globs as perUtil.createFileSet(File, String, String)
using/
as a path separator;log
- - print log stream- Returns:
- boolean indicating whether the API request succeeded
-
publish
- Specified by:
publish
in interfaceSlackService
-
publish
- Specified by:
publish
in interfaceSlackService
-
publish
- Specified by:
publish
in interfaceSlackService
-
publish
- Specified by:
publish
in interfaceSlackService
-
publish
public boolean publish(String message, net.sf.json.JSONArray attachments, String color, String timestamp) - Specified by:
publish
in interfaceSlackService
-
addReaction
Add an emoji reaction to a message- Specified by:
addReaction
in interfaceSlackService
- Parameters:
channelId
- - Slack's internal channel id (i.e. what's returned in a `chat.postMessage` response)timestamp
- - Timestamp identifying the messageemojiName
- - The name of the emoji to add in reaction to the message (no colons)- Returns:
- boolean indicating whether the API request succeeded
-
removeReaction
Remove an emoji reaction from a message.- Specified by:
removeReaction
in interfaceSlackService
- Parameters:
channelId
- - Slack's internal channel id (i.e. what's returned in a `chat.postMessage` response)timestamp
- - Timestamp identifying the messageemojiName
- - 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()
-
StandardSlackService(String, String, boolean, String, boolean, String)
instead}