Package org.eclipse.jetty.http2.parser
Class Parser
- java.lang.Object
-
- org.eclipse.jetty.http2.parser.Parser
-
- Direct Known Subclasses:
ServerParser
public class Parser extends java.lang.Object
The HTTP/2 protocol parser.
This parser makes use of the
HeaderParser
and ofBodyParser
s to parse HTTP/2 frames.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Parser.Listener
-
Constructor Summary
Constructors Constructor Description Parser(ByteBufferPool byteBufferPool, int maxHeaderSize)
Parser(ByteBufferPool byteBufferPool, int maxHeaderSize, RateControl rateControl)
Parser(ByteBufferPool byteBufferPool, Parser.Listener listener, int maxDynamicTableSize, int maxHeaderSize)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected int
getFrameType()
HpackDecoder
getHpackDecoder()
protected Parser.Listener
getListener()
int
getMaxFrameLength()
Deprecated.int
getMaxFrameSize()
int
getMaxSettingsKeys()
protected boolean
hasFlag(int bit)
void
init(java.util.function.UnaryOperator<Parser.Listener> wrapper)
Deprecated.void
init(Parser.Listener listener)
protected void
notifyConnectionFailure(int error, java.lang.String reason)
void
parse(java.nio.ByteBuffer buffer)
Parses the givenbuffer
bytes and emit events to aParser.Listener
.protected boolean
parseBody(java.nio.ByteBuffer buffer)
protected boolean
parseHeader(java.nio.ByteBuffer buffer)
void
setMaxFrameLength(int maxFrameSize)
Deprecated.void
setMaxFrameSize(int maxFrameSize)
void
setMaxSettingsKeys(int maxSettingsKeys)
-
-
-
Constructor Detail
-
Parser
@Deprecated public Parser(ByteBufferPool byteBufferPool, Parser.Listener listener, int maxDynamicTableSize, int maxHeaderSize)
Deprecated.
-
Parser
public Parser(ByteBufferPool byteBufferPool, int maxHeaderSize)
-
Parser
public Parser(ByteBufferPool byteBufferPool, int maxHeaderSize, RateControl rateControl)
-
-
Method Detail
-
init
@Deprecated public void init(java.util.function.UnaryOperator<Parser.Listener> wrapper)
Deprecated.
-
init
public void init(Parser.Listener listener)
-
getListener
protected Parser.Listener getListener()
-
getHpackDecoder
public HpackDecoder getHpackDecoder()
-
parse
public void parse(java.nio.ByteBuffer buffer)
Parses the given
buffer
bytes and emit events to aParser.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(java.nio.ByteBuffer buffer)
-
parseBody
protected boolean parseBody(java.nio.ByteBuffer buffer)
-
getFrameType
protected int getFrameType()
-
hasFlag
protected boolean hasFlag(int bit)
-
getMaxFrameLength
@Deprecated public int getMaxFrameLength()
Deprecated.
-
setMaxFrameLength
@Deprecated public void setMaxFrameLength(int maxFrameSize)
Deprecated.
-
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, java.lang.String reason)
-
-