Package org.eclipse.keyple.distributed
Class MessageDto
java.lang.Object
org.eclipse.keyple.distributed.MessageDto
This POJO contains data exchanged between Local and Remote components.
It is built and processed by the main distributed components, and you don't have to modify it.
You only need to transfer it via the network by serializing and deserializing it on your own.
However, it is necessary in some contexts to access certain information such as the sessionId in the case of asynchronous communication or the serverNodeId in the case of synchronous communication with several server instances.
Note that you can extend it or encapsulate it in another object if you need to transport other technical information related to the network infrastructure for example.
- Since:
- 2.0.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal String
Returns the name of the internal action to perform in case of a request, or the original action performed in case of a response.final int
Returns the API level or 0 if the message is received from a system using a version of this library lower than2.3.0
final String
getBody()
Returns the body content.final String
Returns the client node id.final String
Returns the name of the local reader name associated to the transaction.final String
Returns the name of the remote reader associated to the transaction.final String
Returns the server node id.
In case of a multi-servers environment, this field will permit to client or load balancer to identify the target server to access.final String
Returns the session id.
In case of a full duplex communication, this field will permit to client and server to identify the socket.
This id is also useful for debugging.final MessageDto
This setter method must only be used during the deserialization process.final MessageDto
setApiLevel
(int apiLevel) This setter method must only be used during the deserialization process.final MessageDto
This setter method must only be used during the deserialization process.final MessageDto
setClientNodeId
(String clientNodeId) This setter method must only be used during the deserialization process.final MessageDto
setLocalReaderName
(String localReaderName) This setter method must only be used during the deserialization process.final MessageDto
setRemoteReaderName
(String remoteReaderName) This setter method must only be used during the deserialization process.final MessageDto
setServerNodeId
(String serverNodeId) This setter method must only be used during the deserialization process.final MessageDto
setSessionId
(String sessionId) This setter method must only be used during the deserialization process.
-
Constructor Details
-
MessageDto
public MessageDto()Constructor.- Since:
- 2.0.0
-
MessageDto
Constructor by copy.- Parameters:
from
- The source dto to copy.- Since:
- 2.0.0
-
-
Method Details
-
getApiLevel
public final int getApiLevel()Returns the API level or 0 if the message is received from a system using a version of this library lower than2.3.0
- Returns:
- A positive value or 0 if the message is received from a system using a version of this
library lower than
2.3.0
- Since:
- 2.3.0
-
setApiLevel
This setter method must only be used during the deserialization process.- Parameters:
apiLevel
- The API level to set.- Returns:
- the object instance.
- Since:
- 2.3.0
-
getSessionId
Returns the session id.
In case of a full duplex communication, this field will permit to client and server to identify the socket.
This id is also useful for debugging.- Returns:
- a not empty string.
- Since:
- 2.0.0
-
setSessionId
This setter method must only be used during the deserialization process.- Parameters:
sessionId
- The session id to set.- Returns:
- the object instance.
- Since:
- 2.0.0
-
getAction
Returns the name of the internal action to perform in case of a request, or the original action performed in case of a response.- Returns:
- a not empty string.
- Since:
- 2.0.0
-
setAction
This setter method must only be used during the deserialization process.- Parameters:
action
- The action to set.- Returns:
- the object instance.
- Since:
- 2.0.0
-
getClientNodeId
Returns the client node id.- Returns:
- a not empty string.
- Since:
- 2.0.0
-
setClientNodeId
This setter method must only be used during the deserialization process.- Parameters:
clientNodeId
- The client node id to set.- Returns:
- the object instance.
- Since:
- 2.0.0
-
getServerNodeId
Returns the server node id.
In case of a multi-servers environment, this field will permit to client or load balancer to identify the target server to access.- Returns:
- a null string in case of the first transaction call.
- Since:
- 2.0.0
-
setServerNodeId
This setter method must only be used during the deserialization process.- Parameters:
serverNodeId
- The server node id to set.- Returns:
- the object instance.
- Since:
- 2.0.0
-
getLocalReaderName
Returns the name of the local reader name associated to the transaction.- Returns:
- a null string in case of a discovering readers call.
- Since:
- 2.0.0
-
setLocalReaderName
This setter method must only be used during the deserialization process.- Parameters:
localReaderName
- The local reader name to set.- Returns:
- the object instance.
- Since:
- 2.0.0
-
getRemoteReaderName
Returns the name of the remote reader associated to the transaction.- Returns:
- a null string in case of a discovering readers call.
- Since:
- 2.0.0
-
setRemoteReaderName
This setter method must only be used during the deserialization process.- Parameters:
remoteReaderName
- The remote reader name to set.- Returns:
- the object instance.
- Since:
- 2.0.0
-
getBody
Returns the body content.- Returns:
- a null string in case of an error message.
- Since:
- 2.0.0
-
setBody
This setter method must only be used during the deserialization process.- Parameters:
body
- The body to set.- Returns:
- the object instance.
- Since:
- 2.0.0
-