BotDependencyConfiguration Class

  • java.lang.Object
    • com.microsoft.bot.integration.spring.BotDependencyConfiguration

public abstract class BotDependencyConfiguration

This provides the default dependency creation for a Bot application.

This class should be subclassed by a class with the org.springframework.context.annotation.Configuration annotation (or SpringBootApplication annotation).

The Bot should be annotated with @Component, possibly including @AutoWired to indicate which constructor to use.

Constructor Summary

Constructor Description
BotDependencyConfiguration()

Method Summary

Modifier and Type Method and Description
AuthenticationConfiguration getAuthenticationConfiguration(Configuration configuration)

Returns the AuthenticationConfiguration for the application.

BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration)

Returns the BotFrameworkHttpAdapter for the application.

ChannelProvider getChannelProvider(Configuration configuration)

Returns the ChannelProvider for the application.

Configuration getConfiguration()

Returns the Configuration for the application.

ConversationState getConversationState(Storage storage)

Returns a ConversationState object.

CredentialProvider getCredentialProvider(Configuration configuration)

Returns the CredentialProvider for the application.

java.util.concurrent.ExecutorService getExecutorService()

Returns an ExecutorService.

InspectionState getInspectionState(Storage storage)

Creates an InspectionState used by com.microsoft.bot.builder.inspection.InspectionMiddleware.

Storage getStorage()

Returns a Storage object.

UserState getUserState(Storage storage)

Returns a UserState object.

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

BotDependencyConfiguration

public BotDependencyConfiguration()

Method Details

getAuthenticationConfiguration

public AuthenticationConfiguration getAuthenticationConfiguration(Configuration configuration)

Returns the AuthenticationConfiguration for the application. By default, it uses the AuthenticationConfiguration class. Default scope of Singleton.

Parameters:

configuration - The Configuration object to read from.

Returns:

An AuthenticationConfiguration object.

getBotFrameworkHttpAdaptor

public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration)

Returns the BotFrameworkHttpAdapter for the application. By default, it uses the BotFrameworkHttpAdapter class. Default scope of Singleton.

Parameters:

configuration - The Configuration object to read from.

Returns:

A BotFrameworkHttpAdapter object.

getChannelProvider

public ChannelProvider getChannelProvider(Configuration configuration)

Returns the ChannelProvider for the application. By default, it uses the ConfigurationChannelProvider class. Default scope of Singleton.

Parameters:

configuration - The Configuration object to read from.

Returns:

A ChannelProvider object.

getConfiguration

public Configuration getConfiguration()

Returns the Configuration for the application. By default, it uses the ClasspathPropertiesConfiguration class. Default scope of Singleton.

Returns:

A Configuration object.

getConversationState

public ConversationState getConversationState(Storage storage)

Returns a ConversationState object. Default scope of Singleton.

Parameters:

storage - The Storage object to use.

Returns:

A ConversationState object.

getCredentialProvider

public CredentialProvider getCredentialProvider(Configuration configuration)

Returns the CredentialProvider for the application. By default, it uses the ConfigurationCredentialProvider class. Default scope of Singleton.

Parameters:

configuration - The Configuration object to read from.

Returns:

A CredentialProvider object.

getExecutorService

public ExecutorService getExecutorService()

Returns an ExecutorService.

For now, return the bot-connector ExecutorService. This is an area of consideration. The goal here is to have a common ExecutorService to avoid multiple thread pools.

Returns:

An ExecutorService.

getInspectionState

public InspectionState getInspectionState(Storage storage)

Creates an InspectionState used by com.microsoft.bot.builder.inspection.InspectionMiddleware. Default scope of Singleton.

Parameters:

storage - The Storage to use. getStorage()

Returns:

An InspectionState object that uses the specified storage.

getStorage

public Storage getStorage()

Returns a Storage object. Default scope of Singleton.

Returns:

A Storage object.

getUserState

public UserState getUserState(Storage storage)

Returns a UserState object. Default scope of Singleton.

Parameters:

storage - The Storage object to use.

Returns:

A UserState object.

Applies to