ByteBuffer.
An attempt is made to read all complete STOMP frames from the buffer, which could be zero, one, or more. If there is any left-over content, i.e. an incomplete STOMP frame, at the end the buffer is reset to point to the beginning of the partial content. The caller is then responsible for dealing with that incomplete content by buffering until there is more input available.
| Modifier and Type | Field and Description |
|---|---|
| private MessageHeaderInitializer | |
| pack-priv static final byte[] | |
| private static final Log |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public List | Returns: the decoded messages, or an empty list if nonethe buffer to decode the STOMP frame from byteBuffer)Decodes one or more STOMP frames from the given |
| public List | Returns: the decoded messages, or an empty list if nonethe buffer to decode the STOMP frame from byteBuffer, MultiValueMap<String, String> an empty output map that will store the last
successfully parsed partialMessageHeaders in case of partial message content
in cases where the partial buffer ended with a partial STOMP frame partialMessageHeaders)Decodes one or more STOMP frames from the given |
| private Message | decodeMessage(ByteBuffer byteBuffer, MultiValueMap<String, String> headers)
Decode a single STOMP frame from the given |
| public MessageHeaderInitializer | |
| private void | |
| private String | |
| private void | |
| private byte[] | |
| public void | setHeaderInitializer(MessageHeaderInitializer headerInitializer)
Configure a |
| protected void | skipEol(ByteBuffer byteBuffer)
Skip one ore more EOL characters at the start of the given ByteBuffer. |
| private boolean | Returns: whether an EOL was consumedTry to read an EOL incrementing the buffer position if successful. |
| private String |
| headerInitializer | back to summary |
|---|---|
| private MessageHeaderInitializer headerInitializer
| |
| HEARTBEAT_PAYLOAD | back to summary |
|---|---|
| pack-priv static final byte[] HEARTBEAT_PAYLOAD | |
| logger | back to summary |
|---|---|
| private static final Log logger | |
| StompDecoder | back to summary |
|---|---|
| public StompDecoder() | |
| decode | back to summary |
|---|---|
| public List Decodes one or more STOMP frames from the given
| |
| decode | back to summary |
|---|---|
| public List Decodes one or more STOMP frames from the given If the given ByteBuffer contains only partial STOMP frame content and no complete STOMP frames, an empty list is returned, and the buffer is reset to where it was. If the buffer contains one or more STOMP frames, those are returned and the buffer reset to point to the beginning of the unused partial content. The output partialMessageHeaders map is used to store successfully parsed headers in case of partial content. The caller can then check if a "content-length" header was read, which helps to determine how much more content is needed before the next attempt to decode.
| |
| decodeMessage | back to summary |
|---|---|
| private Message Decode a single STOMP frame from the given
| |
| getHeaderInitializer | back to summary |
|---|---|
| public MessageHeaderInitializer getHeaderInitializer() Return the configured
| |
| initHeaders | back to summary |
|---|---|
| private void initHeaders(StompHeaderAccessor headerAccessor) | |
| readCommand | back to summary |
|---|---|
| private String readCommand(ByteBuffer byteBuffer) | |
| readHeaders | back to summary |
|---|---|
| private void readHeaders(ByteBuffer byteBuffer, StompHeaderAccessor headerAccessor, StompCommand command) | |
| readPayload | back to summary |
|---|---|
private byte[] readPayload(ByteBuffer byteBuffer, StompHeaderAccessor headerAccessor)
| |
| setHeaderInitializer | back to summary |
|---|---|
| public void setHeaderInitializer(MessageHeaderInitializer headerInitializer) Configure a | |
| skipEol | back to summary |
|---|---|
| protected void skipEol(ByteBuffer byteBuffer) Skip one ore more EOL characters at the start of the given ByteBuffer. STOMP, section 2.1 says: "The NULL octet can be optionally followed by multiple EOLs." | |
| tryConsumeEndOfLine | back to summary |
|---|---|
| private boolean tryConsumeEndOfLine(ByteBuffer byteBuffer) Try to read an EOL incrementing the buffer position if successful.
| |
| unescape | back to summary |
|---|---|
| private String unescape(String inString) See STOMP Spec 1.2: "Value Encoding". | |