Class RegisterCommandStrategy
java.lang.Object
io.github.lunasaw.gbproxy.client.transmit.cmd.strategy.AbstractClientCommandStrategy
io.github.lunasaw.gbproxy.client.transmit.cmd.strategy.impl.RegisterCommandStrategy
- All Implemented Interfaces:
ClientCommandStrategy
REGISTER消息类型策略实现
处理REGISTER注册请求相关命令
- Author:
- luna
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
buildCommandContent
(FromDevice fromDevice, ToDevice toDevice, Object... params) 构建命令内容execute
(FromDevice fromDevice, ToDevice toDevice, Event errorEvent, Event okEvent, Object... params) 执行命令(带事件)获取命令描述获取命令类型protected String
sendCommand
(FromDevice fromDevice, ToDevice toDevice, String content, Event errorEvent, Event okEvent) 发送命令protected void
validateParams
(FromDevice fromDevice, ToDevice toDevice, Object... params) 参数校验Methods inherited from class io.github.lunasaw.gbproxy.client.transmit.cmd.strategy.AbstractClientCommandStrategy
execute, generateSn, getDeviceId
-
Constructor Details
-
RegisterCommandStrategy
public RegisterCommandStrategy()
-
-
Method Details
-
buildCommandContent
Description copied from class:AbstractClientCommandStrategy
构建命令内容- Overrides:
buildCommandContent
in classAbstractClientCommandStrategy
- Parameters:
fromDevice
- 发送设备toDevice
- 接收设备params
- 参数- Returns:
- 命令内容
-
getCommandType
Description copied from interface:ClientCommandStrategy
获取命令类型- Returns:
- 命令类型
-
getCommandDescription
Description copied from interface:ClientCommandStrategy
获取命令描述- Returns:
- 命令描述
-
sendCommand
protected String sendCommand(FromDevice fromDevice, ToDevice toDevice, String content, Event errorEvent, Event okEvent) Description copied from class:AbstractClientCommandStrategy
发送命令- Overrides:
sendCommand
in classAbstractClientCommandStrategy
- Parameters:
fromDevice
- 发送设备toDevice
- 接收设备content
- 命令内容errorEvent
- 错误事件okEvent
- 成功事件- Returns:
- callId
-
execute
public String execute(FromDevice fromDevice, ToDevice toDevice, Event errorEvent, Event okEvent, Object... params) Description copied from interface:ClientCommandStrategy
执行命令(带事件)- Specified by:
execute
in interfaceClientCommandStrategy
- Overrides:
execute
in classAbstractClientCommandStrategy
- Parameters:
fromDevice
- 发送设备toDevice
- 接收设备errorEvent
- 错误事件okEvent
- 成功事件params
- 命令参数- Returns:
- callId
-
validateParams
Description copied from class:AbstractClientCommandStrategy
参数校验- Overrides:
validateParams
in classAbstractClientCommandStrategy
- Parameters:
fromDevice
- 发送设备toDevice
- 接收设备params
- 参数
-