Class CommandExecutionHandler

java.lang.Object
com.ultikits.ultitools.websocket.handlers.CommandExecutionHandler
All Implemented Interfaces:
WebSocketMessageHandler

public class CommandExecutionHandler extends Object implements WebSocketMessageHandler
Handler for remote command execution requests.

处理远程命令执行请求的处理器。

Since:
6.2.0
Version:
1.0.0
Author:
wisdomme
  • Field Details

  • Constructor Details

    • CommandExecutionHandler

      public CommandExecutionHandler(CommandExecutionManager commandManager)
      Creates a handler with the given command manager. 使用给定的命令管理器创建处理器。
      Parameters:
      commandManager - the command execution manager
  • Method Details

    • getMessageType

      public String getMessageType()
      Description copied from interface: WebSocketMessageHandler
      Gets the message type this handler processes. 获取此处理器处理的消息类型。
      Specified by:
      getMessageType in interface WebSocketMessageHandler
      Returns:
      the message type string (e.g., "pong", "server_status")
    • handle

      public void handle(com.google.gson.JsonObject message)
      Description copied from interface: WebSocketMessageHandler
      Handles the incoming message. 处理传入的消息。
      Specified by:
      handle in interface WebSocketMessageHandler
      Parameters:
      message - the JSON message to handle
    • getPriority

      public int getPriority()
      Description copied from interface: WebSocketMessageHandler
      Gets 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:
      getPriority in interface WebSocketMessageHandler
      Returns:
      the priority (default is 0)