Class DecodedFrame<H extends org.apache.kafka.common.protocol.ApiMessage,B extends org.apache.kafka.common.protocol.ApiMessage>

java.lang.Object
io.netty.util.AbstractReferenceCounted
io.kroxylicious.proxy.frame.DecodedFrame<H,B>
Type Parameters:
H - The header type
B - The body type
All Implemented Interfaces:
Frame, io.netty.util.ReferenceCounted
Direct Known Subclasses:
DecodedRequestFrame, DecodedResponseFrame

public abstract class DecodedFrame<H extends org.apache.kafka.common.protocol.ApiMessage,B extends org.apache.kafka.common.protocol.ApiMessage> extends io.netty.util.AbstractReferenceCounted implements Frame
A frame that has been decoded (as opposed to an OpaqueFrame).
  • Field Details

    • apiVersion

      protected final short apiVersion
    • correlationId

      protected final int correlationId
    • body

      protected final B extends org.apache.kafka.common.protocol.ApiMessage body
  • Method Details

    • correlationId

      public int correlationId()
      Description copied from interface: Frame
      The correlation id.
      Specified by:
      correlationId in interface Frame
      Returns:
      The correlation id.
    • apiKeyId

      public short apiKeyId()
      Description copied from interface: Frame
      Api key id of this frame.
      Specified by:
      apiKeyId in interface Frame
    • apiKey

      public org.apache.kafka.common.protocol.ApiKeys apiKey()
    • apiVersion

      public short apiVersion()
      Description copied from interface: Frame
      Api version of this frame.
      Specified by:
      apiVersion in interface Frame
    • isDecoded

      public boolean isDecoded()
      Description copied from interface: Frame
      true if this frame is decoded, false otherwise
      Specified by:
      isDecoded in interface Frame
    • headerVersion

      protected abstract short headerVersion()
    • header

      public H header()
    • body

      public B body()
    • estimateEncodedSize

      public final int estimateEncodedSize()
      Description copied from interface: Frame
      Estimate the expected encoded size in bytes of this Frame.
      In particular, written data by Frame.encode(ByteBufAccessor) should be the same as reported by this method.
      Specified by:
      estimateEncodedSize in interface Frame
    • encode

      public final void encode(ByteBufAccessor out)
      Description copied from interface: Frame
      Write the frame, including the size prefix, to the given buffer
      Specified by:
      encode in interface Frame
      Parameters:
      out - The output buffer
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • add

      public void add(io.netty.buffer.ByteBuf buffer)
    • touch

      public io.netty.util.ReferenceCounted touch(Object hint)
      Specified by:
      touch in interface io.netty.util.ReferenceCounted
    • deallocate

      protected void deallocate()
      Specified by:
      deallocate in class io.netty.util.AbstractReferenceCounted
    • transferBuffersTo

      public void transferBuffersTo(DecodedFrame<?,?> frame)