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

public final class UserResponseMessage extends CommonMessage implements Response
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 Details

    • userId

      protected long userId
    • verifyIdentity

      protected boolean verifyIdentity
    • msgId

      protected int msgId
    • cacheCondition

      protected int cacheCondition
    • errorCode

      protected int errorCode
      Code: 0 for success, others for errors.
    • errorMessage

      protected String errorMessage
      Exception message, JSR 380 validation message.
    • cmdCode

      protected transient int cmdCode
    • inetSocketAddress

      protected transient Object inetSocketAddress
    • externalMessage

      protected transient Object externalMessage
  • Constructor Details

    • UserResponseMessage

      public UserResponseMessage()
  • Method Details

    • getValue

      public <T> T getValue(Class<T> clazz)
      Decode the response payload into the specified type.
      Specified by:
      getValue in interface Response
      Type Parameters:
      T - the target type
      Parameters:
      clazz - the class to decode into
      Returns:
      the decoded object
    • listValue

      public <T> List<T> listValue(Class<? extends T> clazz)
      Decode the response payload into a list of the specified element type.
      Specified by:
      listValue in interface Response
      Type Parameters:
      T - the element type
      Parameters:
      clazz - the element class to decode into
      Returns:
      a list of decoded objects
    • of

      public static UserResponseMessage of()
      Create a new UserResponseMessage pre-configured with the business command code.
      Returns:
      a new user response message
    • toString

      public String 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

      public String getErrorMessage()
      Exception message, JSR 380 validation message.
    • getCmdCode

      public int getCmdCode()
    • getInetSocketAddress

      public Object getInetSocketAddress()
    • getExternalMessage

      public Object 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

      public void setErrorMessage(String errorMessage)
      Exception message, JSR 380 validation message.
    • setCmdCode

      public void setCmdCode(int cmdCode)
    • setInetSocketAddress

      public void setInetSocketAddress(Object inetSocketAddress)
    • setExternalMessage

      public void setExternalMessage(Object externalMessage)