Class DestinationMessageFlyweight

java.lang.Object
io.aeron.command.CorrelatedMessageFlyweight
io.aeron.command.DestinationMessageFlyweight

public class DestinationMessageFlyweight extends CorrelatedMessageFlyweight
Control message for adding or removing a destination for a Publication in multi-destination-cast or a Subscription in multi-destination Subscription.
   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                            |
  |                                                               |
  +---------------------------------------------------------------+
  |                    Command Correlation ID                     |
  |                                                               |
  +---------------------------------------------------------------+
  |                  Registration Correlation ID                  |
  |                                                               |
  +---------------------------------------------------------------+
  |                       Channel Length                          |
  +---------------------------------------------------------------+
  |                       Channel (ASCII)                        ...
 ...                                                              |
  +---------------------------------------------------------------+
 
  • Constructor Details

    • DestinationMessageFlyweight

      public DestinationMessageFlyweight()
  • Method Details

    • wrap

      public DestinationMessageFlyweight wrap(MutableDirectBuffer buffer, int offset)
      Wrap the buffer at a given offset for updates.
      Overrides:
      wrap in class CorrelatedMessageFlyweight
      Parameters:
      buffer - to wrap.
      offset - at which the message begins.
      Returns:
      this for a fluent API.
    • registrationCorrelationId

      public long registrationCorrelationId()
      return correlation id used in registration field.
      Returns:
      correlation id field.
    • registrationCorrelationId

      public DestinationMessageFlyweight registrationCorrelationId(long correlationId)
      set registration correlation id field.
      Parameters:
      correlationId - field value.
      Returns:
      this for a fluent API.
    • channel

      public String channel()
      Get the channel field in ASCII.
      Returns:
      channel field.
    • appendChannel

      public void appendChannel(Appendable appendable)
      Append the channel value to an Appendable.
      Parameters:
      appendable - to append channel to.
    • channel

      public DestinationMessageFlyweight channel(String channel)
      Set channel field in ASCII.
      Parameters:
      channel - field value
      Returns:
      this for a fluent API.
    • length

      public int length()
      Length of the frame in bytes.
      Returns:
      length of the frame in bytes.
    • validateLength

      public void validateLength(int msgTypeId, int length)
      Validate buffer length is long enough for message.
      Overrides:
      validateLength in class CorrelatedMessageFlyweight
      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.