Class Parser

java.lang.Object
org.eclipse.jetty.http2.parser.Parser
Direct Known Subclasses:
ServerParser

public class Parser extends Object

The HTTP/2 protocol parser.

This parser makes use of the HeaderParser and of BodyParsers to parse HTTP/2 frames.

  • Constructor Details

  • Method Details

    • init

      public void init(Parser.Listener listener)
    • getListener

      protected Parser.Listener getListener()
    • getHpackDecoder

      public HpackDecoder getHpackDecoder()
    • getBeginNanoTime

      public long getBeginNanoTime()
    • parse

      public void parse(ByteBuffer buffer)

      Parses the given buffer bytes and emit events to a Parser.Listener.

      When this method returns, the buffer may not be fully consumed, so invocations to this method should be wrapped in a loop:

       while (buffer.hasRemaining())
           parser.parse(buffer);
       
      Parameters:
      buffer - the buffer to parse
    • parseHeader

      protected boolean parseHeader(ByteBuffer buffer)
    • parseBody

      protected boolean parseBody(ByteBuffer buffer)
    • getFrameType

      protected int getFrameType()
    • hasFlag

      protected boolean hasFlag(int bit)
    • getMaxFrameSize

      public int getMaxFrameSize()
    • setMaxFrameSize

      public void setMaxFrameSize(int maxFrameSize)
    • getMaxSettingsKeys

      public int getMaxSettingsKeys()
    • setMaxSettingsKeys

      public void setMaxSettingsKeys(int maxSettingsKeys)
    • notifyConnectionFailure

      protected void notifyConnectionFailure(int error, String reason)