Package io.aeron.command
Class CorrelatedMessageFlyweight
java.lang.Object
io.aeron.command.CorrelatedMessageFlyweight
- Direct Known Subclasses:
CounterMessageFlyweight,DestinationByIdMessageFlyweight,DestinationMessageFlyweight,GetNextAvailableSessionIdMessageFlyweight,PublicationMessageFlyweight,RejectImageFlyweight,RemoveMessageFlyweight,StaticCounterMessageFlyweight,SubscriptionMessageFlyweight,TerminateDriverFlyweight
Base flyweight that can be extended to track a client request.
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 | | | +---------------------------------------------------------------+
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongclientId()Get client id field.clientId(long clientId) Set client id field.longGet correlation id field.correlationId(long correlationId) Set correlation 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.
-
Field Details
-
LENGTH
public static final int LENGTHLength of the header.- See Also:
-
-
Constructor Details
-
CorrelatedMessageFlyweight
public CorrelatedMessageFlyweight()
-
-
Method Details
-
wrap
Wrap the buffer at a given offset for updates.- Parameters:
buffer- to wrap.offset- at which the message begins.- Returns:
- this for a fluent API.
-
clientId
public long clientId()Get client id field.- Returns:
- client id field.
-
clientId
Set client id field.- Parameters:
clientId- field value.- Returns:
- this for a fluent API.
-
correlationId
public long correlationId()Get correlation id field.- Returns:
- correlation id field.
-
correlationId
Set correlation id field.- Parameters:
correlationId- field value.- Returns:
- this for a fluent API.
-
validateLength
public void validateLength(int msgTypeId, int length) Validate buffer length is long enough for message.- Parameters:
msgTypeId- type of message.length- of message in bytes to validate.
-