Class UserResponseMessage
java.lang.Object
com.iohao.net.framework.protocol.CommonMessage
com.iohao.net.framework.protocol.UserResponseMessage
- All Implemented Interfaces:
CommonResponse, FutureMessage, RemoteMessage, Response, UserIdentity
User-facing response message sent back through the external Netty pipeline to the client.
Extends BarMessage and implements Response to provide typed data extraction
from the serialized payload. Decoding uses the external-facing codec obtained from
DataCodecManager. The factory method of() creates a new instance
pre-configured with the business command code.
- Author:
- 渔民小镇
- date:
- 2021-12-20
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected intprotected intCode: 0 for success, others for errors.protected StringException message, JSR 380 validation message.protected Objectprotected Objectprotected intprotected longprotected booleanFields inherited from class CommonMessage
cmdMerge, data, externalServerId, futureId, logicServerId, nanoTime, netId, outputError, sourceServerId, traceId -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintintCode: 0 for success, others for errors.Exception message, JSR 380 validation message.intgetMsgId()long<T> TDecode the response payload into the specified type.boolean<T> List<T> Decode the response payload into a list of the specified element type.static UserResponseMessageof()Create a newUserResponseMessagepre-configured with the business command code.voidsetCacheCondition(int cacheCondition) voidsetCmdCode(int cmdCode) voidsetErrorCode(int errorCode) Code: 0 for success, others for errors.voidsetErrorMessage(String errorMessage) Exception message, JSR 380 validation message.voidsetExternalMessage(Object externalMessage) voidsetInetSocketAddress(Object inetSocketAddress) voidsetMsgId(int msgId) voidsetUserId(long userId) voidsetVerifyIdentity(boolean verifyIdentity) toString()Methods inherited from class CommonMessage
getCmdInfo, getCmdMerge, getData, getExternalServerId, getFutureId, getLogicServerId, getNanoTime, getNetId, getOutputError, getSourceServerId, getTraceId, setCmdInfo, setCmdMerge, setData, setExternalServerId, setFutureId, setLogicServerId, setNanoTime, setNetId, setOutputError, setSourceServerId, setTraceIdMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface CommonResponse
getErrorCode, getErrorMessage, hasError, isSuccess, setError, setErrorCode, setErrorMessageMethods inherited from interface FutureMessage
getFutureId, setFutureIdMethods inherited from interface RemoteMessage
getCmdInfo, getCmdMerge, getData, getExternalServerId, getLogicServerId, getNanoTime, getNetId, getSourceServerId, getTraceId, setCmdInfo, setCmdMerge, setData, setExternalServerId, setLogicServerId, setNanoTime, setNetId, setOutputError, setSourceServerId, setTraceIdMethods inherited from interface Response
getBoolean, getData, getInt, getLong, getString, listBoolean, listInt, listLong, listStringMethods inherited from interface UserIdentity
bindingUserId, getUserId, isVerifyIdentity, setUserId, setUserIdentity, setVerifyIdentity, verifyIdentity
-
Field Details
-
userId
protected long userId -
verifyIdentity
protected boolean verifyIdentity -
msgId
protected int msgId -
cacheCondition
protected int cacheCondition -
errorCode
protected int errorCodeCode: 0 for success, others for errors. -
errorMessage
Exception message, JSR 380 validation message. -
cmdCode
protected transient int cmdCode -
inetSocketAddress
-
externalMessage
-
-
Constructor Details
-
UserResponseMessage
public UserResponseMessage()
-
-
Method Details
-
getValue
-
listValue
-
of
Create a newUserResponseMessagepre-configured with the business command code.- Returns:
- a new user response message
-
toString
-
getUserId
public long getUserId() -
isVerifyIdentity
public boolean isVerifyIdentity() -
getMsgId
public int getMsgId() -
getCacheCondition
public int getCacheCondition() -
getErrorCode
public int getErrorCode()Code: 0 for success, others for errors. -
getErrorMessage
Exception message, JSR 380 validation message. -
getCmdCode
public int getCmdCode() -
getInetSocketAddress
-
getExternalMessage
-
setUserId
public void setUserId(long userId) -
setVerifyIdentity
public void setVerifyIdentity(boolean verifyIdentity) -
setMsgId
public void setMsgId(int msgId) -
setCacheCondition
public void setCacheCondition(int cacheCondition) -
setErrorCode
public void setErrorCode(int errorCode) Code: 0 for success, others for errors. -
setErrorMessage
Exception message, JSR 380 validation message. -
setCmdCode
public void setCmdCode(int cmdCode) -
setInetSocketAddress
-
setExternalMessage
-