SkillHttpClient Class

public class SkillHttpClient
extends BotFrameworkHttpClient

A BotFrameworkHttpClient specialized for Skills that encapsulates Conversation ID generation.

Constructor Summary

Constructor Description
SkillHttpClient(CredentialProvider credentialProvider, SkillConversationIdFactoryBase conversationIdFactory, ChannelProvider channelProvider)

Initializes a new instance of the SkillHttpClient class.

Method Summary

Modifier and Type Method and Description
java.util.concurrent.CompletableFuture<TypedInvokeResponse<T>> <T>postActivity(String fromBotId, BotFrameworkSkill toSkill, URI callbackUrl, Activity activity, Class<T> type)

Forwards an activity to a skill (bot).

java.util.concurrent.CompletableFuture<TypedInvokeResponse<T>> <T>postActivity(String originatingAudience, String fromBotId, BotFrameworkSkill toSkill, URI callbackUrl, Activity activity, Class<T> type)

Uses the SkillConversationIdFactory to create or retrieve a Skill Conversation Id, and sends the activity.

Methods inherited from BotFrameworkHttpClient

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

SkillHttpClient

public SkillHttpClient(CredentialProvider credentialProvider, SkillConversationIdFactoryBase conversationIdFactory, ChannelProvider channelProvider)

Initializes a new instance of the SkillHttpClient class.

Parameters:

credentialProvider - An instance of CredentialProvider.
conversationIdFactory - An instance of a class derived from SkillConversationIdFactoryBase.
channelProvider - An instance of ChannelProvider.

Method Details

<T>postActivity

public CompletableFuture> postActivity(String fromBotId, BotFrameworkSkill toSkill, URI callbackUrl, Activity activity, Class type)

Forwards an activity to a skill (bot).

Parameters:

fromBotId - The MicrosoftAppId of the bot sending the activity.
toSkill - An instance of BotFrameworkSkill .
callbackUrl - The callback Uri.
activity - activity to forward.
type - type of T

Returns:

task with optional invokeResponse of type T.

<T>postActivity

public CompletableFuture> postActivity(String originatingAudience, String fromBotId, BotFrameworkSkill toSkill, URI callbackUrl, Activity activity, Class type)

Uses the SkillConversationIdFactory to create or retrieve a Skill Conversation Id, and sends the activity.

Parameters:

originatingAudience - The oauth audience scope, used during token retrieval. (Either https://api.getbotframework().com or bot app id.)
fromBotId - The MicrosoftAppId of the bot sending the activity.
toSkill - The skill to create the conversation Id for.
callbackUrl - The callback Url for the skill host.
activity - The activity to send.
type - Type of T required due to type erasure of generics in Java.

Returns:

task with invokeResponse.

Applies to