AdapterIntegration Interface

public interface AdapterIntegration

An interface that defines the contract between web service integration pieces and the bot adapter.

Method Summary

Modifier and Type Method and Description
abstract java.util.concurrent.CompletableFuture<java.lang.Void> continueConversation(String botId, ConversationReference reference, BotCallbackHandler callback)

Sends a proactive message to a conversation.

abstract java.util.concurrent.CompletableFuture<InvokeResponse> processActivity(String authHeader, Activity activity, BotCallbackHandler callback)

Creates a turn context and runs the middleware pipeline for an incoming activity.

Method Details

continueConversation

public abstract CompletableFuture continueConversation(String botId, ConversationReference reference, BotCallbackHandler callback)

Sends a proactive message to a conversation.

Call this method to proactively send a message to a conversation. Most _channels require a user to initiate a conversation with a bot before the bot can send activities to the user.

Parameters:

botId - The application ID of the bot. This parameter is ignored in single tenant the Adapters (Console, Test, etc) but is critical to the BotFrameworkAdapter which is multi-tenant aware.
reference - A reference to the conversation to continue.
callback - The method to call for the resulting bot turn.

Returns:

A task that represents the work queued to execute.

processActivity

public abstract CompletableFuture processActivity(String authHeader, Activity activity, BotCallbackHandler callback)

Creates a turn context and runs the middleware pipeline for an incoming activity.

Parameters:

authHeader - The HTTP authentication header of the request.
activity - The incoming activity.
callback - The code to run at the end of the adapter's middleware pipeline.

Returns:

A task that represents the work queued to execute. If the activity type was 'Invoke' and the corresponding key (channelId + activityId) was found then an InvokeResponse is returned, otherwise null is returned.

Applies to