Class ExternalRequestMessage
java.lang.Object
com.iohao.net.framework.protocol.ExternalRequestMessage
- All Implemented Interfaces:
UserIdentity
Request message sent from an external (Netty) server to a logic server.
Carries user identity information, a trace id for distributed tracing,
and the external server / template context. Extends ExternalCommonMessage
with request-specific fields.
- Since:
- 25.1
- Author:
- 渔民小镇
- date:
- 2025-09-10
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintIdentifier of the originating external server.longCorrelation id used to match asynchronous request/response pairs.intgetNetId()Network id identifying the Aeron connection.byte[]Serialized binary payload of the message.intTemplate id of the external server that received the client connection.Distributed trace id for request tracking.longUser id associated with this request.booleanWhether the user's identity has been verified (authenticated).ofClone()Create a shallow clone of this request message.voidsetExternalServerId(int externalServerId) Identifier of the originating external server.voidsetFutureId(long futureId) Correlation id used to match asynchronous request/response pairs.voidsetNetId(int netId) Network id identifying the Aeron connection.default voidsetPayload(boolean payload) Set the payload from abooleanvalue.voidsetPayload(byte[] payload) Serialized binary payload of the message.voidsetPayload(byte[] payload) Set the raw binary payload.default voidsetPayload(int payload) Set the payload from anintvalue.default voidsetPayload(long payload) Set the payload from alongvalue.default voidsetPayload(String payload) Set the payload from aStringvalue.voidsetTemplateId(int templateId) Template id of the external server that received the client connection.voidsetTraceId(String traceId) Distributed trace id for request tracking.voidsetUserId(long userId) User id associated with this request.voidsetVerifyIdentity(boolean verifyIdentity) Whether the user's identity has been verified (authenticated).Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface UserIdentity
bindingUserId, setUserIdentity, verifyIdentity
-
Constructor Details
-
ExternalRequestMessage
public ExternalRequestMessage()
-
-
Method Details
-
ofClone
Create a shallow clone of this request message.- Returns:
- a new
ExternalRequestMessagewith the same field values
-
getUserId
public long getUserId()User id associated with this request.- Specified by:
getUserIdin interfaceUserIdentity- Returns:
- the user id
-
isVerifyIdentity
public boolean isVerifyIdentity()Whether the user's identity has been verified (authenticated).- Specified by:
isVerifyIdentityin interfaceUserIdentity- Returns:
trueif the identity is verified
-
getTemplateId
public int getTemplateId()Template id of the external server that received the client connection. -
getTraceId
Distributed trace id for request tracking. -
getNetId
public int getNetId()Network id identifying the Aeron connection. -
getExternalServerId
public int getExternalServerId()Identifier of the originating external server. -
setUserId
public void setUserId(long userId) User id associated with this request.- Specified by:
setUserIdin interfaceUserIdentity- Parameters:
userId- the user id
-
setVerifyIdentity
public void setVerifyIdentity(boolean verifyIdentity) Whether the user's identity has been verified (authenticated).- Specified by:
setVerifyIdentityin interfaceUserIdentity- Parameters:
verifyIdentity-trueif the identity is verified
-
setTemplateId
public void setTemplateId(int templateId) Template id of the external server that received the client connection. -
setTraceId
Distributed trace id for request tracking. -
setNetId
public void setNetId(int netId) Network id identifying the Aeron connection. -
setExternalServerId
public void setExternalServerId(int externalServerId) Identifier of the originating external server. -
setPayload
void setPayload(byte[] payload) Set the raw binary payload.- Parameters:
payload- the payload bytes
-
setPayload
default void setPayload(int payload) Set the payload from anintvalue.- Parameters:
payload- the int value to serialize
-
setPayload
default void setPayload(long payload) Set the payload from alongvalue.- Parameters:
payload- the long value to serialize
-
setPayload
default void setPayload(boolean payload) Set the payload from abooleanvalue.- Parameters:
payload- the boolean value to serialize
-
setPayload
-
getFutureId
public long getFutureId()Correlation id used to match asynchronous request/response pairs. -
getPayload
public byte[] getPayload()Serialized binary payload of the message. -
setFutureId
public void setFutureId(long futureId) Correlation id used to match asynchronous request/response pairs. -
setPayload
public void setPayload(byte[] payload) Serialized binary payload of the message.
-