Package io.aeron.command
Class ErrorResponseFlyweight
java.lang.Object
io.aeron.command.ErrorResponseFlyweight
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintappendMessage(Appendable appendable) Append the error message to an appendable without allocation.Error code for the command.Set the error code for the command.intError code value for the command.Error message associated with the error.errorMessage(String message) Set the error message.intlength()Length of the error response in bytes.longReturn correlation ID of the offending command.offendingCommandCorrelationId(long correlationId) Set correlation ID of the offending command.final ErrorResponseFlyweightwrap(MutableDirectBuffer buffer, int offset) Wrap the buffer at a given offset for updates.
-
Constructor Details
-
ErrorResponseFlyweight
public ErrorResponseFlyweight()
-
-
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.
-
offendingCommandCorrelationId
public long offendingCommandCorrelationId()Return correlation ID of the offending command.- Returns:
- correlation ID of the offending command
-
offendingCommandCorrelationId
Set correlation ID of the offending command.- Parameters:
correlationId- of the offending command.- Returns:
- this for a fluent API.
-
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
Set the error code for the command.- Parameters:
code- for the error.- Returns:
- this for a fluent API.
-
errorMessage
Error message associated with the error.- Returns:
- error message
-
appendMessage
Append the error message to an appendable without allocation.- Parameters:
appendable- to append error message to.- Returns:
- number bytes copied.
-
errorMessage
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.
-