public class CounterMessageFlyweight extends CorrelatedMessageFlyweight
Note: Layout should be SBE 2.0 compliant so that the label length is aligned.
LENGTH| Constructor and Description |
|---|
CounterMessageFlyweight() |
| Modifier and Type | Method and Description |
|---|---|
static int |
computeLength(int keyLength,
int labelLength)
Compute the length of the command message given key and label length.
|
CounterMessageFlyweight |
keyBuffer(DirectBuffer keyBuffer,
int keyOffset,
int keyLength)
Fill the key buffer.
|
int |
keyBufferLength()
Length of the key buffer in bytes.
|
int |
keyBufferOffset()
Relative offset of the key buffer.
|
CounterMessageFlyweight |
label(String label)
Fill the label.
|
CounterMessageFlyweight |
labelBuffer(DirectBuffer labelBuffer,
int labelOffset,
int labelLength)
Fill the label buffer.
|
int |
labelBufferLength()
Length of label buffer in bytes.
|
int |
labelBufferOffset()
Relative offset of label buffer.
|
int |
length()
Get the length of the current message.
|
String |
toString() |
int |
typeId()
Get type id field.
|
CounterMessageFlyweight |
typeId(int typeId)
Set counter type id field.
|
void |
validateLength(int msgTypeId,
int length)
Validate buffer length is long enough for message.
|
CounterMessageFlyweight |
wrap(MutableDirectBuffer buffer,
int offset)
Wrap the buffer at a given offset for updates.
|
clientId, clientId, correlationId, correlationIdpublic CounterMessageFlyweight wrap(MutableDirectBuffer buffer, int offset)
wrap in class CorrelatedMessageFlyweightbuffer - to wrap.offset - at which the message begins.public int typeId()
public CounterMessageFlyweight typeId(int typeId)
typeId - field value.public int keyBufferOffset()
public int keyBufferLength()
public CounterMessageFlyweight keyBuffer(DirectBuffer keyBuffer, int keyOffset, int keyLength)
keyBuffer - containing the optional key for the counter.keyOffset - within the keyBuffer at which the key begins.keyLength - of the key in the keyBuffer.public int labelBufferOffset()
public int labelBufferLength()
public CounterMessageFlyweight labelBuffer(DirectBuffer labelBuffer, int labelOffset, int labelLength)
labelBuffer - containing the mandatory label for the counter.labelOffset - within the labelBuffer at which the label begins.labelLength - of the label in the labelBuffer.public CounterMessageFlyweight label(String label)
label - for the counter.public int length()
NB: must be called after the data is written in order to be accurate.
public void validateLength(int msgTypeId,
int length)
validateLength in class CorrelatedMessageFlyweightmsgTypeId - type of message.length - of message in bytes to validate.public static int computeLength(int keyLength,
int labelLength)
keyLength - to be appended.labelLength - to be appended.Copyright © 2014-2023 Real Logic Limited. All Rights Reserved.