Class InboundMessage
java.lang.Object
com.tccc.kos.commons.web.websocket.router.msg.RoutedMessage
com.tccc.kos.commons.web.websocket.router.msg.InboundMessage
All inbound messages to the router are in text form since they originate from
a websocket message. Only the headers are parsed in this message, the body
is still in raw string form.
- Since:
- 1.0
- Version:
- 2022-10-26
-
Field Summary
Fields inherited from class com.tccc.kos.commons.web.websocket.router.msg.RoutedMessage
HEADER_DST_ADDR, HEADER_HIDE, HEADER_LINE_TERMINATOR, HEADER_NAME_VAL_SEPARATOR, HEADER_SRC_ADDR, HEADER_TRACE
-
Constructor Summary
ConstructorsConstructorDescriptionInboundMessage
(WebsocketConnection conn, String str) Create a new message from the specified string.InboundMessage
(String body) Create an inbound message from the serialized body of an outbound message and empty headers.InboundMessage
(Map<String, String> headers, String body) Create an inbound message from the headers and serialized body of an outbound message. -
Method Summary
Methods inherited from class com.tccc.kos.commons.web.websocket.router.msg.RoutedMessage
addHeader, addHeaders, areHeadersModified, getDstAddr, getHeader, getHeaders, getSerializedHeaders, getSrcAddr, getTrace, getType, hasHeader, isHide, removeHeader, setDstAddr, setHeadersModified, setHide, setSrcAddr, setTrace, setType, toRouterAddr
-
Constructor Details
-
InboundMessage
Create a new message from the specified string.- Parameters:
conn
- the connection on which the message arrived (optional)str
- the incoming message to parse
-
InboundMessage
Create an inbound message from the serialized body of an outbound message and empty headers.- Parameters:
body
- the serialized body
-
InboundMessage
Create an inbound message from the headers and serialized body of an outbound message.- Parameters:
headers
- the outbound headersbody
- the serialized body
-
-
Method Details
-
setBody
Set the unparsed body of the message. This will mark the headers modified to ensure the message is regenerated using the body.- Parameters:
body
- the new unparsed body
-
getConn
-
getRawMsg
-
getBody
Description copied from class:RoutedMessage
Returns the body of the message.- Specified by:
getBody
in classRoutedMessage
- Returns:
- the message body
-
setRawMsg
-