BotDependencyConfiguration 类

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

public abstract class BotDependencyConfiguration

这为机器人应用程序提供默认的依赖项创建。

此类应由具有 org.springframework.context.annotation.Configuration 批注(或 SpringBootApplication 注释)的类进行子类分类。

机器人应使用 @Component进行批注,可能包括 @AutoWired 来指示要使用的构造函数。

构造函数摘要

构造函数 说明
BotDependencyConfiguration()

方法摘要

修饰符和类型 方法和描述
AuthenticationConfiguration getAuthenticationConfiguration(Configuration configuration)

返回应用程序的身份验证配置。

BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration)

返回应用程序的 BotFrameworkHttp适配器。

ChannelProvider getChannelProvider(Configuration configuration)

返回应用程序的通道提供程序。

Configuration getConfiguration()

返回应用程序的配置。

ConversationState getConversationState(Storage storage)

返回 ConversationState 对象。

CredentialProvider getCredentialProvider(Configuration configuration)

返回应用程序的凭据提供程序。

java.util.concurrent.ExecutorService getExecutorService()

返回执行程序服务。

InspectionState getInspectionState(Storage storage)

创建由 com.microsoft.bot.builder.inspection.InspectionMiddleware使用的检查状态。

Storage getStorage()

返回 Storage 对象。

UserState getUserState(Storage storage)

返回 UserState 对象。

方法继承自 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

构造函数详细信息

BotDependencyConfiguration

public BotDependencyConfiguration()

方法详细信息

getAuthenticationConfiguration

public AuthenticationConfiguration getAuthenticationConfiguration(Configuration configuration)

返回应用程序的 AuthenticationConfiguration。 默认情况下,它使用 AuthenticationConfiguration 类。 单一实例的默认范围。

参数:

configuration - 要从中读取的 Configuration 对象。

返回:

AuthenticationConfiguration 对象。

getBotFrameworkHttpAdaptor

public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration)

返回应用程序的 BotFrameworkHttpAdapter。 默认情况下,它使用 BotFrameworkHttpAdapter 类。 单一实例的默认范围。

参数:

configuration - 要从中读取的 Configuration 对象。

返回:

BotFrameworkHttpAdapter 对象。

getChannelProvider

public ChannelProvider getChannelProvider(Configuration configuration)

返回应用程序的 ChannelProvider。 默认情况下,它使用 ConfigurationChannelProvider 类。 单一实例的默认范围。

参数:

configuration - 要从中读取的 Configuration 对象。

返回:

ChannelProvider 对象。

getConfiguration

public Configuration getConfiguration()

返回应用程序的配置。 默认情况下,它使用 ClasspathPropertiesConfiguration 类。 单一实例的默认范围。

返回:

配置对象。

getConversationState

public ConversationState getConversationState(Storage storage)

返回 ConversationState 对象。 单一实例的默认范围。

参数:

storage - 要使用的 Storage 对象。

返回:

ConversationState 对象。

getCredentialProvider

public CredentialProvider getCredentialProvider(Configuration configuration)

返回应用程序的 CredentialProvider。 默认情况下,它使用 ConfigurationCredentialProvider 类。 单一实例的默认范围。

参数:

configuration - 要从中读取的 Configuration 对象。

返回:

CredentialProvider 对象。

getExecutorService

public ExecutorService getExecutorService()

返回 ExecutorService。

现在,返回 bot-connector ExecutorService。 这是一个需要考虑的领域。 此处的目标是使用通用 ExecutorService 来避免多个线程池。

返回:

ExecutorService。

getInspectionState

public InspectionState getInspectionState(Storage storage)

创建由 com.microsoft.bot.builder.inspection.InspectionMiddleware使用的 InspectionState。 单一实例的默认范围。

参数:

storage - 要使用的存储。 getStorage()

返回:

使用指定存储的 InspectionState 对象。

getStorage

public Storage getStorage()

返回 Storage 对象。 单一实例的默认范围。

返回:

存储对象。

getUserState

public UserState getUserState(Storage storage)

返回 UserState 对象。 单一实例的默认范围。

参数:

storage - 要使用的 Storage 对象。

返回:

UserState 对象。

适用于