Class Http2Frame

java.lang.Object
org.glassfish.grizzly.http2.frames.Http2Frame
All Implemented Interfaces:
Cacheable
Direct Known Subclasses:
DataFrame, GoAwayFrame, HeaderBlockFragment, PingFrame, PriorityFrame, RstStreamFrame, SettingsFrame, UnknownFrame, WindowUpdateFrame

public abstract class Http2Frame extends Object implements Cacheable
  • Field Details

    • FRAME_HEADER_SIZE

      public static final int FRAME_HEADER_SIZE
      See Also:
    • DONT_RECYCLE

      protected static final boolean DONT_RECYCLE
    • length

      protected int length
    • frameBuffer

      protected Buffer frameBuffer
  • Constructor Details

    • Http2Frame

      protected Http2Frame()
  • Method Details

    • toBuffer

      public Buffer toBuffer()
    • toBuffer

      public abstract Buffer toBuffer(MemoryManager memoryManager)
    • isFlagSet

      public boolean isFlagSet(int flag)
    • setFlag

      public void setFlag(int flag)
    • clearFlag

      public void clearFlag(int flag)
    • getFlags

      public int getFlags()
      Returns:
      flags for the frame. Only the first 8 bits are relevant.
    • setFlags

      protected void setFlags(int flags)
      Sets flags for the frame. Only the first 8 bits are relevant.
      Parameters:
      flags - the flags for this frame
    • getLength

      public int getLength()
      Returns:
      the length of this frame.
    • calcLength

      protected abstract int calcLength()
      Returns:
      the length of this frame.
    • getFlagNamesMap

      protected abstract Map<Integer,String> getFlagNamesMap()
      Returns:
      the Map with flag bit - to - flag name mapping
    • onPayloadUpdated

      protected void onPayloadUpdated()
      The method should be invoked once packet payload is updated
    • getType

      public abstract int getType()
      Returns:
      the type of the frame.
    • getStreamId

      public int getStreamId()
      Returns:
      the stream ID associated with the frame.
    • setStreamId

      protected void setStreamId(int streamId)
      Sets the stream ID associated with the data frame.
      Parameters:
      streamId - the stream ID of this frame.
    • toString

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

      public String headerToString()
    • setFrameBuffer

      protected void setFrameBuffer(Buffer frameBuffer)
    • serializeFrameHeader

      protected void serializeFrameHeader(Buffer buffer)
    • recycle

      public void recycle()
      Specified by:
      recycle in interface Cacheable