Package org.eclipse.jetty.http2.parser
Class SettingsBodyParser
- java.lang.Object
-
- org.eclipse.jetty.http2.parser.BodyParser
-
- org.eclipse.jetty.http2.parser.SettingsBodyParser
-
public class SettingsBodyParser extends BodyParser
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
SettingsBodyParser.State
-
Field Summary
Fields Modifier and Type Field Description private int
cursor
private int
keys
private int
length
private static org.eclipse.jetty.util.log.Logger
LOG
private int
maxKeys
private int
settingId
private java.util.Map<java.lang.Integer,java.lang.Integer>
settings
private int
settingValue
private SettingsBodyParser.State
state
-
Constructor Summary
Constructors Constructor Description SettingsBodyParser(HeaderParser headerParser, Parser.Listener listener)
SettingsBodyParser(HeaderParser headerParser, Parser.Listener listener, int maxKeys)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
emptyBody(java.nio.ByteBuffer buffer)
int
getMaxKeys()
protected boolean
onSetting(java.nio.ByteBuffer buffer, java.util.Map<java.lang.Integer,java.lang.Integer> settings, int key, int value)
protected boolean
onSettings(java.nio.ByteBuffer buffer, java.util.Map<java.lang.Integer,java.lang.Integer> settings)
private boolean
onSettings(java.nio.ByteBuffer buffer, SettingsFrame frame)
boolean
parse(java.nio.ByteBuffer buffer)
Parses the body bytes in the givenbuffer
; only the body bytes are consumed, therefore when this method returns, the buffer may contain unconsumed bytes.private boolean
parse(java.nio.ByteBuffer buffer, int streamId, int bodyLength)
static SettingsFrame
parseBody(java.nio.ByteBuffer buffer)
Parses the given buffer containing the whole body of aSETTINGS
frame (without header bytes), typically from theHTTP2-Settings
header.protected void
reset()
private boolean
validateFrame(java.nio.ByteBuffer buffer, int streamId, int bodyLength)
-
Methods inherited from class org.eclipse.jetty.http2.parser.BodyParser
connectionFailure, getBodyLength, getFrameType, getStreamId, hasFlag, isEndStream, isPadding, notifyData, notifyGoAway, notifyHeaders, notifyPing, notifyPriority, notifyPushPromise, notifyReset, notifySettings, notifyWindowUpdate, rateControlOnEvent, streamFailure
-
-
-
-
Field Detail
-
LOG
private static final org.eclipse.jetty.util.log.Logger LOG
-
maxKeys
private final int maxKeys
-
state
private SettingsBodyParser.State state
-
cursor
private int cursor
-
length
private int length
-
settingId
private int settingId
-
settingValue
private int settingValue
-
keys
private int keys
-
settings
private java.util.Map<java.lang.Integer,java.lang.Integer> settings
-
-
Constructor Detail
-
SettingsBodyParser
public SettingsBodyParser(HeaderParser headerParser, Parser.Listener listener)
-
SettingsBodyParser
public SettingsBodyParser(HeaderParser headerParser, Parser.Listener listener, int maxKeys)
-
-
Method Detail
-
reset
protected void reset()
-
getMaxKeys
public int getMaxKeys()
-
emptyBody
protected void emptyBody(java.nio.ByteBuffer buffer)
- Overrides:
emptyBody
in classBodyParser
-
validateFrame
private boolean validateFrame(java.nio.ByteBuffer buffer, int streamId, int bodyLength)
-
parse
public boolean parse(java.nio.ByteBuffer buffer)
Description copied from class:BodyParser
Parses the body bytes in the given
buffer
; only the body bytes are consumed, therefore when this method returns, the buffer may contain unconsumed bytes.- Specified by:
parse
in classBodyParser
- Parameters:
buffer
- the buffer to parse- Returns:
- true if the whole body bytes were parsed, false if not enough body bytes were present in the buffer
-
parse
private boolean parse(java.nio.ByteBuffer buffer, int streamId, int bodyLength)
-
onSetting
protected boolean onSetting(java.nio.ByteBuffer buffer, java.util.Map<java.lang.Integer,java.lang.Integer> settings, int key, int value)
-
onSettings
protected boolean onSettings(java.nio.ByteBuffer buffer, java.util.Map<java.lang.Integer,java.lang.Integer> settings)
-
onSettings
private boolean onSettings(java.nio.ByteBuffer buffer, SettingsFrame frame)
-
parseBody
public static SettingsFrame parseBody(java.nio.ByteBuffer buffer)
Parses the given buffer containing the whole body of a
SETTINGS
frame (without header bytes), typically from theHTTP2-Settings
header.- Parameters:
buffer
- the buffer containing the body ofSETTINGS
frame- Returns:
- the
SETTINGS
frame from the parsed body bytes
-
-