Class NakFlyweight

All Implemented Interfaces:
Comparable<DirectBuffer>, AtomicBuffer, DirectBuffer, MutableDirectBuffer

public class NakFlyweight extends HeaderFlyweight
Flyweight for a NAK Message Frame.

Data Loss Recovery wiki page.

  • Field Details

    • HEADER_LENGTH

      public static final int HEADER_LENGTH
      Length of the frame in bytes.
      See Also:
  • Constructor Details

    • NakFlyweight

      public NakFlyweight()
      Default constructor which can later be used to wrap a frame.
    • NakFlyweight

      public NakFlyweight(ByteBuffer buffer)
      Construct the flyweight over a frame.
      Parameters:
      buffer - containing the frame.
    • NakFlyweight

      public NakFlyweight(UnsafeBuffer buffer)
      Construct the flyweight over a frame.
      Parameters:
      buffer - containing the frame.
  • Method Details

    • sessionId

      public int sessionId()
      The session-id for the stream.
      Returns:
      session-id for the stream.
    • sessionId

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

      public int streamId()
      The stream-id for the stream.
      Returns:
      stream-id for the stream.
    • streamId

      public NakFlyweight streamId(int streamId)
      Set stream-id for the stream.
      Parameters:
      streamId - stream-id for the stream.
      Returns:
      this for a fluent API.
    • termId

      public int termId()
      The term-id for the stream.
      Returns:
      term-id for the stream.
    • termId

      public NakFlyweight termId(int termId)
      Set term-id for the stream.
      Parameters:
      termId - term-id for the stream.
      Returns:
      this for a fluent API.
    • termOffset

      public int termOffset()
      The term-offset for the stream.
      Returns:
      term-offset for the stream.
    • termOffset

      public NakFlyweight termOffset(int termOffset)
      Set term-offset for the stream.
      Parameters:
      termOffset - term-offset for the stream.
      Returns:
      for a fluent API.
    • length

      public int length()
      The length of the encoded frame.
      Returns:
      length of the encoded frame.
    • length

      public NakFlyweight length(int length)
      Set length of the encoded frame.
      Parameters:
      length - of the encoded frame.
      Returns:
      this for a fluent API.
    • toString

      public String toString()
      Overrides:
      toString in class UnsafeBuffer