Class ErrorResponseFlyweight

java.lang.Object
io.aeron.command.ErrorResponseFlyweight

public class ErrorResponseFlyweight extends Object
Control message flyweight for any errors sent from driver to clients
   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
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |              Offending Command Correlation ID                 |
  |                                                               |
  +---------------------------------------------------------------+
  |                         Error Code                            |
  +---------------------------------------------------------------+
  |                   Error Message Length                        |
  +---------------------------------------------------------------+
  |                       Error Message                          ...
 ...                                                              |
  +---------------------------------------------------------------+
 
  • Constructor Details

    • ErrorResponseFlyweight

      public ErrorResponseFlyweight()
  • Method Details

    • wrap

      public final ErrorResponseFlyweight 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.
    • offendingCommandCorrelationId

      public long offendingCommandCorrelationId()
      Return correlation ID of the offending command.
      Returns:
      correlation ID of the offending command
    • offendingCommandCorrelationId

      public ErrorResponseFlyweight offendingCommandCorrelationId(long correlationId)
      Set correlation ID of the offending command.
      Parameters:
      correlationId - of the offending command.
      Returns:
      this for a fluent API.
    • 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 ErrorResponseFlyweight 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 ErrorResponseFlyweight 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.