Package io.aeron.command
Class ImageMessageFlyweight
java.lang.Object
io.aeron.command.ImageMessageFlyweight
Control message flyweight for any message that needs to represent a connection.
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Correlation ID | | | +---------------------------------------------------------------+ | Subscription Registration ID | | | +---------------------------------------------------------------+ | Stream ID | +---------------------------------------------------------------+ | Channel Length | +---------------------------------------------------------------+ | Channel (ASCII) ... ... | +---------------------------------------------------------------+
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendChannel(Appendable appendable) Append the channel value to anAppendable.channel()Get the channel field as ASCII.Set the channel field as ASCII.longThe correlation id field.correlationId(long correlationId) Set the correlation id field.intlength()Get the length of the current message.intstreamId()The stream id field.streamId(int streamId) Set the stream id field.longRegistration ID for the subscription.subscriptionRegistrationId(long registrationId) Set the registration ID for the subscription.final ImageMessageFlyweightwrap(MutableDirectBuffer buffer, int offset) Wrap the buffer at a given offset for updates.
-
Constructor Details
-
ImageMessageFlyweight
public ImageMessageFlyweight()
-
-
Method Details
-
wrap
Wrap the buffer at a given offset for updates.- Parameters:
buffer- to wrapoffset- at which the message begins.- Returns:
- this for a fluent API.
-
correlationId
public long correlationId()The correlation id field.- Returns:
- correlation id field.
-
correlationId
Set the correlation id field.- Parameters:
correlationId- field value.- Returns:
- this for a fluent API.
-
subscriptionRegistrationId
public long subscriptionRegistrationId()Registration ID for the subscription.- Returns:
- registration ID for the subscription.
-
subscriptionRegistrationId
Set the registration ID for the subscription.- Parameters:
registrationId- for the subscription.- Returns:
- this for a fluent API.
-
streamId
public int streamId()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 as ASCII.- Returns:
- channel field.
-
appendChannel
Append the channel value to anAppendable.- Parameters:
appendable- to append channel to.
-
channel
Set the channel field as 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.
-