Class CommandExecutionHandler
java.lang.Object
com.ultikits.ultitools.websocket.handlers.CommandExecutionHandler
- All Implemented Interfaces:
WebSocketMessageHandler
Handler for remote command execution requests.
处理远程命令执行请求的处理器。
- Since:
- 6.2.0
- Version:
- 1.0.0
- Author:
- wisdomme
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CommandExecutionManagerprivate static final Logger -
Constructor Summary
ConstructorsConstructorDescriptionCommandExecutionHandler(CommandExecutionManager commandManager) Creates a handler with the given command manager. -
Method Summary
Modifier and TypeMethodDescriptionGets the message type this handler processes.intGets the priority of this handler (higher values = higher priority).voidhandle(com.google.gson.JsonObject message) Handles the incoming message.
-
Field Details
-
logger
-
commandManager
-
-
Constructor Details
-
CommandExecutionHandler
Creates a handler with the given command manager. 使用给定的命令管理器创建处理器。- Parameters:
commandManager- the command execution manager
-
-
Method Details
-
getMessageType
Description copied from interface:WebSocketMessageHandlerGets the message type this handler processes. 获取此处理器处理的消息类型。- Specified by:
getMessageTypein interfaceWebSocketMessageHandler- Returns:
- the message type string (e.g., "pong", "server_status")
-
handle
public void handle(com.google.gson.JsonObject message) Description copied from interface:WebSocketMessageHandlerHandles the incoming message. 处理传入的消息。- Specified by:
handlein interfaceWebSocketMessageHandler- Parameters:
message- the JSON message to handle
-
getPriority
public int getPriority()Description copied from interface:WebSocketMessageHandlerGets the priority of this handler (higher values = higher priority). Handlers with higher priority are executed first if multiple handlers match the same message type. 获取此处理器的优先级(值越高优先级越高)。 如果多个处理器匹配相同的消息类型,优先级高的先执行。- Specified by:
getPriorityin interfaceWebSocketMessageHandler- Returns:
- the priority (default is 0)
-