Interface CommunicationMessage

All Superinterfaces:
CommonResponse, FutureMessage, RemoteMessage, Request, UserIdentity
All Known Implementing Classes:
AbstractCommunicationMessage, ExternalMessage

public interface CommunicationMessage extends CommonResponse, UserIdentity, Request
Contract for external communication messages exchanged between clients and the external server.

Combines CommonResponse for error handling, UserIdentity for user binding, and Request for routing metadata. Adds protocol-level fields such as the command code, protocol switch flags, message ID, cache condition, and the merged command route key. Implementations are typically codec-generated classes used by the Netty handler pipeline.

Since:
25.1
Author:
渔民小镇
date:
2025-09-24
  • Method Details

    • getCmdCode

      int getCmdCode()
      Get the command code identifying the protocol-level message type.
      Returns:
      the command code
    • setCmdCode

      void setCmdCode(int cmdCode)
      Set the command code identifying the protocol-level message type.
      Parameters:
      cmdCode - the command code
    • getProtocolSwitch

      int getProtocolSwitch()
      Get the protocol switch flags controlling codec behavior.
      Returns:
      the protocol switch bitmask
    • setProtocolSwitch

      void setProtocolSwitch(int protocolSwitch)
      Set the protocol switch flags controlling codec behavior.
      Parameters:
      protocolSwitch - the protocol switch bitmask
    • getCmdMerge

      int getCmdMerge()
      Get the merged command route key (cmd + subCmd packed into a single int).
      Specified by:
      getCmdMerge in interface RemoteMessage
      Returns:
      the merged command key
    • setCmdMerge

      void setCmdMerge(int cmdMerge)
      Set the merged command route key.
      Specified by:
      setCmdMerge in interface RemoteMessage
      Parameters:
      cmdMerge - the merged command key
    • getData

      byte[] getData()
      Get the serialized payload data.
      Specified by:
      getData in interface RemoteMessage
      Returns:
      the payload byte array
    • setData

      void setData(byte[] data)
      Set the serialized payload data.
      Specified by:
      setData in interface RemoteMessage
      Parameters:
      data - the payload byte array
    • getMsgId

      int getMsgId()
      Get the client-assigned message ID for request-response correlation.
      Returns:
      the message ID
    • setMsgId

      void setMsgId(int msgId)
      Set the client-assigned message ID.
      Parameters:
      msgId - the message ID
    • getCacheCondition

      int getCacheCondition()
      Get the cache condition flag indicating whether this message is cacheable.
      Returns:
      the cache condition value
    • setCacheCondition

      void setCacheCondition(int cacheCondition)
      Set the cache condition flag.
      Parameters:
      cacheCondition - the cache condition value
    • getCmdInfo

      default CmdInfo getCmdInfo()
      Derive the CmdInfo route descriptor from the merged command key.
      Specified by:
      getCmdInfo in interface RemoteMessage
      Returns:
      the command info