Package io.aeron.command
Class PublicationMessageFlyweight
java.lang.Object
io.aeron.command.CorrelatedMessageFlyweight
io.aeron.command.PublicationMessageFlyweight
Control message for adding or removing a publication
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Client ID | | | +---------------------------------------------------------------+ | Correlation ID | | | +---------------------------------------------------------------+ | Stream ID | +---------------------------------------------------------------+ | Channel Length | +---------------------------------------------------------------+ | Channel (ASCII) ... ... | +---------------------------------------------------------------+
-
Field Summary
Fields inherited from class io.aeron.command.CorrelatedMessageFlyweight
LENGTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendChannel(Appendable appendable) Append the channel value to anAppendable.channel()Get the channel field in ASCII.Set the channel field in ASCII.static intcomputeLength(int channelLength) Compute the length of the command message for a given channel length.intlength()Get the length of the current message.intstreamId()Get the stream id field.streamId(int streamId) Set the stream id field.voidvalidateLength(int msgTypeId, int length) Validate buffer length is long enough for message.wrap(MutableDirectBuffer buffer, int offset) Wrap the buffer at a given offset for updates.Methods inherited from class io.aeron.command.CorrelatedMessageFlyweight
clientId, clientId, correlationId, correlationId
-
Constructor Details
-
PublicationMessageFlyweight
public PublicationMessageFlyweight()
-
-
Method Details
-
wrap
Wrap the buffer at a given offset for updates.- Overrides:
wrapin classCorrelatedMessageFlyweight- Parameters:
buffer- to wrap.offset- at which the message begins.- Returns:
- this for a fluent API.
-
streamId
public int streamId()Get the stream id field.- Returns:
- stream id field.
-
streamId
Set the stream id field.- Parameters:
streamId- field value.- Returns:
- this for a fluent API.
-
channel
Get the channel field in ASCII.- Returns:
- channel field.
-
appendChannel
Append the channel value to anAppendable.- Parameters:
appendable- to append channel to.
-
channel
Set the channel field in ASCII.- Parameters:
channel- field value.- Returns:
- this for a fluent API.
-
length
public int length()Get the length of the current message.NB: must be called after the data is written in order to be accurate.
- Returns:
- the length of the current message.
-
validateLength
public void validateLength(int msgTypeId, int length) Validate buffer length is long enough for message.- Overrides:
validateLengthin classCorrelatedMessageFlyweight- Parameters:
msgTypeId- type of message.length- of message in bytes to validate.
-
computeLength
public static int computeLength(int channelLength) Compute the length of the command message for a given channel length.- Parameters:
channelLength- to be appended to the header.- Returns:
- the length of the command message for a given channel length.
-