public class CounterMessageFlyweight extends CorrelatedMessageFlyweight
Note: Layout should be SBE 2.0 compliant so that the label length is aligned.
buffer, CLIENT_ID_FIELD_OFFSET, CORRELATION_ID_FIELD_OFFSET, LENGTH, offset| Constructor and Description |
|---|
CounterMessageFlyweight() |
| Modifier and Type | Method and Description |
|---|---|
CounterMessageFlyweight |
keyBuffer(DirectBuffer keyBuffer,
int keyOffset,
int keyLength)
Fill the key buffer.
|
int |
keyBufferLength()
Length of the key buffer in bytes
|
int |
keyBufferOffset()
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()
Offset of label buffer.
|
int |
length()
Get the length of the current message
|
int |
typeId()
return type id field
|
CounterMessageFlyweight |
typeId(long typeId)
set counter type id field
|
void |
validateLength(int msgTypeId,
int length)
Validate buffer length is long enough for message.
|
clientId, clientId, correlationId, correlationId, wrappublic int typeId()
public CounterMessageFlyweight typeId(long typeId)
typeId - field valuepublic 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 counterpublic 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.Copyright © 2014-2019 Real Logic Ltd. All Rights Reserved.