Class PublicationErrorFrameFlyweight

java.lang.Object
io.aeron.command.PublicationErrorFrameFlyweight

public class PublicationErrorFrameFlyweight extends Object
Control message flyweight error frames received by a publication to be reported to the client.
   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
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                 Publication Registration Id                   |
  |                                                               |
  +---------------------------------------------------------------+
  |                 Destination Registration Id                   |
  |                                                               |
  +---------------------------------------------------------------+
  |                          Session ID                           |
  +---------------------------------------------------------------+
  |                           Stream ID                           |
  +---------------------------------------------------------------+
  |                          Receiver ID                          |
  |                                                               |
  +---------------------------------------------------------------+
  |                           Group Tag                           |
  |                                                               |
  +-------------------------------+-------------------------------+
  |          Address Type         |            UDP Port           |
  +-------------------------------+-------------------------------+
  |           IPv4 or IPv6 Address padded out to 16 bytes         |
  |                                                               |
  |                                                               |
  |                                                               |
  +---------------------------------------------------------------+
  |                          Error Code                           |
  +---------------------------------------------------------------+
  |                      Error Message Length                     |
  +---------------------------------------------------------------+
  |                         Error Message                        ...
 ...                                                              |
  +---------------------------------------------------------------+
 
Since:
1.47.0
  • Constructor Details

    • PublicationErrorFrameFlyweight

      public PublicationErrorFrameFlyweight()
  • Method Details

    • wrap

      public final PublicationErrorFrameFlyweight wrap(MutableDirectBuffer buffer, int offset)
      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.
    • registrationId

      public long registrationId()
      Return registration ID of the publication that received the error frame.
      Returns:
      registration ID of the publication.
    • registrationId

      public PublicationErrorFrameFlyweight registrationId(long registrationId)
      Set the registration ID of the publication that received the error frame.
      Parameters:
      registrationId - of the publication.
      Returns:
      this for a fluent API.
    • destinationRegistrationId

      public long destinationRegistrationId()
      Return registration id of the destination that received the error frame. This will only be set if the publication is using manual MDC.
      Returns:
      registration ID of the publication or Aeron.NULL_VALUE.
    • destinationRegistrationId

      public PublicationErrorFrameFlyweight destinationRegistrationId(long registrationId)
      Set the registration ID of the destination that received the error frame. Use Aeron.NULL_VALUE if not set.
      Parameters:
      registrationId - of the destination.
      Returns:
      this for a fluent API.
    • streamId

      public int streamId()
      Get the stream id field.
      Returns:
      stream id field.
    • streamId

      public PublicationErrorFrameFlyweight streamId(int streamId)
      Set the stream id field.
      Parameters:
      streamId - field value.
      Returns:
      this for a fluent API.
    • sessionId

      public int sessionId()
      Get the session id field.
      Returns:
      session id field.
    • sessionId

      public PublicationErrorFrameFlyweight sessionId(int sessionId)
      Set session id field.
      Parameters:
      sessionId - field value.
      Returns:
      this for a fluent API.
    • receiverId

      public long receiverId()
      Get the receiver id field.
      Returns:
      get the receiver id field.
    • receiverId

      public PublicationErrorFrameFlyweight receiverId(long receiverId)
      Set receiver id field.
      Parameters:
      receiverId - field value.
      Returns:
      this for a fluent API.
    • groupTag

      public long groupTag()
      Get the group tag field.
      Returns:
      the group tag field.
    • groupTag

      public PublicationErrorFrameFlyweight groupTag(long groupTag)
      Set the group tag field.
      Parameters:
      groupTag - the group tag value.
      Returns:
      this for a fluent API.
    • sourceAddress

      public PublicationErrorFrameFlyweight sourceAddress(InetSocketAddress sourceAddress)
      Set the source address for the error frame. Store the type (IPv4 or IPv6), port and address as bytes.
      Parameters:
      sourceAddress - of the error frame.
      Returns:
      this for a fluent API
    • sourceAddress

      public InetSocketAddress sourceAddress()
      Get the source address of this error frame.
      Returns:
      source address of the error frame.
    • errorCode

      public ErrorCode errorCode()
      Error code for the command.
      Returns:
      error code for the command.
    • errorCodeValue

      public int errorCodeValue()
      Error code value for the command.
      Returns:
      error code value for the command.
    • errorCode

      public PublicationErrorFrameFlyweight errorCode(ErrorCode code)
      Set the error code for the command.
      Parameters:
      code - for the error.
      Returns:
      this for a fluent API.
    • errorMessage

      public String errorMessage()
      Error message associated with the error.
      Returns:
      error message.
    • appendMessage

      public int appendMessage(Appendable appendable)
      Append the error message to an appendable without allocation.
      Parameters:
      appendable - to append error message to.
      Returns:
      number bytes copied.
    • errorMessage

      public PublicationErrorFrameFlyweight errorMessage(String message)
      Set the error message.
      Parameters:
      message - to associate with the error.
      Returns:
      this for a fluent API.
    • length

      public int length()
      Length of the error response in bytes.
      Returns:
      length of the error response in bytes.