SkillHandler Class
- java.
lang. Object - com.
microsoft. bot. builder. ChannelServiceHandler - com.
microsoft. bot. builder. skills. SkillHandler
- com.
- com.
public class SkillHandler
extends ChannelServiceHandler
A Bot Framework Handler for skills.
Field Summary
| Modifier and Type | Field and Description |
|---|---|
| static final java.lang.String |
SKILL_CONVERSATION_REFERENCE_KEY
The skill conversation reference. |
Constructor Summary
| Constructor | Description |
|---|---|
| SkillHandler(BotAdapter adapter, Bot bot, SkillConversationIdFactoryBase conversationIdFactory, CredentialProvider credentialProvider, AuthenticationConfiguration authConfig, ChannelProvider channelProvider) |
Initializes a new instance of the SkillHandler class, using a credential provider. |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onDeleteActivity(ClaimsIdentity claimsIdentity, String conversationId, String activityId)
On |
|
protected
java.util.concurrent.CompletableFuture<Resource |
onReplyToActivity(ClaimsIdentity claimsIdentity, String conversationId, String activityId, Activity activity)
Reply |
|
protected
java.util.concurrent.CompletableFuture<Resource |
onSendToConversation(ClaimsIdentity claimsIdentity, String conversationId, Activity activity)
Send |
|
protected
java.util.concurrent.CompletableFuture<Resource |
onUpdateActivity(ClaimsIdentity claimsIdentity, String conversationId, String activityId, Activity activity)
On |
Methods inherited from ChannelServiceHandler
Methods inherited from java.lang.Object
Field Details
SKILL_CONVERSATION_REFERENCE_KEY
public static final String SKILL_CONVERSATION_REFERENCE_KEY
The skill conversation reference.
Constructor Details
SkillHandler
public SkillHandler(BotAdapter adapter, Bot bot, SkillConversationIdFactoryBase conversationIdFactory, CredentialProvider credentialProvider, AuthenticationConfiguration authConfig, ChannelProvider channelProvider)
Initializes a new instance of the SkillHandler class, using a credential provider.
Parameters:
Method Details
onDeleteActivity
protected CompletableFuture
OnDeleteActivity() API. Override this method to Delete an existing activity. Some channels allow you to delete an existing activity, and if successful this method will remove the specified activity.
Overrides:
SkillHandler.onDeleteActivity(ClaimsIdentity claimsIdentity, String conversationId, String activityId)Parameters:
onReplyToActivity
protected CompletableFuture
ReplyToActivity() API for Skill. This method allows you to reply to an activity. This is slightly different from SendToConversation(). * SendToConversation(conversationId) - will append the activity to the end of the conversation according to the timestamp or semantics of the channel. * ReplyToActivity(conversationId,ActivityId) - adds the activity as a reply to another activity, if the channel supports it. If the channel does not support nested replies, ReplyToActivity falls back to SendToConversation. Use ReplyToActivity when replying to a specific activity in the conversation. Use SendToConversation in all other cases.
Overrides:
SkillHandler.onReplyToActivity(ClaimsIdentity claimsIdentity, String conversationId, String activityId, Activity activity)Parameters:
Returns:
onSendToConversation
protected CompletableFuture
SendToConversation() API for Skill. This method allows you to send an activity to the end of a conversation. This is slightly different from ReplyToActivity(). * SendToConversation(conversationId) - will append the activity to the end of the conversation according to the timestamp or semantics of the channel. * ReplyToActivity(conversationId,ActivityId) - adds the activity as a reply to another activity, if the channel supports it. If the channel does not support nested replies, ReplyToActivity falls back to SendToConversation. Use ReplyToActivity when replying to a specific activity in the conversation. Use SendToConversation in all other cases.
Overrides:
SkillHandler.onSendToConversation(ClaimsIdentity claimsIdentity, String conversationId, Activity activity)Parameters:
Returns:
onUpdateActivity
protected CompletableFuture
OnUpdateActivity() API. Override this method to edit a previously sent existing activity. Some channels allow you to edit an existing activity to reflect the new state of a bot conversation. For example, you can remove buttons after someone has clicked "Approve" button.
Overrides:
SkillHandler.onUpdateActivity(ClaimsIdentity claimsIdentity, String conversationId, String activityId, Activity activity)Parameters: