Package com.slack.api.bolt
Class App
- java.lang.Object
-
- com.slack.api.bolt.App
-
public class App extends Object
A Slack App instance.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
App.AppBuilder
static class
App.Status
-
Constructor Summary
Constructors Constructor Description App()
App(AppConfig appConfig)
App(AppConfig appConfig, Slack slack, MethodsClient client, ExecutorService executorService, List<Middleware> middlewareList, App.Status status, InstallationService installationService, DefaultTokensRevokedEventHandler tokensRevokedEventHandler, DefaultAppUninstalledEventHandler appUninstalledEventHandler, OAuthStateService oAuthStateService, OAuthSuccessHandler oAuthSuccessHandler, OAuthV2SuccessHandler oAuthV2SuccessHandler, OAuthErrorHandler oAuthErrorHandler, OAuthAccessErrorHandler oAuthAccessErrorHandler, OAuthV2AccessErrorHandler oAuthV2AccessErrorHandler, OAuthStateErrorHandler oAuthStateErrorHandler, OAuthExceptionHandler oAuthExceptionHandler, OAuthCallbackService oAuthCallbackService)
App(AppConfig appConfig, Slack slack, List<Middleware> middlewareList)
App(AppConfig appConfig, List<Middleware> middlewareList)
-
Method Summary
-
-
-
Constructor Detail
-
App
public App()
-
App
public App(AppConfig appConfig)
-
App
public App(AppConfig appConfig, List<Middleware> middlewareList)
-
App
public App(AppConfig appConfig, Slack slack, List<Middleware> middlewareList)
-
App
public App(AppConfig appConfig, Slack slack, MethodsClient client, ExecutorService executorService, List<Middleware> middlewareList, App.Status status, InstallationService installationService, DefaultTokensRevokedEventHandler tokensRevokedEventHandler, DefaultAppUninstalledEventHandler appUninstalledEventHandler, OAuthStateService oAuthStateService, OAuthSuccessHandler oAuthSuccessHandler, OAuthV2SuccessHandler oAuthV2SuccessHandler, OAuthErrorHandler oAuthErrorHandler, OAuthAccessErrorHandler oAuthAccessErrorHandler, OAuthV2AccessErrorHandler oAuthV2AccessErrorHandler, OAuthStateErrorHandler oAuthStateErrorHandler, OAuthExceptionHandler oAuthExceptionHandler, OAuthCallbackService oAuthCallbackService)
-
-
Method Detail
-
buildDefaultMiddlewareList
protected List<Middleware> buildDefaultMiddlewareList(AppConfig config)
-
defaultTokensRevokedEventHandler
public BoltEventHandler<TokensRevokedEvent> defaultTokensRevokedEventHandler()
-
defaultAppUninstalledEventHandler
public BoltEventHandler<AppUninstalledEvent> defaultAppUninstalledEventHandler()
-
enableTokenRevocationHandlers
public App enableTokenRevocationHandlers()
-
buildAuthorizeUrl
public String buildAuthorizeUrl(String state)
Get the Slack URL for beginning the OAuth flow, including the query params necessary to identify this application to Slack.Appends the optional `redirect_uri` query param based on the provided AppConfig to ensure that the correct OAuth redirect URI is selected in cases where a Slack application may have multiple redirect URIs associated with it.
- Parameters:
state
- The OAuth state param- Returns:
- The Slack URL to redirect users to for beginning the OAuth flow
-
getOauthInstallationUrl
@Deprecated public String getOauthInstallationUrl(String state)
Deprecated.Use #buildAuthorizeUrl(String) instead (this method will be removed in v2.0)
-
getWebEndpointHandlers
public Map<WebEndpoint,WebEndpointHandler> getWebEndpointHandlers()
-
config
public AppConfig config()
-
slack
public Slack slack()
-
client
public MethodsClient client()
-
executorService
public ExecutorService executorService()
The built-in handy way to run operations asynchronously. It's totally fine to use your own one instead.
-
status
public App.Status status()
-
initializer
public App initializer(String name, Initializer initializer)
-
initialize
public void initialize()
-
start
public App start()
-
stop
public App stop()
-
use
public App use(Middleware middleware)
-
event
public <E extends Event> App event(Class<E> eventClass, BoltEventHandler<E> handler)
-
event
public App event(EventHandler<?> handler)
-
message
public App message(String pattern, BoltEventHandler<MessageEvent> messageHandler)
-
message
public App message(Pattern pattern, BoltEventHandler<MessageEvent> messageHandler)
-
command
public App command(String command, SlashCommandHandler handler)
-
command
public App command(Pattern command, SlashCommandHandler handler)
-
blockAction
public App blockAction(String actionId, BlockActionHandler handler)
-
blockAction
public App blockAction(Pattern actionId, BlockActionHandler handler)
-
blockSuggestion
public App blockSuggestion(String actionId, BlockSuggestionHandler handler)
-
blockSuggestion
public App blockSuggestion(Pattern actionId, BlockSuggestionHandler handler)
-
globalShortcut
public App globalShortcut(String callbackId, GlobalShortcutHandler handler)
-
globalShortcut
public App globalShortcut(Pattern callbackId, GlobalShortcutHandler handler)
-
messageShortcut
public App messageShortcut(String callbackId, MessageShortcutHandler handler)
-
messageShortcut
public App messageShortcut(Pattern callbackId, MessageShortcutHandler handler)
-
viewSubmission
public App viewSubmission(String callbackId, ViewSubmissionHandler handler)
-
viewSubmission
public App viewSubmission(Pattern callbackId, ViewSubmissionHandler handler)
-
viewClosed
public App viewClosed(String callbackId, ViewClosedHandler handler)
-
viewClosed
public App viewClosed(Pattern callbackId, ViewClosedHandler handler)
-
step
public App step(WorkflowStep step)
-
workflowStepEdit
public App workflowStepEdit(String callbackId, WorkflowStepEditHandler handler)
-
workflowStepEdit
public App workflowStepEdit(Pattern callbackId, WorkflowStepEditHandler handler)
-
workflowStepSave
public App workflowStepSave(String callbackId, WorkflowStepSaveHandler handler)
-
workflowStepSave
public App workflowStepSave(Pattern callbackId, WorkflowStepSaveHandler handler)
-
workflowStepExecute
public App workflowStepExecute(String pattern, WorkflowStepExecuteHandler handler)
-
workflowStepExecute
public App workflowStepExecute(Pattern pattern, WorkflowStepExecuteHandler handler)
-
attachmentAction
public App attachmentAction(String callbackId, AttachmentActionHandler handler)
-
attachmentAction
public App attachmentAction(Pattern callbackId, AttachmentActionHandler handler)
-
dialogSubmission
public App dialogSubmission(String callbackId, DialogSubmissionHandler handler)
-
dialogSubmission
public App dialogSubmission(Pattern callbackId, DialogSubmissionHandler handler)
-
dialogSuggestion
public App dialogSuggestion(String callbackId, DialogSuggestionHandler handler)
-
dialogSuggestion
public App dialogSuggestion(Pattern callbackId, DialogSuggestionHandler handler)
-
dialogCancellation
public App dialogCancellation(String callbackId, DialogCancellationHandler handler)
-
dialogCancellation
public App dialogCancellation(Pattern callbackId, DialogCancellationHandler handler)
-
asOAuthApp
public App asOAuthApp(boolean enabled)
-
service
public App service(OAuthCallbackService oAuthCallbackService)
-
service
public App service(OAuthStateService oAuthStateService)
-
service
public App service(InstallationService installationService)
-
oauthCallback
public App oauthCallback(OAuthSuccessHandler handler)
-
oauthCallback
public App oauthCallback(OAuthV2SuccessHandler handler)
-
oauthCallbackError
public App oauthCallbackError(OAuthErrorHandler handler)
-
oauthCallbackStateError
public App oauthCallbackStateError(OAuthStateErrorHandler handler)
-
oauthCallbackAccessError
public App oauthCallbackAccessError(OAuthAccessErrorHandler handler)
-
oauthCallbackAccessError
public App oauthCallbackAccessError(OAuthV2AccessErrorHandler handler)
-
oauthCallbackException
public App oauthCallbackException(OAuthExceptionHandler handler)
-
toOAuthStartApp
@Deprecated public App toOAuthStartApp()
Deprecated.
-
toOAuthInstallPathEnabledApp
public App toOAuthInstallPathEnabledApp()
-
toOAuthCallbackApp
@Deprecated public App toOAuthCallbackApp()
Deprecated.
-
toOAuthRedirectUriPathEnabledApp
public App toOAuthRedirectUriPathEnabledApp()
-
endpoint
public App endpoint(String path, WebEndpointHandler handler)
-
endpoint
public App endpoint(String method, String path, WebEndpointHandler handler)
-
endpoint
public App endpoint(WebEndpoint.Method method, String path, WebEndpointHandler handler)
-
runMiddleware
protected Response runMiddleware(Request request, Response response, Middleware current, LinkedList<Middleware> remaining) throws Exception
- Throws:
Exception
-
runHandler
protected Response runHandler(Request slackRequest) throws IOException, SlackApiException
- Throws:
IOException
SlackApiException
-
builder
public static App.AppBuilder builder()
-
toBuilder
public App.AppBuilder toBuilder()
-
-