Class RejectImageFlyweight

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

public class RejectImageFlyweight extends CorrelatedMessageFlyweight
Control message to reject an image for a 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                            |
  |                                                               |
  +---------------------------------------------------------------+
  |                       Correlation ID                          |
  |                                                               |
  +---------------------------------------------------------------+
  |                    Image Correlation ID                       |
  |                                                               |
  +---------------------------------------------------------------+
  |                           Position                            |
  |                                                               |
  +---------------------------------------------------------------+
  |                        Reason Length                          |
  +---------------------------------------------------------------+
  |                        Reason (ASCII)                       ...
  ...                                                             |
  +---------------------------------------------------------------+
 
  • Constructor Details

    • RejectImageFlyweight

      public RejectImageFlyweight()
  • Method Details

    • wrap

      public RejectImageFlyweight 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.
    • imageCorrelationId

      public long imageCorrelationId()
      Get image correlation id field.
      Returns:
      image correlation id field.
    • imageCorrelationId

      public RejectImageFlyweight imageCorrelationId(long position)
      Put image correlation id field.
      Parameters:
      position - new image correlation id value.
      Returns:
      this for a fluent API.
    • position

      public long position()
      Get position field.
      Returns:
      position field.
    • position

      public RejectImageFlyweight position(long position)
      Put position field.
      Parameters:
      position - new position value.
      Returns:
      this for a fluent API.
    • reason

      public RejectImageFlyweight reason(String reason)
      Put reason field as ASCII. Include the reason length in the message.
      Parameters:
      reason - for invalidating the image.
      Returns:
      this for a fluent API.
    • reason

      public String reason()
      Get reason field as ASCII.
      Returns:
      reason for invalidating the image.
    • reasonBufferLength

      public int reasonBufferLength()
      Length of the reason text.
      Returns:
      length of the reason text.
    • clientId

      public RejectImageFlyweight clientId(long clientId)
      Set client id field.
      Overrides:
      clientId in class CorrelatedMessageFlyweight
      Parameters:
      clientId - field value.
      Returns:
      this for a fluent API.
    • correlationId

      public RejectImageFlyweight correlationId(long correlationId)
      Set correlation id field.
      Overrides:
      correlationId in class CorrelatedMessageFlyweight
      Parameters:
      correlationId - field value.
      Returns:
      this for a fluent API.
    • computeLength

      public static int computeLength(String reason)
      Compute the length of the message based on the reason supplied.
      Parameters:
      reason - message to be return to originator.
      Returns:
      length of the message.
    • 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.