public class BotManagerImpl extends Object implements BotManager
BotManager的基础实现类,使用Map储存数据。| Constructor and Description |
|---|
BotManagerImpl(PathAssembler pathAssembler,
VerifyFunction verifyFunction) |
| Modifier and Type | Method and Description |
|---|---|
BotInfo[] |
bots()
获取全部的bots信息
|
BotInfo |
defaultBot()
大多数情况下,可能不一定必须指定一个bot,则此方法规定获取一个默认的bot
|
BotInfo |
getBot(String botCode)
通过bot的code获取一个Bot的信息
|
PathAssembler |
getPathAssembler()
获取路径拼接函数
|
VerifyFunction |
getVerifyFunction()
获取注册用的验证函数
|
boolean |
registerBot(BotInfo info)
注册一个botInfo。在实现的时候需要注意线程安全问题,概率较小,但是不是没有可能
|
void |
setDefaultBot(String botCode)
设置默认bot的账号信息
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitregisterBot, registerBot, registerBot, registerBotpublic BotManagerImpl(PathAssembler pathAssembler, VerifyFunction verifyFunction)
public BotInfo defaultBot()
defaultBot in interface BotManagerpublic void setDefaultBot(String botCode)
setDefaultBot in interface BotManagerbotCode - 默认bot的账号信息public BotInfo getBot(String botCode)
getBot in interface BotManagerbotCode - 账号public BotInfo[] bots()
bots in interface BotManagerpublic boolean registerBot(BotInfo info)
registerBot in interface BotManagerinfo - bot信息,作为key的code信息将会从其中获取。info中的各项参数不可为nullpublic VerifyFunction getVerifyFunction()
getVerifyFunction in interface BotManagerpublic PathAssembler getPathAssembler()
getPathAssembler in interface BotManagerCopyright © 2020. All rights reserved.