TeamsActivityHandler Class
- java.
lang. Object - com.
microsoft. bot. builder. ActivityHandler - com.
microsoft. bot. builder. teams. TeamsActivityHandler
- com.
- com.
public class TeamsActivityHandler
extends ActivityHandler
A Teams implementation of the Bot interface intended for further subclassing. Derive from this class to plug in code to handle particular Activity types. Pre and post processing of Activities can be plugged in by deriving and calling the base class implementation.
Constructor Summary
| Constructor | Description | |
|---|---|---|
| TeamsActivityHandler() | ||
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| protected java.util.concurrent.CompletableFuture<T> |
<T>notImplemented()
Invoke a new Invoke |
| protected java.util.concurrent.CompletableFuture<T> |
<T>notImplemented(String body)
Invoke a new Invoke |
| protected java.util.concurrent.CompletableFuture<T> |
<T>withException(Throwable t)
Error handler that can catch exceptions. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onConversationUpdateActivity(TurnContext turnContext)
Invoked when a conversation update activity is received from the channel. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onEventActivity(TurnContext turnContext)
Invoked when a "tokens/response" event is received when the base behavior of onEventActivity(TurnContext turnContext) is used. |
|
protected
java.util.concurrent.CompletableFuture<Invoke |
onInvokeActivity(TurnContext turnContext)
Invoked when an invoke activity is received from the connector when the base behavior of on |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onSignInInvoke(TurnContext turnContext)
Invoked when a sign |
|
protected
java.util.concurrent.CompletableFuture<Messaging |
onTeamsAppBasedLinkQuery(TurnContext turnContext, AppBasedLinkQuery query)
Invoked when an app based link query activity is received from the connector. |
|
protected
java.util.concurrent.CompletableFuture<Invoke |
onTeamsCardActionInvoke(TurnContext turnContext)
Invoked when a card action invoke activity is received from the connector. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onTeamsChannelCreated(ChannelInfo channelInfo, TeamInfo teamInfo, TurnContext turnContext)
Invoked when a Channel Created event activity is received from the connector. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onTeamsChannelDeleted(ChannelInfo channelInfo, TeamInfo teamInfo, TurnContext turnContext)
Invoked when a Channel Deleted event activity is received from the connector. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onTeamsChannelRenamed(ChannelInfo channelInfo, TeamInfo teamInfo, TurnContext turnContext)
Invoked when a Channel Renamed event activity is received from the connector. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onTeamsChannelRestored(ChannelInfo channelInfo, TeamInfo teamInfo, TurnContext turnContext)
Invoked when a Channel Restored event activity is received from the connector. |
|
protected
java.util.concurrent.CompletableFuture<Invoke |
onTeamsFileConsent(TurnContext turnContext, FileConsentCardResponse fileConsentCardResponse)
Invoked when a file consent card activity is received from the connector. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onTeamsFileConsentAccept(TurnContext turnContext, FileConsentCardResponse fileConsentCardResponse)
Invoked when a file consent card is accepted by the user. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onTeamsFileConsentDecline(TurnContext turnContext, FileConsentCardResponse fileConsentCardResponse)
Invoked when a file consent card is declined by the user. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onTeamsMeetingEnd(MeetingEndEventDetails meeting, TurnContext turnContext)
Invoked when a Teams Meeting End event activity is received from the connector. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onTeamsMeetingStart(MeetingStartEventDetails meeting, TurnContext turnContext)
Invoked when a Teams Meeting Start event activity is received from the connector. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onTeamsMembersAdded(List<TeamsChannelAccount> membersAdded, TeamInfo teamInfo, TurnContext turnContext)
Override this in a derived class to provide logic for when members other than the bot join the channel, such as your bot's welcome logic. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onTeamsMembersAddedDispatch(List<ChannelAccount> membersAdded, TeamInfo teamInfo, TurnContext turnContext)
Override this in a derived class to provide logic for when members other than the bot join the channel, such as your bot's welcome logic. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onTeamsMembersRemoved(List<TeamsChannelAccount> membersRemoved, TeamInfo teamInfo, TurnContext turnContext)
Override this in a derived class to provide logic for when members other than the bot leave the channel, such as your bot's good-bye logic. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onTeamsMembersRemovedDispatch(List<ChannelAccount> membersRemoved, TeamInfo teamInfo, TurnContext turnContext)
Override this in a derived class to provide logic for when members other than the bot leave the channel, such as your bot's good-bye logic. |
|
protected
java.util.concurrent.CompletableFuture<Messaging |
onTeamsMessagingExtensionBotMessagePreviewEdit(TurnContext turnContext, MessagingExtensionAction action)
Invoked when a messaging extension bot message preview edit activity is received from the connector. |
|
protected
java.util.concurrent.CompletableFuture<Messaging |
onTeamsMessagingExtensionBotMessagePreviewSend(TurnContext turnContext, MessagingExtensionAction action)
Invoked when a messaging extension bot message preview send activity is received from the connector. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onTeamsMessagingExtensionCardButtonClicked(TurnContext turnContext, Object cardData)
Override this in a derived class to provide logic for when a card button is clicked in a messaging extension. |
|
protected
java.util.concurrent.CompletableFuture<Messaging |
onTeamsMessagingExtensionConfigurationQuerySettingUrl(TurnContext turnContext, MessagingExtensionQuery query)
Invoked when a messaging extension configuration query setting url activity is received from the connector. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onTeamsMessagingExtensionConfigurationSetting(TurnContext turnContext, Object settings)
Override this in a derived class to provide logic for when a configuration is set for a messaging extension. |
|
protected
java.util.concurrent.CompletableFuture<Messaging |
onTeamsMessagingExtensionFetchTask(TurnContext turnContext, MessagingExtensionAction action)
Invoked when a Messaging Extension Fetch activity is received from the connector. |
|
protected
java.util.concurrent.CompletableFuture<Messaging |
onTeamsMessagingExtensionQuery(TurnContext turnContext, MessagingExtensionQuery query)
Invoked when a Messaging Extension Query activity is received from the connector. |
|
protected
java.util.concurrent.CompletableFuture<Messaging |
onTeamsMessagingExtensionSelectItem(TurnContext turnContext, Object query)
Invoked when a messaging extension select item activity is received from the connector. |
|
protected
java.util.concurrent.CompletableFuture<Messaging |
onTeamsMessagingExtensionSubmitAction(TurnContext turnContext, MessagingExtensionAction action)
Invoked when a messaging extension submit action activity is received from the connector. |
|
protected
java.util.concurrent.CompletableFuture<Messaging |
onTeamsMessagingExtensionSubmitActionDispatch(TurnContext turnContext, MessagingExtensionAction action)
Invoked when a messaging extension submit action dispatch activity is received from the connector. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onTeamsO365ConnectorCardAction(TurnContext turnContext, O365ConnectorCardActionQuery query)
Invoked when a O365 Connector Card Action activity is received from the connector. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onTeamsSigninVerifyState(TurnContext turnContext)
Invoked when a sign |
|
protected
java.util.concurrent.CompletableFuture<Tab |
onTeamsTabFetch(TurnContext turnContext, TabRequest tabRequest)
Override this in a derived class to provide logic for when a tab is fetched. |
|
protected
java.util.concurrent.CompletableFuture<Tab |
onTeamsTabSubmit(TurnContext turnContext, TabSubmit tabSubmit)
Override this in a derived class to provide logic for when a tab is submitted. |
|
protected
java.util.concurrent.CompletableFuture<Task |
onTeamsTaskModuleFetch(TurnContext turnContext, TaskModuleRequest taskModuleRequest)
Override this in a derived class to provide logic for when a task module is fetched. |
|
protected
java.util.concurrent.CompletableFuture<Task |
onTeamsTaskModuleSubmit(TurnContext turnContext, TaskModuleRequest taskModuleRequest)
Override this in a derived class to provide logic for when a task module is submited. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onTeamsTeamArchived(ChannelInfo channelInfo, TeamInfo teamInfo, TurnContext turnContext)
Invoked when a Team Archived event activity is received from the connector. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onTeamsTeamDeleted(ChannelInfo channelInfo, TeamInfo teamInfo, TurnContext turnContext)
Invoked when a Team Deleted event activity is received from the connector. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onTeamsTeamHardDeleted(ChannelInfo channelInfo, TeamInfo teamInfo, TurnContext turnContext)
Invoked when a Team Hard Deleted event activity is received from the connector. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onTeamsTeamRenamed(ChannelInfo channelInfo, TeamInfo teamInfo, TurnContext turnContext)
Invoked when a Channel Renamed event activity is received from the connector. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onTeamsTeamRestored(ChannelInfo channelInfo, TeamInfo teamInfo, TurnContext turnContext)
Invoked when a Team Restored event activity is received from the connector. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onTeamsTeamUnarchived(ChannelInfo channelInfo, TeamInfo teamInfo, TurnContext turnContext)
Invoked when a Team Unarchived event activity is received from the connector. |
Methods inherited from ActivityHandler
Methods inherited from java.lang.Object
Constructor Details
TeamsActivityHandler
public TeamsActivityHandler()
Method Details
<T>notImplemented
protected CompletableFuture
Invoke a new InvokeResponseException with a HTTP 501 code status.
Returns:
<T>notImplemented
protected CompletableFuture
Invoke a new InvokeResponseException with a HTTP 501 code status.
Parameters:
Returns:
<T>withException
protected CompletableFuture
Error handler that can catch exceptions.
Parameters:
Returns:
onConversationUpdateActivity
protected CompletableFuture
Invoked when a conversation update activity is received from the channel. Conversation update activities are useful when it comes to responding to users being added to or removed from the channel. For example, a bot could respond to a user being added by greeting the user.
Overrides:
TeamsActivityHandler.onConversationUpdateActivity(TurnContext turnContext)Parameters:
Returns:
onEventActivity
protected CompletableFuture
Invoked when a "tokens/response" event is received when the base behavior of onEventActivity(TurnContext turnContext) is used.
If using an OAuthPrompt, override this method to forward this Activity to the current dialog.
By default, this method does nothing.
When the onEventActivity(TurnContext turnContext) method receives an event with a com.microsoft.bot.schema.Activity#getName() of `tokens/response`, it calls this method.
Overrides:
TeamsActivityHandler.onEventActivity(TurnContext turnContext)Parameters:
Returns:
onInvokeActivity
protected CompletableFuture
Invoked when an invoke activity is received from the connector when the base behavior of onTurn is used.
Overrides:
TeamsActivityHandler.onInvokeActivity(TurnContext turnContext)Parameters:
Returns:
onSignInInvoke
protected CompletableFuture
Invoked when a signIn invoke activity is received from the connector.
Overrides:
TeamsActivityHandler.onSignInInvoke(TurnContext turnContext)Parameters:
Returns:
onTeamsAppBasedLinkQuery
protected CompletableFuture
Invoked when an app based link query activity is received from the connector.
Parameters:
Returns:
onTeamsCardActionInvoke
protected CompletableFuture
Invoked when a card action invoke activity is received from the connector.
Parameters:
Returns:
onTeamsChannelCreated
protected CompletableFuture
Invoked when a Channel Created event activity is received from the connector. Channel Created correspond to the user creating a new channel.
Parameters:
Returns:
onTeamsChannelDeleted
protected CompletableFuture
Invoked when a Channel Deleted event activity is received from the connector. Channel Deleted correspond to the user deleting an existing channel.
Parameters:
Returns:
onTeamsChannelRenamed
protected CompletableFuture
Invoked when a Channel Renamed event activity is received from the connector. Channel Renamed correspond to the user renaming an existing channel.
Parameters:
Returns:
onTeamsChannelRestored
protected CompletableFuture
Invoked when a Channel Restored event activity is received from the connector. Channel Restored correspond to the user restoring a previously deleted channel.
Parameters:
Returns:
onTeamsFileConsent
protected CompletableFuture
Invoked when a file consent card activity is received from the connector.
Parameters:
Returns:
onTeamsFileConsentAccept
protected CompletableFuture
Invoked when a file consent card is accepted by the user.
Parameters:
Returns:
onTeamsFileConsentDecline
protected CompletableFuture
Invoked when a file consent card is declined by the user.
Parameters:
Returns:
onTeamsMeetingEnd
protected CompletableFuture
Invoked when a Teams Meeting End event activity is received from the connector. Override this in a derived class to provide logic for when a meeting is ended.
Parameters:
Returns:
onTeamsMeetingStart
protected CompletableFuture
Invoked when a Teams Meeting Start event activity is received from the connector. Override this in a derived class to provide logic for when a meeting is started.
Parameters:
Returns:
onTeamsMembersAdded
protected CompletableFuture
Override this in a derived class to provide logic for when members other than the bot join the channel, such as your bot's welcome logic.
Parameters:
Returns:
onTeamsMembersAddedDispatch
protected CompletableFuture
Override this in a derived class to provide logic for when members other than the bot join the channel, such as your bot's welcome logic. It will get the associated members with the provided accounts.
Parameters:
Returns:
onTeamsMembersRemoved
protected CompletableFuture
Override this in a derived class to provide logic for when members other than the bot leave the channel, such as your bot's good-bye logic.
Parameters:
Returns:
onTeamsMembersRemovedDispatch
protected CompletableFuture
Override this in a derived class to provide logic for when members other than the bot leave the channel, such as your bot's good-bye logic. It will get the associated members with the provided accounts.
Parameters:
Returns:
onTeamsMessagingExtensionBotMessagePreviewEdit
protected CompletableFuture
Invoked when a messaging extension bot message preview edit activity is received from the connector.
Parameters:
Returns:
onTeamsMessagingExtensionBotMessagePreviewSend
protected CompletableFuture
Invoked when a messaging extension bot message preview send activity is received from the connector.
Parameters:
Returns:
onTeamsMessagingExtensionCardButtonClicked
protected CompletableFuture
Override this in a derived class to provide logic for when a card button is clicked in a messaging extension.
Parameters:
Returns:
onTeamsMessagingExtensionConfigurationQuerySettingUrl
protected CompletableFuture
Invoked when a messaging extension configuration query setting url activity is received from the connector.
Parameters:
Returns:
onTeamsMessagingExtensionConfigurationSetting
protected CompletableFuture
Override this in a derived class to provide logic for when a configuration is set for a messaging extension.
Parameters:
Returns:
onTeamsMessagingExtensionFetchTask
protected CompletableFuture
Invoked when a Messaging Extension Fetch activity is received from the connector.
Parameters:
Returns:
onTeamsMessagingExtensionQuery
protected CompletableFuture
Invoked when a Messaging Extension Query activity is received from the connector.
Parameters:
Returns:
onTeamsMessagingExtensionSelectItem
protected CompletableFuture
Invoked when a messaging extension select item activity is received from the connector.
Parameters:
Returns:
onTeamsMessagingExtensionSubmitAction
protected CompletableFuture
Invoked when a messaging extension submit action activity is received from the connector.
Parameters:
Returns:
onTeamsMessagingExtensionSubmitActionDispatch
protected CompletableFuture
Invoked when a messaging extension submit action dispatch activity is received from the connector.
Parameters:
Returns:
onTeamsO365ConnectorCardAction
protected CompletableFuture
Invoked when a O365 Connector Card Action activity is received from the connector.
Parameters:
Returns:
onTeamsSigninVerifyState
protected CompletableFuture
Invoked when a signIn verify state activity is received from the connector.
Parameters:
Returns:
onTeamsTabFetch
protected CompletableFuture
Override this in a derived class to provide logic for when a tab is fetched.
Parameters:
Returns:
onTeamsTabSubmit
protected CompletableFuture
Override this in a derived class to provide logic for when a tab is submitted.
Parameters:
Returns:
onTeamsTaskModuleFetch
protected CompletableFuture
Override this in a derived class to provide logic for when a task module is fetched.
Parameters:
Returns:
onTeamsTaskModuleSubmit
protected CompletableFuture
Override this in a derived class to provide logic for when a task module is submited.
Parameters:
Returns:
onTeamsTeamArchived
protected CompletableFuture
Invoked when a Team Archived event activity is received from the connector. Team Archived correspond to the user archiving a team.
Parameters:
Returns:
onTeamsTeamDeleted
protected CompletableFuture
Invoked when a Team Deleted event activity is received from the connector. Team Deleted correspond to the user deleting a team.
Parameters:
Returns:
onTeamsTeamHardDeleted
protected CompletableFuture
Invoked when a Team Hard Deleted event activity is received from the connector. Team Hard Deleted correspond to the user hard-deleting a team.
Parameters:
Returns:
onTeamsTeamRenamed
protected CompletableFuture
Invoked when a Channel Renamed event activity is received from the connector. Channel Renamed correspond to the user renaming an existing channel.
Parameters:
Returns:
onTeamsTeamRestored
protected CompletableFuture
Invoked when a Team Restored event activity is received from the connector. Team Restored correspond to the user restoring a team.
Parameters:
Returns:
onTeamsTeamUnarchived
protected CompletableFuture
Invoked when a Team Unarchived event activity is received from the connector. Team Unarchived correspond to the user unarchiving a team.
Parameters:
Returns: