public interface BotManager
Modifier and Type | Method and Description |
---|---|
BotInfo[] |
bots()
获取全部的bot信息
|
BotInfo |
defaultBot()
大多数情况下,可能不一定必须指定一个bot,则此方法规定获取一个默认的bot
|
BotInfo |
getBot(String botCode)
通过bot的code获取一个Bot的信息
参数有可能为null
|
PathAssembler |
getPathAssembler()
获取路径拼接函数
|
VerifyFunction |
getVerifyFunction()
获取注册用的验证函数
|
boolean |
registerBot(BotInfo info)
注册一个botInfo。在实现的时候需要注意线程安全问题,概率较小,但是不是没有可能
|
default boolean |
registerBot(String fullPath)
注册一个bot。code为null
|
default boolean |
registerBot(String ip,
int port,
String path)
注册一个bot。code为null
|
default boolean |
registerBot(String code,
String fullPath)
注册一个bot。
|
default boolean |
registerBot(String code,
String ip,
int port,
String path)
注册一个bot。
|
void |
setDefaultBot(String botCode)
设置默认bot的账号信息
|
BotInfo defaultBot()
void setDefaultBot(String botCode)
botCode
- 默认bot的账号信息BotInfo getBot(String botCode)
botCode
- 账号BotInfo[] bots()
boolean registerBot(BotInfo info)
info
- bot信息,作为key的code信息将会从其中获取。info中的各项参数不可为nulldefault boolean registerBot(String code, String ip, int port, String path)
code
- 账号, 可以为nullip
- ip地址port
- 端口号path
- 请求路径default boolean registerBot(String code, String fullPath)
code
- 账号, 可以为nullfullPath
- 完整路径default boolean registerBot(String ip, int port, String path)
ip
- ip地址port
- 端口号path
- 请求路径default boolean registerBot(String fullPath)
fullPath
- 完整路径VerifyFunction getVerifyFunction()
PathAssembler getPathAssembler()
Copyright © 2020. All rights reserved.