Interface CommunicationMessage
- All Superinterfaces:
CommonResponse, FutureMessage, RemoteMessage, Request, UserIdentity
- All Known Implementing Classes:
AbstractCommunicationMessage, ExternalMessage
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 Summary
Modifier and TypeMethodDescriptionintGet the cache condition flag indicating whether this message is cacheable.intGet the command code identifying the protocol-level message type.default CmdInfoDerive theCmdInforoute descriptor from the merged command key.intGet the merged command route key (cmd + subCmd packed into a single int).byte[]getData()Get the serialized payload data.intgetMsgId()Get the client-assigned message ID for request-response correlation.intGet the protocol switch flags controlling codec behavior.voidsetCacheCondition(int cacheCondition) Set the cache condition flag.voidsetCmdCode(int cmdCode) Set the command code identifying the protocol-level message type.voidsetCmdMerge(int cmdMerge) Set the merged command route key.voidsetData(byte[] data) Set the serialized payload data.voidsetMsgId(int msgId) Set the client-assigned message ID.voidsetProtocolSwitch(int protocolSwitch) Set the protocol switch flags controlling codec behavior.Methods inherited from interface CommonResponse
getErrorCode, getErrorMessage, hasError, isSuccess, setError, setErrorCode, setErrorMessageMethods inherited from interface FutureMessage
getFutureId, setFutureIdMethods inherited from interface RemoteMessage
getExternalServerId, getLogicServerId, getNanoTime, getNetId, getSourceServerId, getTraceId, setCmdInfo, setExternalServerId, setLogicServerId, setNanoTime, setNetId, setOutputError, setSourceServerId, setTraceIdMethods inherited from interface Request
getAttachment, getBindingLogicServerIds, getHopCount, getStick, setAttachment, setBindingLogicServerIds, setHopCount, setStickMethods inherited from interface UserIdentity
bindingUserId, getUserId, isVerifyIdentity, setUserId, setUserIdentity, setVerifyIdentity, verifyIdentity
-
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:
getCmdMergein interfaceRemoteMessage- Returns:
- the merged command key
-
setCmdMerge
void setCmdMerge(int cmdMerge) Set the merged command route key.- Specified by:
setCmdMergein interfaceRemoteMessage- Parameters:
cmdMerge- the merged command key
-
getData
byte[] getData()Get the serialized payload data.- Specified by:
getDatain interfaceRemoteMessage- Returns:
- the payload byte array
-
setData
void setData(byte[] data) Set the serialized payload data.- Specified by:
setDatain interfaceRemoteMessage- 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
Derive theCmdInforoute descriptor from the merged command key.- Specified by:
getCmdInfoin interfaceRemoteMessage- Returns:
- the command info
-